/* ═══════════════════════════════════════════
   PRODUCT GRID
   ═══════════════════════════════════════════ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
/*
 * Lista nézet. A kapcsoló a `<html>` elemen ül (`data-product-view`), nem a
 * rácson: a szűrő AJAX-rétege minden szűrésnél lecseréli a teljes
 * `.products-area`-t, a rácsra tett osztály így elveszne. A `.products-area`
 * előtag miatt a főoldali és a kapcsolódó termékek rácsát nem érinti.
 */
[data-product-view="list"] .products-area .product-grid {
    grid-template-columns: 1fr;
    gap: 12px;
}

/* ─── PRODUCT CARD (Grid) ─── */
.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    animation: cardIn 0.4s ease both;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-20);
}

/* Card tag / badge */
.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
}
.card-badge.new { background: var(--tag-new); }
.card-badge.fast { background: var(--tag-fast); }
.card-badge.rent { background: var(--tag-rent); }

/* Card header row (title + logo) */
.card-header-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 4px;
}
.card-header-text {
    flex: 1;
    min-width: 0;
}

/* Card brand logo */
.card-brand {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    overflow: hidden;
    background: #fff;
}
.card-brand img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Card image */
.card-image {
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}
.card-image::before {
    content: none;
}
.card-image img {
    max-height: 100%;
    max-width: 85%;
    width: auto;
    height: auto;
    object-fit: contain;
    position: relative;
    z-index: 1;
    transition: transform 0.4s ease;
    mix-blend-mode: multiply;
}
.product-card:hover .card-image img { transform: scale(1.06); }

/* Card body */
.card-body {
    padding: 16px 18px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.card-name {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
    line-height: 1.2;
    letter-spacing: 0.01em;
}
.card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Specs grid */
.card-specs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0;
    margin: 14px 0 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.spec-card {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    border-right: 1px solid var(--border-light);
    background: #fff;
}
.spec-card:last-child { border-right: none; }
.spec-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 3px;
    font-family: var(--font-heading);
}
.spec-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    font-family: var(--font-heading);
    line-height: 1.2;
    white-space: nowrap;
}
.spec-value small {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Category tags */
.card-categories {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.category-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
    background: var(--primary-10);
    color: var(--primary-dark);
    font-weight: 500;
}

/* Card action */
.card-footer {
    margin-top: auto;
    display: flex;
    gap: 8px;
}
.btn-primary {
    flex: 1;
    padding: 10px 16px;
    background: var(--btn-gradient);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
    border: 2px solid var(--primary);
    letter-spacing: 0.02em;
}
.btn-primary:hover { background: var(--btn-gradient-hover); border-color: var(--primary-dark); }
.btn-secondary {
    flex: 1;
    padding: 10px 14px;
    background: var(--btn-gradient-secondary);
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    letter-spacing: 0.02em;
}
.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--btn-gradient-secondary-hover);
}

/* ─── LIST VIEW CARD ─── */
[data-product-view="list"] .products-area .product-card {
    flex-direction: row;
    align-items: stretch;
}
[data-product-view="list"] .products-area .card-image {
    width: 260px;
    min-width: 260px;
    aspect-ratio: auto;
    border-bottom: none;
    border-right: 1px solid var(--border-light);
}
[data-product-view="list"] .products-area .card-body {
    flex: 1;
    padding: 16px 20px;
}
[data-product-view="list"] .products-area .card-desc { -webkit-line-clamp: 3; }
[data-product-view="list"] .products-area .card-badge { top: 8px; left: 8px; }

/*
 * Az ÜRES ÁLLAPOT és a LAPOZÓ stílusai a base.css-be kerültek: a bloglista
 * ugyanezeket az elemeket használja, az viszont nem tölti be ezt a modult.
 */

/* ═══════════════════════════════════════════
   CIKKEK A BLOGRÓL — csak keresésnél
   Ugyanaz a felépítés, mint a termékoldal „Kapcsolódó termékek" blokkja.
   ═══════════════════════════════════════════ */
.search-posts,
.search-pages {
    margin-top: 48px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}
.search-posts .section-title,
.search-pages .section-title {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: -0.01em;
    margin: 0 0 24px;
}
/* A szűrő melletti oszlopban két kártya fér el kényelmesen. */
.search-posts .blog-grid {
    padding: 0;
    gap: 20px;
}
@media (max-width: 640px) {
    .search-posts .blog-grid { grid-template-columns: 1fr; }
}

/* Oldaltalálatok: sima hivatkozáslista — a Rólunk vagy az ÁSZF mellé
   nem tartozik bélyegkép, egy kártyarács itt csak zajt csinálna. */
.search-page-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.search-page-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--dark);
    transition: var(--transition);
}
.search-page-list a:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.search-page-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
}

