:root{
    color-scheme:light;
    --ink:#000;
    --muted:#000;
    --green:#176347;
    --line:#dce3e5;
    --bg:#f3f6f7;
}

*{box-sizing:border-box}

body{
    margin:0;
    background:var(--bg);
    color:var(--ink);
    font:16px/1.55 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

a{color:inherit;text-decoration:none}
button,input,select{font:inherit}
a,button,input,select{-webkit-tap-highlight-color:transparent}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible{
    outline:3px solid #d5a524;
    outline-offset:4px;
}

[hidden]{display:none!important}

/* ---------- HEADER ---------- */

.site-header{
    display:block;
    width:100%;
    min-height:0;
    margin:0 0 24px;
    padding:0;
    background:#fff;
    border-bottom:1px solid var(--line);
    box-shadow:0 3px 12px rgba(0,0,0,.035);
}

.site-header-top{
    width:100%;
    max-width:1288px;
    margin:0 auto;
    padding:18px 24px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:24px;
}

.site-logo{
    display:inline-flex;
    align-items:center;
    flex:0 1 auto;
    min-width:0;
    padding:2px 4px;
    border-radius:10px;
    transition:transform .18s ease;
}

.site-logo img{
    display:block;
    width:auto;
    height:auto;
    max-width:460px;
    max-height:96px;
    filter:drop-shadow(0 2px 3px rgba(0,0,0,.10));
}

.site-logo:hover{transform:translateY(-1px)}

.header-stats{
    display:flex;
    align-items:stretch;
    justify-content:flex-end;
    gap:12px;
    flex:0 0 auto;
}

.header-stat{
    min-width:130px;
    padding:10px 16px;
    border:1px solid #dfe5e6;
    border-radius:8px;
    background:linear-gradient(180deg,#fff 0%,#f7f8f8 100%);
    text-align:center;
    box-shadow:0 3px 9px rgba(0,0,0,.035);
}

.header-stat strong{
    display:block;
    font-size:20px;
    line-height:1.05;
    font-weight:800;
}

.header-stat span{
    display:block;
    margin-top:4px;
    color:#000;
    font-size:14px;
    line-height:1.2;
    font-weight:600;
}

/* ---------- HERO HOME ---------- */

.hero-header{
    width:100%;
    max-width:1288px;
    margin:0 auto;
    padding:28px 24px 38px;
    display:grid;
    grid-template-columns:minmax(0,1.3fr) minmax(360px,.7fr);
    gap:45px;
    align-items:center;
}

.hero-copy{
    width:auto;
    min-width:0;
}

.hero-kicker{
    margin:0 0 12px;
    color:var(--green);
    font-size:13px;
    font-weight:800;
    letter-spacing:.14em;
}

.hero-header h1{
    width:auto;
    max-width:760px;
    margin:0 0 16px;
    font-size:48px;
    line-height:1.08;
    letter-spacing:-1.5px;
    overflow-wrap:normal;
    word-break:normal;
}

.hero-lead{
    max-width:750px;
    margin:0;
    color:#333;
    font-size:17px;
    line-height:1.6;
}

.hero-actions{
    margin-top:24px;
    display:flex;
    flex-wrap:wrap;
    gap:12px;
}

.hero-btn{
    min-height:48px;
    padding:0 20px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:1px solid var(--green);
    border-radius:8px;
    font-size:15px;
    font-weight:700;
    transition:transform .15s ease,box-shadow .15s ease,background-color .15s ease;
}

.hero-btn:hover{transform:translateY(-1px)}

.hero-btn-primary{
    background:var(--green);
    color:#fff;
    box-shadow:0 4px 10px rgba(23,99,71,.16);
}

.hero-btn-primary:hover{
    background:#104b36;
    color:#fff;
    box-shadow:0 6px 14px rgba(23,99,71,.22);
}

.hero-btn-secondary{
    background:#fff;
    color:var(--green);
}

.hero-btn-secondary:hover{background:#edf5f0}

.hero-media{
    width:100%;
    min-width:0;
}

.hero-media img{
    display:block;
    width:100%;
    height:230px;
    object-fit:cover;
    border:1px solid var(--line);
    border-radius:16px;
    background:#f3f6f7;
    box-shadow:0 10px 28px rgba(0,0,0,.09),0 2px 5px rgba(0,0,0,.04);
}

/* ---------- LAYOUT GENERAL ---------- */

main{
    max-width:1288px;
    padding:0 24px;
    margin:auto;
}

.heading{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:24px;
    margin:42px 0 30px;
}

.heading p{margin:6px 0 0}
.home-heading{flex-wrap:wrap}

.eyebrow{
    margin:0 0 8px;
    color:var(--green);
    font-size:12px;
    font-weight:750;
    letter-spacing:.12em;
}

h1{
    margin:8px 0;
    font-size:clamp(30px,4vw,44px);
    line-height:1.15;
    letter-spacing:-.035em;
    overflow-wrap:anywhere;
}

h2{
    margin:0;
    font-size:22px;
    line-height:1.25;
    overflow-wrap:anywhere;
}

.muted{color:var(--muted)}

/* ---------- BRANDURI ---------- */

.brands-grid{
    display:grid;
    grid-template-columns:repeat(6,minmax(0,1fr));
    gap:16px;
}

.brand-card{
    display:flex;
    flex-direction:column;
    background:#fff;
    border:1px solid var(--line);
    border-radius:10px;
    overflow:hidden;
    transition:border-color .15s,transform .15s;
}

.brand-card:hover,
.model-card:hover{
    border-color:var(--green);
    transform:translateY(-3px);
}

.logo{
    min-width:0;
    display:flex;
    align-items:center;
    justify-content:center;
    aspect-ratio:1;
    background:#fff;
    overflow:hidden;
}

.logo img{
    width:100%;
    height:100%;
    object-fit:contain;
}

.logo-name{
    padding:15px;
    font-size:clamp(18px,2vw,27px);
    font-weight:800;
    line-height:1.15;
    letter-spacing:-.04em;
    text-align:center;
    overflow-wrap:anywhere;
}

.brands-grid .logo{
    width:100%;
    height:138px;
    aspect-ratio:auto;
    flex-shrink:0;
}

.brands-grid .logo img{
    width:138px;
    max-width:100%;
    height:138px;
    object-fit:contain;
}

.brands-grid .logo-name{font-size:22px}

.card-bottom{
    flex:1;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:2px;
    padding:12px 10px;
    border-top:1px solid var(--line);
    background:#f8f8f8;
    text-align:center;
}

.card-bottom span{
    color:var(--muted);
    font-size:14px;
}

/* ---------- BRAND / MODEL HEADER ---------- */

.breadcrumbs{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    margin-top:28px;
    color:var(--muted);
    font-size:14px;
}

.breadcrumbs a:hover{
    color:var(--green);
    text-decoration:underline;
}

.catalog-toolbar{
    margin:26px 0 12px;
    display:grid;
    grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);
    gap:26px;
    align-items:center;
}

.brand-heading{
    min-width:0;
    margin:0;
    justify-content:flex-start;
    gap:18px;
}

.brand-heading>div{min-width:0}
.catalog-toolbar h1{font-size:clamp(28px,3vw,40px)}

.small{
    width:100px;
    flex:none;
    border:1px solid var(--line);
    border-radius:8px;
}

.small .logo-name{font-size:18px}

.brand-logo-link{
    display:block;
    flex:none;
    border-radius:8px;
    transition:transform .15s ease,box-shadow .15s ease;
}

.brand-logo-link:hover{
    transform:translateY(-2px);
    box-shadow:0 5px 14px rgba(0,0,0,.08);
}

/* ---------- FILTRE / CAUTARE ---------- */

.filters{
    display:grid;
    grid-template-columns:minmax(180px,.85fr) minmax(240px,1.3fr);
    gap:24px;
    align-items:end;
    padding:22px;
    background:#fff;
    border:1px solid var(--line);
    border-radius:10px;
}

.catalog-toolbar .filters{
    min-width:0;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    gap:16px;
    padding:18px;
}

.catalog-toolbar .filters form{min-width:0}

.catalog-toolbar .filters.filters-model-page{
    grid-template-columns:1fr;
}

label{
    display:block;
    font-size:14px;
    font-weight:600;
}

input,
select{
    display:block;
    width:100%;
    min-width:0;
    min-height:48px;
    margin-top:7px;
    padding:12px;
    border:1px solid #bac8cc;
    border-radius:6px;
    background:#fff;
    color:var(--ink);
    font-size:16px;
}

input::placeholder{
    color:#000;
    opacity:1;
}

button{
    min-height:48px;
    padding:12px 18px;
    border:1px solid var(--green);
    border-radius:6px;
    background:#f8f8f8;
    color:#000;
    cursor:pointer;
    font-size:16px;
    font-weight:600;
    white-space:nowrap;
}

button:hover,
.secondary:hover{
    background:#e5e5e5;
    color:#000;
}

.secondary{
    background:#fff;
    color:var(--green);
}

.select-line{
    display:flex;
    align-items:flex-end;
    gap:10px;
}

.select-line select{flex:1}

.filter-status{
    min-height:22px;
    margin:12px 0;
    color:var(--muted);
    font-size:14px;
}

.mobile-search-results{
    display:none;
    margin:0 0 22px;
    padding:0;
    list-style:none;
}

.mobile-search-results:not([hidden]){
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

.mobile-search-results li{
    width:calc(25% - 8px);
    min-width:0;
}

.mobile-search-results a{
    width:100%;
    min-height:48px;
    padding:13px 16px;
    display:flex;
    flex-direction:column;
    gap:3px;
    background:#fff;
    border:1px solid var(--line);
    border-radius:7px;
    overflow-wrap:anywhere;
}

.mobile-search-results a:hover{border-color:var(--green)}

.mobile-search-results .result-name{
    color:var(--ink);
    font-size:16px;
    font-weight:650;
}

.mobile-search-results .result-years{
    color:var(--muted);
    font-size:14px;
}

/* ---------- MODELE ---------- */

.models-grid{
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:16px;
}

.model-card{
    min-height:170px;
    padding:20px;
    display:flex;
    flex-direction:column;
    background:#fff;
    border:1px solid var(--line);
    border-radius:8px;
    transition:border-color .15s,transform .15s;
}

.model-card h2{
    margin:12px 0 0;
    font-size:25px;
}

.model-card p{
    margin:8px 0 0;
    font-size:14px;
}

.model-card p:last-of-type{margin-bottom:0}

.footnote{
    max-width:900px;
    margin-top:24px;
    color:var(--muted);
    font-size:13px;
}

/* ---------- SPECIFICATII ---------- */

.details-layout{display:block}

.specifications{
    column-count:2;
    column-gap:24px;
    column-fill:balance;
}

.specifications>.spec-section{
    display:inline-block;
    width:100%;
    margin:0 0 24px;
    vertical-align:top;
    break-inside:avoid;
    page-break-inside:avoid;
}

.spec-section{
    background:#fff;
    border:1px solid var(--line);
    border-radius:10px;
    overflow:hidden;
    scroll-margin-top:20px;
}

.specifications .spec-title{
    padding:10px 18px;
    background:#f4f2f2;
    border-bottom:1px solid var(--line);
}

.specifications .spec-title h2{
    color:#000;
    font-size:18px;
}

dl{margin:0}

.specifications .spec-row{
    margin:0 22px;
    padding:15px 0;
    display:grid;
    grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);
    gap:18px;
    border-bottom:1px solid #e6ebed;
}

.spec-row:last-child{border:0}

dt{
    color:#000;
    font-weight:500;
    overflow-wrap:anywhere;
}

dd{
    min-width:0;
    margin:0;
    color:#000;
    overflow-wrap:anywhere;
}

.value,
.notes{white-space:pre-line}

.notes{
    margin:8px 0 0;
    color:#000;
    font-size:14px;
}

.unlabelled{display:block}

/* ---------- MESAJE / ADMIN ---------- */

.notice{
    padding:16px 20px;
    background:#e7f1eb;
    border-left:3px solid var(--green);
    border-radius:4px;
}

.error{
    background:#fff0ed;
    border-color:#b44028;
}

.empty{
    padding:36px;
    background:#fff;
    border:1px solid var(--line);
    border-radius:10px;
}

.empty a{
    color:var(--green);
    text-decoration:underline;
}

.panel{
    padding:24px;
    background:#fff;
    border:1px solid var(--line);
    border-radius:10px;
}

.login{max-width:460px}
.login button{margin-top:18px}

.admin-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:20px;
}

.upload-card h2{margin:18px 0}

.upload-card input{
    padding:10px;
    font-size:14px;
}

.upload-card button{
    width:100%;
    margin-top:16px;
}

footer{
    margin-top:60px;
    padding:22px 0 30px;
    display:flex;
    justify-content:space-between;
    gap:16px;
    border-top:1px solid var(--line);
    color:var(--muted);
    font-size:13px;
}

/* ---------- TABLETE ---------- */

@media(max-width:1000px){

    .site-logo img{
        max-width:350px;
        max-height:82px;
    }

    .header-stat{
        min-width:110px;
        padding:9px 12px;
    }

    .header-stat strong{font-size:22px}
    .header-stat span{font-size:13px}

    .hero-header{
        grid-template-columns:1fr;
        gap:22px;
    }

    .hero-header h1{font-size:40px}
    .hero-media img{height:190px}

    .brands-grid{
        grid-template-columns:repeat(4,minmax(0,1fr));
    }

    .models-grid{
        grid-template-columns:repeat(3,minmax(0,1fr));
    }

    .admin-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }

    .mobile-search-results li{
        width:calc(50% - 5px);
    }

    .specifications{
        column-count:1;
    }
}

