/* ═══════════════════════════════════════════
   RESPONSIVE – Catalog Page
   ═══════════════════════════════════════════ */
@media (max-width: 1200px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
    .layout-grid {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: fixed;
        top: 0;
        left: -320px;
        width: 300px;
        height: 100vh;
        z-index: 250;
        border-radius: 0;
        overflow-y: auto;
        /* Zárt állapotban rejtett is, nem csak a képernyőn kívül van — különben
           a Tab-billentyű végiglépkedne a láthatatlan szűrőkön. A `visibility`
           a becsúszás végén vált, hogy az animáció megmaradjon. */
        visibility: hidden;
        transition: left 0.3s ease, visibility 0s linear 0.3s;
        /* Az asztali max-height itt visszavonandó: mobilon a fiók a teljes
           képernyőt kitölti, különben rövidebb lenne a képernyőnél. */
        max-height: none;
    }
    .sidebar.open {
        left: 0;
        visibility: visible;
        transition: left 0.3s ease, visibility 0s;
    }
    .filter-mobile-toggle { display: flex; }
    .page-title { font-size: 32px; }
    .page-subtitle { font-size: 14px; }
    .page-hero { padding: 36px 0 32px; }
    .category-grid { display: none; }
    .category-collapsible { display: none; }
    .section-label-toggle { display: none; }
    .category-dropdown-mobile { display: block; }
}

/*
 * Fejléc: a mobilmenü 1240px alatt kapcsol be, nem 960 alatt.
 *
 * Az asztali fejléc (logó + 650px-es menü + gombok) 1219px széles, ezért 961 és
 * ~1235px között vízszintes görgetősávot okozott — a fekvő tableteken és a kis
 * laptopokon (1024–1200px) minden oldalon 210–273px-szel lógott ki (2026-10-07,
 * fej nélküli Chrome-mal mérve). A szűrőpanel és a többi elrendezés 960-on marad.
 * Ha a főmenü új ponttal bővül, ezt a határt is emelni kell.
 */
@media (max-width: 1240px) {
    .main-nav { display: none; }
    .main-nav.mobile-open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        background: var(--dark);
        padding: 12px 16px;
        gap: 0;
        z-index: 200;
        border-bottom: 2px solid var(--primary);
        box-shadow: var(--shadow-lg);
        max-height: calc(100vh - var(--header-h));
        overflow-y: auto;
    }
    .main-nav.mobile-open > a,
    .main-nav.mobile-open > .nav-item-megamenu > a {
        padding: 14px 16px !important;
        font-size: 16px !important;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        color: rgba(255,255,255,0.7) !important;
        text-decoration: none;
        display: flex !important;
        width: 100% !important;
        text-transform: uppercase;
        font-family: var(--font-heading);
        font-weight: 600;
        letter-spacing: 0.02em;
        border-radius: 0 !important;
        background: none !important;
        gap: 0;
        box-sizing: border-box;
    }
    .main-nav.mobile-open > a:last-child {
        border-bottom: none;
    }
    /* Megamenu mobil: accordion almenü */
    .nav-item-megamenu {
        display: flex !important;
        flex-direction: column !important;
        position: static !important;
        width: 100% !important;
        align-items: stretch !important;
    }
    .main-nav.mobile-open > .nav-item-megamenu > a {
        align-items: center;
        justify-content: space-between;
    }
    .megamenu-chevron {
        display: inline-block;
        width: 14px;
        height: 14px;
        transition: transform 0.3s ease;
        stroke: rgba(255,255,255,0.6);
        margin-left: auto;
    }
    .nav-item-megamenu.mobile-submenu-open .megamenu-chevron {
        transform: rotate(180deg);
        stroke: var(--primary);
    }
    .megamenu {
        display: none !important;
    }
    .mobile-submenu {
        display: none;
        flex-direction: column;
        background: rgba(0,0,0,0.25);
        padding: 4px 0;
    }
    .mobile-submenu.open {
        display: flex;
    }
    .mobile-submenu-section-title {
        font-family: var(--font-heading);
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: rgba(255,255,255,0.4);
        padding: 12px 24px 6px;
    }
    .mobile-submenu a {
        padding: 10px 24px 10px 28px !important;
        font-size: 14px !important;
        color: rgba(255,255,255,0.85) !important;
        /* Ezek tartalomnevek, nem navigációs feliratok — a `.main-nav a`
           nagybetűsítése alól kivesszük, ahogy az asztali panel is teszi. */
        text-transform: none;
        font-family: var(--font);
        font-weight: 500;
        letter-spacing: normal;
        border-bottom: 1px solid rgba(255,255,255,0.04) !important;
        display: flex;
        align-items: center;
        gap: 10px;
        text-decoration: none;
        transition: background 0.15s ease, color 0.15s ease;
    }
    .mobile-submenu a:hover {
        background: rgba(0,136,204,0.15);
        color: var(--primary) !important;
    }
    .mobile-submenu a:last-child {
        border-bottom: none !important;
    }
    /* „Összes termék" — a lista lezárása, kiemelve. */
    .mobile-submenu-all {
        color: var(--primary) !important;
        font-family: var(--font-heading);
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        justify-content: flex-start;
        gap: 6px !important;
    }
    .mobile-submenu-icon {
        width: 28px;
        height: 28px;
        border-radius: 6px;
        background: rgba(0,136,204,0.15);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    .mobile-submenu-icon svg {
        width: 14px;
        height: 14px;
        stroke: var(--primary);
        fill: none;
        stroke-width: 2;
    }
    .mobile-submenu-icon img {
        width: 22px;
        height: 22px;
        object-fit: contain;
        border-radius: 4px;
    }
    /*
     * A logó magasságát csökkentjük, nem a szélességét: 60px-en a logó 344px
     * széles, ami a keresővel és a hamburgerrel együtt nem fér ki egy 390px-es
     * képernyőn. 40px-en 229px — így marad hely, és nem lapul össze.
     */
    .logo img { height: 40px; }
    .header-inner { gap: 12px; }
    /* A fejlécben nincs hely nekik; a lenyíló menü alján jelennek meg. */
    .header-actions .social-links { display: none; }
    .social-links.mobile-socials {
        display: flex;
        justify-content: center;
        gap: 10px;
        padding: 18px 16px 6px;
    }
    .social-links.mobile-socials .social-link {
        width: 42px;
        height: 42px;
        background: rgba(255,255,255,0.06);
    }
    .header-actions { margin-left: auto; gap: 4px; }
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        padding: 8px;
        margin-left: auto;
    }
    .mobile-menu-toggle span {
        width: 22px;
        height: 2px;
        background: #fff;
        border-radius: 2px;
        transition: transform 0.25s ease, opacity 0.2s ease;
    }
    /* Nyitott állapotban X, hogy a gomb jelezze: most bezár.
       A demóban ez hiányzott, de visszajelzés nélkül a gomb félrevezető. */
    .mobile-menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
    .mobile-menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    .btn-quote-header { display: none; }
}