/* Az eszköztár jobb oldala: rendezés + darabszám egy sorban. */
.toolbar-form {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════
   KATEGÓRIA FEJLÉC (cím + bevezető egy keretben)
   Nincs sötét hero: a cím és a leírás együtt, a termékek fölött, balra
   zárva, közös keretben. Háttér nélkül, hogy ne versenyezzen a
   termékkártyákkal — a keret önmagában elég az elhatároláshoz.
   ═══════════════════════════════════════════ */
.products-header {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    margin-bottom: 20px;
    background: transparent;
    position: relative;
    overflow: hidden;      /* a borítókép a lekerekített sarkon belül maradjon */
}
.products-header-inner {
    position: relative;
    z-index: 2;            /* a borítókép fölé */
    display: flex;
    align-items: center;
    gap: 28px;
}
.products-header-text { min-width: 0; }

/* ─── Borítókép (kategória) ─── */
/*
 * A kép a keret jobb 40%-át tölti ki, és balról a lap háttérszínébe olvad,
 * hogy ne „beillesztett képnek", hanem a keret részének látsszon. A szöveg
 * ezért 58%-ig ér: az utolsó pár százalék már az átmenet közepe.
 */
.products-header.has-cover .products-header-text { max-width: 58%; }
.products-header-media {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 40%;
    z-index: 0;
    overflow: hidden;
}
.products-header-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.products-header-fade {
    position: absolute;
    inset: 0;
    /*
     * Balról a lap tömör háttérszíne (--bg), jobbra átlátszó. A középső,
     * 55%-os megállító nélkül az átmenet végig lineárisan halványodna, és a
     * kép bal fele fátyol alatt maradna — így viszont hamar kitisztul.
     */
    background: linear-gradient(
        to right,
        #f7f8f9 0%,
        rgba(247,248,249,0.94) 20%,
        rgba(247,248,249,0.5) 55%,
        rgba(247,248,249,0) 100%
    );
}

/* ─── Márkalogó ─── */
/*
 * A logó NEM olvad bele: áttetsző hátterű, kontrasztos ábra, amit az
 * átmenet olvashatatlanná tenne. Saját helyén ül, a szöveg mellett.
 */
.products-header.has-logo .products-header-inner { justify-content: space-between; }
.products-header-brand {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 170px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}
/*
 * `width: auto` — a `width: 100%` a négyzetes logókat (mind a négy 1280×1280)
 * a doboz szélességére feszítette, és az `object-fit: contain` miatt a kép
 * 64px magasra zsugorodott, oldalt 34-34px üres hellyel. Így a logó a saját
 * arányában, a doboz teljes magasságában jelenik meg.
 */
.products-header-logo {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 84px;
    object-fit: contain;
    display: block;
}

@media (max-width: 900px) {
    /*
     * Két hasábra nincs hely. A kép nem tűnik el, hanem a keret teljes
     * hátterévé válik: az átmenet vízszintesből függőlegesbe fordul, a
     * szöveg a világos felső rész fölött marad olvasható.
     */
    .products-header.has-cover .products-header-text { max-width: 100%; }
    .products-header-media { width: 100%; }
    .products-header-fade {
        background: linear-gradient(
            to bottom,
            #f7f8f9 0%,
            rgba(247,248,249,0.9) 55%,
            rgba(247,248,249,0.72) 100%
        );
    }
    .products-header.has-logo .products-header-inner {
        flex-direction: column-reverse;   /* a logó a cím fölé */
        align-items: flex-start;
        gap: 16px;
    }
    .products-header-brand { width: 120px; padding: 12px 14px; }
    .products-header-logo { max-height: 62px; }
}
.products-title {
    font-family: var(--font-heading);
    font-size: 34px;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.01em;
    line-height: 1.15;
    text-transform: uppercase;
    margin: 0;
}
/* Rövid kék vonal a cím alatt — a sötét hero elmaradása után ez adja
   vissza a vizuális horgonyt az oldal tetején. */
.products-title::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    margin-top: 12px;
    background: var(--primary);
    border-radius: 2px;
}
/* Csak akkor tartunk térközt a cím alatt, ha van is alatta szöveg. */
.products-title + .category-intro { margin-top: 16px; }
.category-intro {
    color: var(--text-secondary);
    font-size: 14.5px;
    line-height: 1.7;
    max-width: 100%;
}
.category-intro > *:first-child { margin-top: 0; }
.category-intro > *:last-child { margin-bottom: 0; }
.category-intro p { margin: 0 0 12px; }
.category-intro strong { color: var(--text); font-weight: 600; }
.category-intro a { color: var(--primary); text-decoration: underline; }
.category-intro ul,
.category-intro ol { margin: 0 0 12px; padding-left: 20px; }
.category-intro li { margin-bottom: 4px; }

/* Betöltés jelzése AJAX szűréskor: halvány elhalványulás, hogy látszódjon,
   hogy történik valami, de ne villogjon az egész oldal. */
.products-area {
    transition: opacity 0.15s ease;
}
.products-area.is-loading {
    opacity: 0.45;
    pointer-events: none;
}
