/* ═══════════════════════════════════════════════════
 *  Responsive Styles
 * ═══════════════════════════════════════════════════ */

@media (max-width: 1200px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }
    .nav-search-desktop { display: none !important; }
    /* lang-switcher يبقى ظاهر في النافبار على الموبايل */
    .lang-switcher .lang-current span:not(.lang-flag) { display: none; }
    .lang-current { padding: 0.5rem 0.55rem; }
    .navbar-inner { position: relative; min-height: 70px; gap: 0; }
    .navbar .logo { position: absolute; left: 50%; transform: translateX(-50%); z-index: 1; }
    .nav-right { width: 100%; justify-content: flex-start; gap: 0.9rem; }
    .account-menu-wrap { display: none; }
    .hamburger { order: -1; margin-left: auto; }
    .shop-grid-wrap { grid-template-columns: 1fr; }
    .shop-products-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

/* Tablet & below: hide sidebar inline, show filter toggle button + transform sidebar to drawer */
@media (max-width: 1200px) {
    .filter-toggle-btn { display: inline-flex !important; }
    .shop-sidebar {
        position: fixed !important;
        top: 0 !important;
        right: -100%;
        width: 320px;
        max-width: 88vw;
        height: 100vh;
        background: #fff !important;
        border-radius: 0 !important;
        border: 0 !important;
        z-index: 2001;
        transition: right .35s cubic-bezier(.4,0,.2,1);
        box-shadow: -10px 0 40px rgba(0,0,0,.15);
        overflow-y: auto;
        padding: 0 !important;
        display: flex;
        flex-direction: column;
    }
    [dir="ltr"] .shop-sidebar { right: auto; left: -100%; transition: left .35s cubic-bezier(.4,0,.2,1); box-shadow: 10px 0 40px rgba(0,0,0,.15); }
    .shop-sidebar.drawer-open { right: 0; }
    [dir="ltr"] .shop-sidebar.drawer-open { left: 0; }
    .shop-sidebar .filter-block { padding: 1rem 1.5rem !important; margin: 0 !important; }
    .shop-sidebar .filter-drawer-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 1.2rem 1.5rem;
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 2;
    }
    .shop-sidebar .filter-drawer-header h3 { font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; margin: 0; }
    .shop-sidebar .filter-drawer-close {
        width: 36px; height: 36px;
        border: 0; background: var(--light-gray, #f8f7f4); border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
        font-size: 1rem; color: var(--dark); cursor: pointer;
    }
}