/* ---------- MOBIL ---------- */

@media(max-width:700px){

    main{padding:0 16px}

    .site-header{margin-bottom:20px}

    .site-header-top{
        padding:12px 14px;
        flex-direction:row;
        align-items:center;
        justify-content:space-between;
        gap:10px;
    }

    .site-logo{
        flex:0 1 auto;
        min-width:0;
        padding:0;
    }

    .site-logo img{
        width:auto;
        height:auto;
        max-width:240px;
        max-height:80px;
    }

    .header-stats{
        width:auto;
        flex:0 0 auto;
        gap:6px;
    }

    .header-stat{
        width:60px;
        min-width:0;
        padding:7px 5px;
        border-radius:8px;
    }

    .header-stat strong{
        font-size:15px;
        line-height:1.1;
    }

    .header-stat span{
        margin-top:2px;
        color:#104B36;
        font-size:12px;
        line-height:1.2;
        font-weight:600;
    }

    .hero-header{
        padding:20px 16px 26px;
        grid-template-columns:1fr;
        gap:18px;
    }

    .hero-kicker{
        margin-bottom:10px;
        font-size:12px;
    }

    .hero-header h1{
        font-size:32px;
        line-height:1.1;
    }

    .hero-lead{
        font-size:15px;
        line-height:1.5;
    }

    .hero-actions{
        margin-top:18px;
        gap:10px;
    }

    .hero-btn{width:100%}

    .hero-media img{
        height:150px;
        box-shadow:0 6px 18px rgba(0,0,0,.08);
    }

    .heading{
        margin:28px 0 24px;
        gap:14px;
    }

    .brands-grid{
        grid-template-columns:repeat(3,minmax(0,1fr));
        gap:10px;
    }

    .brand-card .logo-name{
        padding:8px;
        font-size:clamp(14px,3.6vw,20px);
        overflow-wrap:anywhere;
    }

    .card-bottom{
        padding:10px 8px;
        font-size:14px;
        overflow-wrap:anywhere;
    }

    .card-bottom span{font-size:12px}

    .small{width:80px}
    .small .logo-name{font-size:15px}

    .catalog-toolbar{
        grid-template-columns:1fr;
        gap:16px;
        margin-top:22px;
    }

    .filters,
    .catalog-toolbar .filters,
    .catalog-toolbar .filters.filters-model-page{
        grid-template-columns:1fr;
        gap:16px;
        padding:18px;
    }

    .select-line{
        flex-direction:column;
        align-items:stretch;
        gap:12px;
    }

    .select-line button{width:100%}

    .models-grid{display:none}

    .mobile-search-results:not([hidden]){display:block}

    .mobile-search-results li{
        width:100%;
        margin-bottom:8px;
    }

    .specifications{column-count:1}

    .specifications .spec-title{padding:10px 18px}

    .specifications .spec-row{
        margin:0 20px;
        grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);
        gap:15px;
        font-size:15px;
    }

    dt,dd{overflow-wrap:anywhere}

    .admin-grid{grid-template-columns:1fr}
    .footnote{font-size:12px}
    .empty{padding:24px}

    footer{
        margin-top:40px;
        flex-direction:column;
        gap:4px;
    }
}

/* Telefoane foarte inguste */

@media(max-width:370px){

    .site-header-top{
        padding:10px;
        gap:6px;
    }

    .site-logo img{max-width:132px}
    .header-stats{gap:4px}

    .header-stat{
        width:67px;
        padding:6px 3px;
    }

    .header-stat strong{font-size:15px}
    .header-stat span{font-size:10px}
}

@media(prefers-reduced-motion:reduce){

    .model-card,
    .brand-card,
    .brand-logo-link,
    .site-logo,
    .hero-btn{
        transition:none;
    }

    .model-card:hover,
    .brand-card:hover,
    .brand-logo-link:hover,
    .site-logo:hover,
    .hero-btn:hover{
        transform:none;
    }
}