/* ============================================================
   DARYA NOOR v2.0 — Mobile-First Styles
   Optimized for touch, thumb reach, and small screens
   ============================================================ */

/* ── Bottom Navigation Bar — floating glassmorphism dock ─────
   A pill-shaped, blurred, semi-transparent bar that floats above
   the page (not edge-to-edge), with a blue glow shadow and an
   enlarged, elevated center button for search. */
.dn-bottom-nav{
    display:none;
    position:fixed;right:12px;left:12px;bottom:calc(10px + env(safe-area-inset-bottom));
    z-index:900;height:auto;padding:0;background:none;border:none;box-shadow:none;
}
.dn-bottom-nav-inner{
    display:flex;align-items:center;justify-content:space-around;
    height:64px;padding:0 6px;border-radius:9999px;
    background:linear-gradient(180deg,rgba(15,23,55,.72),rgba(3,4,94,.68));
    -webkit-backdrop-filter:blur(20px) saturate(160%);
    backdrop-filter:blur(20px) saturate(160%);
    border:1px solid rgba(255,255,255,.14);
    box-shadow:0 10px 30px rgba(3,4,94,.35),0 0 0 1px rgba(255,255,255,.04) inset,0 0 24px rgba(0,180,216,.25);
}
.dn-bottom-nav-item{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:6px 8px;border-radius:var(--dn-radius-md);color:rgba(255,255,255,.62);transition:all var(--dn-t-fast);cursor:pointer;border:none;background:none;font-family:inherit;min-width:0;position:relative;flex:1;}
.dn-bottom-nav-item.active,.dn-bottom-nav-item:hover{color:#fff;}
.dn-bottom-nav-item.active .dn-bnav-icon{background:rgba(0,180,216,.28);}
.dn-bnav-icon{width:34px;height:30px;display:flex;align-items:center;justify-content:center;border-radius:var(--dn-radius-md);transition:background var(--dn-t-fast);}
.dn-bnav-icon svg{width:20px;height:20px;}
.dn-bnav-label{font-size:.6rem;font-weight:600;letter-spacing:.01em;}
.dn-bnav-badge{position:absolute;top:0;right:calc(50% - 20px);min-width:16px;height:16px;background:var(--dn-accent);color:#03045e;border-radius:var(--dn-radius-full);font-size:.58rem;font-weight:800;display:flex;align-items:center;justify-content:center;padding:0 4px;border:2px solid rgba(3,4,94,.8);}

/* Center "search" button — bigger, circular, elevated above the bar */
.dn-bottom-nav-item--center{flex:0 0 auto;margin:0 2px;}
.dn-bottom-nav-item--center .dn-bnav-icon{
    width:54px;height:54px;margin-top:-26px;
    background:radial-gradient(circle at 30% 30%,var(--dn-accent),var(--dn-primary) 70%);
    box-shadow:0 6px 18px rgba(0,180,216,.55),0 0 0 4px rgba(3,4,94,.9),0 0 30px rgba(0,180,216,.45);
}
.dn-bottom-nav-item--center .dn-bnav-icon svg{width:24px;height:24px;color:#fff;}
.dn-bottom-nav-item--center .dn-bnav-label{opacity:0;height:0;}
.dn-bottom-nav-item--center:hover .dn-bnav-icon,.dn-bottom-nav-item--center.active .dn-bnav-icon{background:radial-gradient(circle at 30% 30%,#fff,var(--dn-accent) 75%);}

/* ── Mobile header: hamburger — centered logo — action icons ──
   .dn-menu-btn now lives as its own child of .dn-header-inner
   (see header.php) instead of inside .dn-header-actions, so it can
   be grid-placed on the opposite edge from the action icons while
   the logo stays perfectly centered between them. In RTL, grid
   column 1 is the right edge and the last column is the left edge. */
@media(max-width:900px){
    .dn-header-inner{display:grid;grid-template-columns:auto 1fr auto;gap:8px;}
    .dn-header-actions{grid-column:1;justify-self:start;}
    .dn-logo{grid-column:2;justify-self:center;}
    .dn-menu-btn{grid-column:3;justify-self:end;}
}

/* Show bottom nav on mobile only */
@media(max-width:768px){
    .dn-bottom-nav{display:block;}
    /* Push page content up so bottom nav doesn't cover it */
    body:not(.woocommerce-checkout):not(.woocommerce-cart) #dn-page-wrap{padding-bottom:calc(86px + env(safe-area-inset-bottom));}
    /* Adjust back-to-top */
    .dn-back-to-top{bottom:calc(96px + env(safe-area-inset-bottom));}
    /* Sticky ATC on single product */
    .dn-sticky-atc{bottom:calc(86px + env(safe-area-inset-bottom));}
}

/* ── Mobile-specific layout fixes ────────────────────────── */
@media(max-width:768px){

    :root{--dn-header-h:60px;--dn-header-scrolled:54px;}
    .dn-logo-main{font-size:1.15rem;}
    .dn-action-btn{width:38px;height:38px;}

    /* Announcement bar */
    .dn-announcement{font-size:.75rem;padding:8px 0;}
    .dn-ann-text{font-size:.75rem;}

    /* Hero */
    .dn-slide-title{font-size:clamp(1.5rem,7vw,2.5rem);}
    .dn-slide-subtitle{font-size:.9rem;}
    .dn-slide-actions .dn-btn{padding:11px 22px;font-size:.88rem;}
    .dn-slide-stats{gap:10px;}
    .dn-stat strong{font-size:1.1rem;}
    .dn-stat span{font-size:.68rem;}
    .dn-slider-controls{bottom:72px;}

    /* Products grid — exactly 2 columns on mobile, everywhere a product
       card grid appears (shop/archive loop, homepage "new products", and
       homepage "featured collections") */
    .dn-products-grid,
    .dn-featured-grid,
    .products.columns-4,
    .products.columns-3,
    .products.columns-2,
    ul.products{
        grid-template-columns:repeat(2,1fr)!important;
        gap:10px!important;
        align-items:stretch;
    }
    /* Product card mobile — equal-height, square image, touch-friendly */
    .dn-product-card,li.product{height:100%;}
    .dn-card-image{aspect-ratio:1/1;}
    .dn-card-body{padding:10px 11px 12px;gap:5px;}
    .dn-card-title,.woocommerce-loop-product__title{font-size:.82rem;}
    .dn-card-cat{font-size:.66rem;}
    .dn-card-price,.price{font-size:.88rem;}
    .dn-card-stars .dn-s{font-size:10px;}
    .dn-card-atc,.products .button.add_to_cart_button{padding:9px 12px;font-size:.78rem;min-height:44px;}
    .dn-card-atc svg{width:14px;height:14px;}
    /* No hover-only actions on mobile — wishlist/quick-view are tap targets
       elsewhere or hidden to avoid clutter on small cards */
    .dn-card-actions{display:none;}
    /* Disable the desktop lift/scale hover on touch so taps don't jitter */
    .dn-product-card:hover,li.product:hover{transform:none;}
    .dn-product-card:hover .dn-card-image img,
    li.product:hover .dn-card-image img,
    li.product:hover img.attachment-woocommerce_thumbnail{transform:none;}
    /* Badge smaller */
    .dn-card-badge span,.onsale{font-size:.62rem;padding:3px 8px;}

    /* Shop toolbar mobile */
    .dn-shop-toolbar{gap:8px;padding:10px 12px;}
    .dn-cat-chips{gap:6px;}
    .dn-cat-chip{padding:6px 13px;font-size:.76rem;}

    /* ── Single product: gallery + floating summary card ──────
       Mirrors the luxury mobile reference: full-bleed square
       gallery on top, white rounded card overlapping its bottom
       edge, everything else stacked below. */
    .dn-product-main{grid-template-columns:1fr;gap:0;}

    .dn-gallery-wrap{margin-inline:-16px;width:calc(100% + 32px);}
    .dn-gallery-wrap .woocommerce-product-gallery{border-radius:0;}
    .dn-product-new-badge{top:14px;}

    .dn-summary-card{
        position:relative;
        z-index:2;
        background:#fff;
        margin-top:-22px;
        padding:22px 18px 4px;
        border-radius:22px 22px 0 0;
        box-shadow:0 -8px 24px rgba(3,4,94,.08);
    }

    .product_title{font-size:1.25rem;}
    .dn-price-row{margin:14px 0 12px;}
    .price.price{font-size:1.35rem;}
    .dn-quick-meta{gap:14px;padding:12px 0;}
    .dn-quick-meta-item{font-size:.74rem;}
    .dn-quick-meta-icon{width:26px;height:26px;}
    .dn-quick-meta-icon svg{width:14px;height:14px;}
    .dn-info-cards{gap:8px;margin-bottom:18px;}
    .dn-info-card{padding:10px 10px;}
    .dn-info-card strong{font-size:.72rem;}
    .dn-info-card span{font-size:.68rem;}
    .dn-pill{min-width:42px;height:44px;padding:0 12px;font-size:.86rem;}
    .cart{margin-bottom:6px;}
    .single_add_to_cart_button.button,.dn-buy-now-button{font-size:.92rem;min-height:50px;}
    .dn-product-trust{gap:12px;}
    .dn-product-trust-item{font-size:.74rem;}
    .woocommerce-tabs .tabs li a{padding:9px 16px;font-size:.82rem;}

    /* Why us */
    .dn-why-grid{grid-template-columns:1fr 1fr;gap:12px;}
    .dn-why-card{padding:20px 16px;}
    .dn-why-icon{width:52px;height:52px;}
    .dn-why-icon svg{width:24px;height:24px;}
    .dn-why-title{font-size:.88rem;}
    .dn-why-desc{font-size:.78rem;}

    /* Counters */
    .dn-counters{padding:18px;gap:0;}
    .dn-counter-num{font-size:1.5rem;}
    .dn-counter-label{font-size:.7rem;}
    .dn-counter-div{height:36px;}

    /* FAQ */
    .dn-faq-layout{gap:28px;}
    .dn-faq-header .dn-section-title{font-size:1.3rem;}
    .dn-faq-question{padding:14px 16px;font-size:.86rem;}

    /* Testimonials */
    .dn-review-card{padding:20px;}
    .dn-review-text{font-size:.84rem;}

    /* Instagram */
    .dn-insta-grid{grid-template-columns:repeat(2,1fr);gap:4px;}

    /* Footer */
    .dn-footer-newsletter{padding:28px 0;}
    .dn-footer-main{padding:40px 0 28px;}
    .dn-footer-grid{grid-template-columns:1fr;gap:24px;}
    .dn-footer-heading{margin-bottom:12px;}
    .dn-trust-badges{margin-top:12px;}
    .dn-footer-bottom-inner{padding:14px 0;gap:10px;}

    /* Contact CTA */
    .dn-cta-title{font-size:1.3rem;}
    .dn-cta-desc{font-size:.88rem;}

    /* Page header */
    .dn-page-header{padding:36px 0;}
    .dn-page-header h1{font-size:1.3rem;}

    /* Section headers */
    .dn-section-header{margin-bottom:28px;}
    .dn-section-title{font-size:1.4rem;}
    .dn-section-desc{font-size:.88rem;}
    .dn-section{padding-block:52px;}

    /* Buttons */
    .dn-btn{padding:11px 22px;font-size:.88rem;}
    .dn-btn-lg{padding:14px 28px;font-size:.95rem;}

    /* QV Modal */
    .dn-qv-content{grid-template-columns:1fr;}
    .dn-modal-box{max-width:100%;border-radius:var(--dn-radius-lg) var(--dn-radius-lg) 0 0;}
    .dn-modal-overlay{align-items:flex-end;padding:0;}

    /* Blog */
    .dn-posts-grid{grid-template-columns:1fr;gap:16px;}

    /* Bestsellers */
    .dn-bestsellers-layout{grid-template-columns:1fr;}

    /* Category grid */
    .dn-cat-grid{grid-template-columns:repeat(2,1fr);gap:10px;}
    .dn-cat-card{aspect-ratio:3/2;}
    .dn-cat-name{font-size:.88rem;}

    /* Cart page mobile styles now live in assets/css/cart.css, enqueued only
       on the cart page (see inc/enqueue.php). The old horizontal-scrolling
       table approach was replaced with stacked product cards there. */
}

/* ── Small mobile (≤400px) ────────────────────────────────── */
@media(max-width:400px){
    .dn-why-grid{grid-template-columns:1fr;}
    .dn-products-grid,.products.columns-4,.products.columns-3{grid-template-columns:repeat(2,1fr)!important;}
    .dn-slide-actions{flex-direction:column;}
    .dn-bottom-nav-item{min-width:44px;}
    .dn-bnav-label{display:none;}
}

/* ── Touch optimizations ──────────────────────────────────── */
@media(hover:none) and (pointer:coarse){
    /* Bigger tap targets */
    .dn-cat-chip{min-height:40px;display:flex;align-items:center;}
    .dn-card-atc,.products .button{min-height:44px;}
    .dn-qty-btn{min-width:44px;height:44px;}
    .dn-action-btn{min-width:40px;min-height:40px;}
    /* Remove hover effects that don't work on touch */
    .dn-product-card:hover,.products li.product:hover{transform:none;box-shadow:var(--dn-shadow-xs);}
    .dn-cat-card:hover{transform:none;}
    /* Show wishlist always on mobile (no hover) */
    .dn-card-actions{opacity:1;transform:none;}
}

/* ── iOS safe area ────────────────────────────────────────── */
@supports(padding:env(safe-area-inset-bottom)){
    .dn-sticky-atc{padding-bottom:calc(14px + env(safe-area-inset-bottom));}
}

/* ── Reduced motion ───────────────────────────────────────── */
@media(prefers-reduced-motion:reduce){
    *,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important;}
    .dn-hero::before{animation:none;}
}

/* ── Dark mode support ────────────────────────────────────── */
@media(prefers-color-scheme:dark){
    /* Optional: can be enabled via customizer toggle */
}

/* ── Print ────────────────────────────────────────────────── */
@media print{
    .dn-header,.dn-footer,.dn-bottom-nav,.dn-back-to-top,.dn-announcement,.dn-hero-particles{display:none!important;}
}