@media (max-width: 640px) {
    .product-grid { grid-template-columns: 1fr; }
    /* Keskeny képernyőn a lista nézet nem ad többet a rácsnál — a kapcsoló el is tűnik. */
    .view-toggle { display: none !important; }
    [data-product-view="list"] .products-area .product-card { flex-direction: column; }
    [data-product-view="list"] .products-area .card-image {
        width: 100%;
        min-width: auto;
        aspect-ratio: 4/3;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-right { justify-content: space-between; }
    .card-image img { max-height: 100%; max-width: 85%; }
}

/*
 * A lábléc eddig csak 400px alatt tört egy oszlopra — vagyis 401 és 960px
 * között négy, egyenként ~140px széles hasáb volt, bennük tördelt linkekkel.
 * A Kapcsolat oszlop (cím, nyitvatartás, cégjegyzékszám) ott olvashatatlan.
 */
@media (max-width: 960px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 560px) {
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .footer-legal { justify-content: center; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE – Product Page
   ═══════════════════════════════════════════ */
@media (max-width: 960px) {
    .product-top {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .product-gallery {
        position: static;
    }
    .product-title {
        font-size: 36px;
    }
    .product-subtitle {
        font-size: 18px;
    }
    .product-quote-section {
        padding: 32px 24px;
        border-radius: var(--radius-md);
    }
    .quote-form-header h2 {
        font-size: 26px;
    }
    .product-tabs-section {
        margin-bottom: 32px;
    }
}

@media (max-width: 640px) {
    .product-page {
        padding: 16px 0 0;
    }
    .product-page .container {
        padding: 0 16px;
    }
    .product-top {
        gap: 20px;
        margin-bottom: 28px;
    }
    .gallery-main {
        aspect-ratio: auto;
        padding: 20px;
        min-height: 240px;
        border-radius: var(--radius-md);
    }
    .gallery-main img {
        max-width: 90%;
        max-height: 90%;
    }
    .gallery-arrow {
        opacity: 1;
        width: 36px;
        height: 36px;
    }
    .gallery-arrow svg {
        width: 20px;
        height: 20px;
    }
    .gallery-prev { left: 8px; }
    .gallery-next { right: 8px; }
    .gallery-thumbs {
        gap: 6px;
        -webkit-overflow-scrolling: touch;
    }
    .thumb {
        width: 56px;
        height: 56px;
        padding: 4px;
    }
    .product-brand-badge {
        width: 60px;
        height: 60px;
        margin-bottom: 12px;
    }
    .product-title {
        font-size: 28px;
    }
    .product-subtitle {
        font-size: 16px;
        margin-bottom: 8px;
    }
    .product-highlight {
        font-size: 14px;
        margin-bottom: 16px;
        padding-bottom: 16px;
    }
    .product-key-specs {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 16px;
    }
    .key-spec {
        padding: 10px 12px;
        gap: 8px;
    }
    .key-spec svg {
        width: 16px;
        height: 16px;
    }
    .key-spec-label {
        font-size: 10px;
    }
    .key-spec-value {
        font-size: 15px;
    }
    .product-categories {
        margin-bottom: 16px;
    }
    .product-actions {
        flex-direction: column;
        margin-bottom: 16px;
    }
    .btn-lg {
        padding: 12px 20px;
        font-size: 14px;
    }
    .product-trust {
        flex-direction: column;
        gap: 10px;
        padding-top: 16px;
    }
    .product-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .product-tabs::-webkit-scrollbar {
        display: none;
    }
    .product-tab {
        padding: 12px 16px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .tab-content {
        padding: 20px 14px;
    }
    .product-tabs-section {
        margin-bottom: 24px;
    }
    .description-content h2 {
        font-size: 18px;
        margin: 20px 0 10px;
    }
    .description-content p,
    .description-content ul li {
        font-size: 14px;
    }
    .description-cta {
        padding: 16px;
        margin-top: 24px;
    }
    .specs-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
    .spec-name {
        width: auto;
        min-width: 110px;
        font-size: 12px;
    }
    .spec-val {
        font-size: 13px;
    }
    .specs-table {
        min-width: 0;
    }
    .document-card {
        padding: 12px 14px;
        gap: 12px;
    }
    .document-icon {
        width: 40px;
        height: 40px;
    }
    .document-icon svg {
        width: 24px;
        height: 24px;
    }
    .document-name {
        font-size: 13px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .product-quote-section {
        padding: 24px 16px;
        margin-bottom: 24px;
        border-radius: var(--radius-md);
    }
    .quote-form-header {
        margin-bottom: 20px;
    }
    .quote-form-header h2 {
        font-size: 22px;
    }
    .quote-form-header p {
        font-size: 13px;
    }
    .form-group input,
    .form-group textarea {
        padding: 10px 14px;
        font-size: 14px;
    }
}

@media (max-width: 380px) {
    .product-page .container {
        padding: 0 12px;
    }
    .product-title {
        font-size: 24px;
    }
    .product-key-specs {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .key-spec {
        flex-direction: row;
    }
    .gallery-main {
        min-height: 200px;
        padding: 16px;
    }
    .thumb {
        width: 48px;
        height: 48px;
    }
    .product-quote-section {
        padding: 20px 12px;
    }
    .quote-form-header h2 {
        font-size: 20px;
    }
    .tab-content {
        padding: 16px 12px;
    }
    .specs-table td {
        padding: 8px 10px;
    }
    .spec-name {
        min-width: 90px;
        font-size: 11px;
    }
    .spec-val {
        font-size: 12px;
    }
}

/* Lapozó és eszköztár kis képernyőn */
@media (max-width: 640px) {
    .pagination { gap: 4px; margin-top: 28px; padding-top: 24px; }
    .pagination .page-numbers {
        min-width: 34px;
        height: 34px;
        padding: 0 8px;
        font-size: 13px;
    }
    /* Az Előző/Következő szövege helyet vinne el a számoktól. */
    .pagination .prev,
    .pagination .next { padding: 0 10px; font-size: 0; }
    .pagination .prev::after { content: '‹'; font-size: 18px; }
    .pagination .next::after { content: '›'; font-size: 18px; }

    .toolbar-form { gap: 10px; width: 100%; }
    .toolbar-form .sort-select { flex: 1; min-width: 0; }
    .toolbar-form .sort-select select { width: 100%; }
}

@media (max-width: 640px) {
    .products-header { padding: 18px; }
    .products-title { font-size: 26px; }
    .category-intro { font-size: 14px; }
}

@media (max-width: 1200px) {
    .related-products .product-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .related-products { margin-top: 32px; padding-top: 28px; }
    .related-products .section-title { font-size: 21px; }
    .related-products .product-grid { grid-template-columns: 1fr; }
    .document-list a { padding: 12px 14px; }
    .document-title { white-space: normal; }
}

@media (max-width: 640px) {
    /* Az oszlopok egymás alá rendezését a Fluent Forms maga megoldja,
       csak a gomb legyen teljes szélességű. */
    .product-quote-section .ff-btn-submit,
    .product-quote-section .ff_btn_style { width: 100%; }
}