/* Tablet: 3 cols */
@media (max-width: 1024px) {
    .shop-products-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

@media (max-width: 1024px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-top { grid-template-columns: repeat(2, 1fr); }
    .product-layout { grid-template-columns: 1fr; gap: 2rem; }
    .gallery { position: static; }
    /* Mobile/tablet: gallery on top */
    .product-layout .gallery { order: 1 !important; }
    .product-layout .product-details { order: 2 !important; }
    /* Mobile-style product card actions */
    .product-card .product-quick {
        top: 10px;
        bottom: auto;
        left: 10px;
        right: auto;
        width: auto;
        padding: 0;
        background: transparent;
        opacity: 1;
        z-index: 6;
        /* Force own GPU layer so smooth-scroll repaints don't shift it visually */
        transform: translateZ(0);
        will-change: transform;
        backface-visibility: hidden;
    }
    .product-card .product-badge-wrap {
        transform: translateZ(0);
        will-change: transform;
        backface-visibility: hidden;
    }
    /* Stabilize the carousel items themselves during auto-scroll */
    .section-carousel .carousel-grid .product-card,
    .section-carousel .products-grid .product-card {
        transform: translateZ(0);
        backface-visibility: hidden;
    }
    .product-card:hover .product-quick { bottom: auto; }
    .product-card .quick-btn {
        width: 30px; height: 30px;
        font-size: 0.72rem;
        background: rgba(255,255,255,0.96);
        border: 1px solid var(--border);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    .product-card .quick-btn:first-child { display: none; }
    .product-card .btn-cart {
        min-height: 42px;
        width: calc(100% + 1.6rem);
        margin: 0 -0.8rem -0.8rem;
        padding: 0.62rem 2.5rem;
        background: var(--burgundy);
        color: white;
        border-color: var(--burgundy);
        border-radius: 0 0 8px 8px;
        font-size: 0.84rem;
    }
    .product-card .btn-cart i {
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1.4rem;
    }
}

@media (max-width: 768px) {
    .container { padding: 0 1rem; }
    .announcement { font-size: 0.82rem; padding: 0.45rem 0; }
    .hero { height: 82vh; min-height: 560px; }
    .nav-icon { width: 36px; height: 36px; font-size: 1.05rem; }
    .features-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
    .feature-item { padding: 0.75rem; }
    .feature-icon { width: 45px; height: 45px; font-size: 1.1rem; }

    .section { padding: 3rem 0; }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .section-carousel .products-grid,
    .carousel-grid { display: flex; gap: 0.85rem; }
    .section-carousel .product-card,
    .carousel-grid .product-card { flex: 0 0 calc((100vw - 3rem) / 2); min-width: unset; max-width: unset; }
    .product-name { font-size: 0.82rem; min-height: auto; }
    .price-current { font-size: 1rem; }
    .product-info { padding: 0.8rem; }

    .banner-cta { height: 360px; }

    /* Footer mobile - centered minimal */
    .footer-top,
    .footer-top.footer-grid-4 {
        grid-template-columns: 1fr !important;
        gap: 1.6rem;
        text-align: center;
    }
    .site-footer .footer-brand,
    .footer-col-brand { align-items: center; text-align: center; display: flex; flex-direction: column; }
    .site-footer .footer-brand .footer-logo-img,
    .footer-col-brand .footer-logo-img { margin: 0 auto; }
    .site-footer .footer-brand p,
    .footer-col-brand .footer-desc { max-width: 92%; margin: 0 auto; }
    .site-footer .footer-section h4,
    .footer-heading { text-align: center; }
    .site-footer .footer-section h4::after { right: 50% !important; transform: translateX(50%); }
    .site-footer .footer-section ul,
    .footer-col-list .footer-list { text-align: center; }
    .site-footer .footer-section ul li a { justify-content: center; }
    .site-footer .footer-contact li,
    .footer-col-contact .footer-contact li { justify-content: center; }
    .footer-legal-row { justify-content: center; }
    .footer-social { justify-content: center; }

    /* Tax + Commercial register: show under brand description */
    .footer-legal-mobile {
        margin-top: .9rem;
        font-size: .82rem;
        line-height: 1.9;
        color: rgba(255,255,255,.7);
    }
    .footer-legal-mobile span { color: var(--gold-light, #C4A24E); font-weight: 700; }
    .footer-credit-mobile {
        display: block;
        margin-top: .65rem;
        font-size: .72rem;
        line-height: 1.4;
    }
    .footer-credit-mobile a {
        color: rgba(255,255,255,.45);
        text-decoration: none;
        font-weight: 500;
    }

    /* Hide payment icons + bottom legal text on mobile (we moved tax/register up) */
    .site-footer .footer-bottom,
    .site-footer .payment-icons { display: none !important; }

    /* Policies: horizontal row on mobile (no heading, no chevron icon) */
    .site-footer .footer-policies-col { text-align: center; margin-top: .5rem; }
    .site-footer .footer-policies-list {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: .4rem 1rem;
        padding: 0;
        margin: 0;
    }
    .site-footer .footer-policies-list li {
        margin: 0 !important;
        position: relative;
        padding: 0 .6rem;
    }
    .site-footer .footer-policies-list li:not(:last-child)::after {
        content: '·';
        position: absolute;
        left: -.4rem;
        top: 50%;
        transform: translateY(-50%);
        color: rgba(255,255,255,.35);
        font-size: 1rem;
    }
    .site-footer .footer-policies-list li a {
        font-size: .82rem;
        color: rgba(255,255,255,.7);
        white-space: nowrap;
    }
    .site-footer .footer-policies-list li a .desktop-only-icon { display: none; }

    /* Quick Links + Policies side-by-side on mobile */
    .site-footer .footer-links-pair {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        text-align: center;
    }
    .site-footer .footer-links-pair .footer-section { margin: 0; text-align: center; }

    .hero-nav { bottom: 2rem; gap: 0.6rem; }
    .hero-nav-bar { width: 40px; }

    /* Shop page mobile */
    .shop-toolbar { flex-direction: column; align-items: stretch; gap: 0.75rem; }
    .shop-toolbar-right { justify-content: space-between; }
    .shop-products-grid { grid-template-columns: repeat(2, 1fr) !important; }

    /* Product page mobile - hide pd-actions, show sticky bar */
    .pd-actions { display: none; }
    .sticky-bar { display: block; }
    body.aldakheel-single-product { padding-bottom: 80px; }
    .product-tabs-wrap { margin-top: 2rem; }

    /* Page header */
    .page-header { padding: 2.5rem 0; }
    .page-header-content { padding: 1.4rem; }

    /* Categories */
    .categories-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .container { padding: 0 0.65rem; }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .section-carousel .products-grid,
    .carousel-grid { gap: 0.75rem; padding-inline: 0; }
    .section-carousel .product-card,
    .carousel-grid .product-card {
        flex: 0 0 calc((100vw - 2.05rem) / 2);
        max-width: calc((100vw - 2.05rem) / 2);
    }
    .product-info { padding: 0.8rem; }
    .product-name { font-size: 0.82rem; min-height: 2.4em; }
    .price-current { font-size: 0.95rem; }
    .badge { padding: 0.22rem 0.55rem; font-size: 0.62rem; }
    .product-badge-wrap { top: 10px; right: 10px; }
    .hero { height: 82vh; min-height: 560px; }
    .section-title { font-size: 1.4rem; }
    .hero-nav-bar { width: 30px; }
    .hero-nav-num { font-size: 0.9rem; }
    .hero-nav-item.active .hero-nav-num { font-size: 1.1rem; }
    .payment-bar { padding: 1.5rem 0; }
    .payment-bar-inner { gap: 0.75rem; }
    .pd-title { font-size: 1.3rem; }
    .pd-price { font-size: 1.3rem; }
}
