:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
}
@media (max-width: 1280px) {
    .main-nav { gap: 4px; }
    .nav-shell { gap: 20px; }
}

@media (min-width: 921px) and (max-width: 1280px) {
    .corporate-dropdown { left: auto; right: 0; transform-origin: top right; }
}

@media (min-width: 641px) and (max-width: 1180px) {
    body:has(.cookie-notice:not([hidden])) .whatsapp-float,
    body:has(.cookie-notice:not([hidden])) .back-to-top { bottom: 112px; }
}
@media (max-width: 1180px) {
    :root { --header-height: 126px; }
    .nav-shell { padding-inline: 24px; }
    .nav-link { font-size: 13px; }
    .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 32px; }
    .export-band-grid { grid-template-columns: auto minmax(0, 1fr); }
    .route-map { display: none; }
}
@media (max-width: 1024px) {
    .nav-link { padding-inline: 9px; }
    .hero-grid { gap: 24px; }
    .footer-inner { gap: 28px; }
    .split-layout { gap: 32px; }
}
@media (max-width: 920px) {
    :root { --header-height: 119px; }
    .topbar-inner { min-height: auto; padding-block: 6px; }
    .nav-shell { min-height: 80px; }
    .nav-toggle { display: block; }
    .main-nav {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        height: calc(100dvh - var(--header-height));
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 20px;
        background: rgba(255, 255, 255, .98);
        border-top: 1px solid rgba(158, 70, 106, .12);
        box-shadow: 0 24px 60px rgba(52, 23, 39, .16);
        overflow-y: auto;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-10px);
        transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
    }
    body.nav-open .main-nav { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
    .nav-search { order: -1; width: 100%; margin: 0 0 6px; }
    .nav-search-form { width: 100%; }
    .nav-search-input {
        position: static;
        width: 100%;
        height: 48px;
        padding-right: 52px;
        border-radius: 14px;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        clip-path: none;
        transform: none;
    }
    .nav-search-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
    .nav-search-results { position: static; width: 100%; max-width: none; margin-top: 6px; box-shadow: none; }
    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding-inline: 14px;
        border-radius: 14px;
        background: #fff;
        border: 1px solid rgba(158, 70, 106, .10);
    }
    .nav-link::after { display: none; }
    .nav-link.is-active { border-color: var(--line-strong); }
    .nav-icon { width: 26px; height: 26px; }
    .nav-parent { width: 100%; display: grid; grid-template-columns: 1fr 46px; gap: 6px; }
    .nav-arrow { width: 46px; height: 48px; margin-left: 0; background: var(--primary-wash); }
    .nav-item:hover .nav-arrow,
    .nav-item:focus-within .nav-arrow { transform: none; }
    .nav-item.is-open .nav-arrow { transform: rotate(180deg); }
    .nav-dropdown,
    .product-dropdown {
        position: static;
        left: auto;
        width: 100%;
        max-height: 0;
        margin-top: 8px;
        padding: 0 12px;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-radius: 18px;
        transition: max-height 320ms ease, padding 320ms ease;
    }
    .nav-item:hover .nav-dropdown,
    .nav-item:focus-within .nav-dropdown,
    .nav-item:hover .product-dropdown,
    .nav-item:focus-within .product-dropdown,
    .nav-item.is-open .product-dropdown { transform: none; }
    .nav-item.is-open .nav-dropdown { max-height: 720px; padding: 12px; overflow-y: auto; }
    .nav-item.is-open .product-dropdown { max-height: 2400px; }
    .nav-dropdown::before { display: none; }
    .dropdown-row-icon { width: 50px; height: 50px; }
    .mega { min-height: 0; }
    .mega-roots { width: auto; }
    .mega-root-arrow { display: none; }
    .mega-root { grid-template-columns: 46px minmax(0, 1fr); }
    .mega-item.is-active .mega-root { background: none; border-color: transparent; box-shadow: none; }
    .mega-toggle {
        width: 42px;
        height: 42px;
        display: grid;
        place-items: center;
        flex: 0 0 auto;
        border: 0;
        border-radius: 12px;
        background: var(--primary-wash);
        color: var(--primary-dark);
        cursor: pointer;
    }
    .mega-toggle .icon { transition: transform .25s ease; }
    .mega-item.is-open .mega-toggle .icon { transform: rotate(180deg); }
    .mega-panel {
        position: static;
        display: none;
        margin: 0 0 6px 32px;
        padding: 4px 0 4px 12px;
        opacity: 1;
        visibility: visible;
        transform: none;
        overflow: visible;
    }
    .mega-item.is-open > .mega-panel { display: flex; }
    .mega-panel-head { display: none; }
    .mega-children { grid-template-columns: 1fr; }
    .page-drawing { display: none; }
    .page-head:has(.page-drawing) h1,
    .page-head:has(.page-drawing) p,
    .page-head:has(.page-drawing) .search-form,
    .about-stats { max-width: none; }

    .hero-grid { grid-template-columns: 1fr; }
    .blueprint { max-width: 520px; }
    .split-layout,
    .product-layout,
    .media-split,
    .contact-layout,
    .principle-grid,
    .quality-layout { grid-template-columns: 1fr; }
    .split-head { position: static; }
    .process-layout,
    .faq-layout { grid-template-columns: 1fr; }
    .catalog-row { grid-template-columns: 56px minmax(0, 1fr) 20px; }
    .catalog-row-thumb { width: 56px; height: 56px; }
    .catalog-row-children { display: none; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .footer-main { grid-column: 1 / -1; }
}
@media (min-width: 641px) and (max-width: 920px) {
    .hero-copy { max-width: 640px; }
    .blueprint { max-width: 560px; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .media-frame { aspect-ratio: 16 / 9; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 700px) and (max-width: 920px) {
    .product-layout { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 28px; }
    .principle-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .value-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    :root { --header-height: 116px; }
    .container,
    .container.narrow,
    .topbar-inner,
    .footer-inner,
    .footer-bottom { width: min(100% - 28px, var(--container)); }
    .topbar-inner { gap: 10px; }
    .brand-logo { width: 154px; }
    .nav-shell { min-height: 76px; padding-inline: 14px; }
    body { font-size: 15px; }
    .hero { min-height: 0; }
    .blueprint-block span { padding-inline: 14px; }
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .product-card-body { padding: 12px; }
    .product-card-body h3 { font-size: 14.5px; }
    .value-grid { grid-template-columns: 1fr; }
    .process-card { grid-template-columns: 1fr; grid-template-areas: "eyebrow" "title" "text" "drawing" "metrics"; }
    .nut-drawing { width: 170px; }
    .process-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .export-band-grid { grid-template-columns: 1fr; }
    .about-stats { grid-template-columns: 1fr 1fr; }
    .about-stats div:nth-child(odd) { padding-left: 0; border-left: 0; }
    .about-photo figcaption { left: 12px; }
    .doc-grid { grid-template-columns: 1fr; }
    .article-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .article-row img { display: none; }
    .cta-inner { flex-direction: column; align-items: flex-start; }
    .footer-inner { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; }
    .back-to-top { width: 40px; height: 80px; right: 14px; bottom: 14px; }
    .btt-stud { width: 28px; height: 74px; }
    .whatsapp-float { left: 14px; bottom: 14px; min-height: 50px; padding: 5px; }
    .whatsapp-float span { display: none; }
    .cookie-notice { flex-direction: column; align-items: stretch; bottom: 12px; }
    .lang-suggest { left: 14px; right: 14px; max-width: none; flex-wrap: wrap; }
    .lang-suggest p { flex: 1 1 calc(100% - 90px); }
}
@media (max-width: 640px) {
    .table-scroll:has(.spec-table.is-labelled) { overflow: visible; }
    .spec-table.is-labelled,
    .spec-table.is-labelled tbody { display: block; min-width: 0; }
    .spec-table.is-labelled thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .spec-table.is-labelled tr { display: grid; gap: 6px; padding: 14px 16px; border-bottom: 1px solid rgba(158, 70, 106, .10); }
    .spec-table.is-labelled tbody tr:last-child { border-bottom: 0; }
    .spec-table.is-labelled td { display: flex; justify-content: space-between; gap: 14px; padding: 0; border: 0; text-align: right; }
    .spec-table.is-labelled td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 12.5px; font-weight: 500; text-align: left; }
    .spec-table.is-labelled td:first-child { font-size: 16px; text-align: left; }
    .spec-table.is-labelled td:first-child::before { display: none; }
}
@media (max-width: 420px) {
    .container,
    .container.narrow,
    .topbar-inner,
    .footer-inner,
    .footer-bottom { width: min(100% - 24px, var(--container)); }
    .nav-shell { padding-inline: 12px; }
    .brand-logo { width: 140px; }
    .section-head h2,
    .split-head h2 { overflow-wrap: anywhere; }
    .actions .btn { flex: 1 1 auto; }
    .product-grid { gap: 10px; }
    .product-card-body h3 { font-size: 14px; }
    .spec-list div { font-size: 13.5px; }
    .about-stats strong { font-size: 22px; }
    .cookie-notice { left: 12px; right: 12px; width: auto; transform: none; }
}
@media (max-width: 360px) {
    body { font-size: 14.5px; }
    .brand-logo { width: 128px; }
    .nav-shell { min-height: 70px; }
    .topbar-inner { gap: 8px; }
    .lang-btn { padding-inline: 8px; }
    .actions .btn { width: 100%; }
    .about-stats { gap: 14px 0; }
    .process-metrics { grid-template-columns: 1fr 1fr; }
    .back-to-top { right: 10px; bottom: 10px; }
    .whatsapp-float { left: 10px; bottom: 10px; }
}
@media (max-width: 340px) {
    .product-grid { grid-template-columns: 1fr; }
    .topbar-item span:last-child { display: none; }
}
@media (max-height: 500px) and (orientation: landscape) and (max-width: 920px) {
    :root { --header-height: 104px; }
    .topbar-inner { padding-block: 4px; }
    .nav-shell { min-height: 64px; }
    .brand-logo { width: 128px; }
    .main-nav { padding: 12px 20px; }
    .nav-link { min-height: 42px; }
    .hero { min-height: 0; }
    .lang-suggest { top: calc(var(--header-height) + 8px); }
    .back-to-top { width: 38px; height: 72px; }
    .btt-stud { width: 26px; height: 66px; }
}
@media (hover: none) and (pointer: coarse) {
    a,
    button { -webkit-tap-highlight-color: rgba(158, 70, 106, .12); }
    .lang-btn { display: inline-grid; place-items: center; min-height: 30px; min-width: 40px; }
    .nav-link,
    .nav-arrow,
    .mega-toggle { min-height: 44px; }
    .footer-col a { display: inline-flex; align-items: center; min-height: 36px; }
    .gallery-thumb { width: 72px; height: 72px; }
    .btn:hover,
    .product-card:hover,
    .value-card.is-in:hover { transform: none; }
    .btn-primary:hover::after { transform: translateX(-120%); }
}
@supports (padding: max(0px)) {
    .back-to-top { right: max(24px, calc(var(--safe-right) + 12px)); bottom: max(24px, calc(var(--safe-bottom) + 12px)); }
    .whatsapp-float { left: max(24px, calc(var(--safe-left) + 12px)); bottom: max(24px, calc(var(--safe-bottom) + 12px)); }
    .cookie-notice { bottom: max(20px, calc(var(--safe-bottom) + 10px)); }
    @media (max-width: 640px) {
        .back-to-top { right: max(14px, calc(var(--safe-right) + 8px)); bottom: max(14px, calc(var(--safe-bottom) + 8px)); }
        .whatsapp-float { left: max(14px, calc(var(--safe-left) + 8px)); bottom: max(14px, calc(var(--safe-bottom) + 8px)); }
        .cookie-notice { bottom: max(12px, calc(var(--safe-bottom) + 8px)); }
    }
    @media (max-width: 360px) {
        .back-to-top { right: max(10px, var(--safe-right)); bottom: max(10px, var(--safe-bottom)); }
        .whatsapp-float { left: max(10px, var(--safe-left)); bottom: max(10px, var(--safe-bottom)); }
    }
    @media (orientation: landscape) and (max-width: 920px) {
        .nav-shell { padding-left: max(14px, var(--safe-left)); padding-right: max(14px, var(--safe-right)); }
        .container,
        .footer-inner,
        .footer-bottom { padding-inline: max(0px, calc(var(--safe-left) - 14px)) max(0px, calc(var(--safe-right) - 14px)); }
    }
}
@media print {
    .topbar,
    .site-header,
    .page-progress,
    .page-noise,
    .preloader,
    .back-to-top,
    .whatsapp-float,
    .cookie-notice,
    .lang-suggest,
    .cta,
    .site-footer .footer-motion { display: none !important; }
    body { color: #000; background: #fff; }
    .js [data-reveal] { opacity: 1 !important; transform: none !important; }
    a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 10px; color: #555; }
}
