/* ===================================
   Cake Studio – Comprehensive Responsive Styles
   Mobile-first approach on top of Bootstrap 5
   Breakpoints: 480 / 576 / 768 / 992 / 1200
=================================== */

/* ─────────────────────────────────────
   GLOBAL / UTILITIES
───────────────────────────────────── */
img { max-width: 100%; height: auto; }

.overflow-x-hidden { overflow-x: hidden; }

/* ─────────────────────────────────────
   LARGE DESKTOP  ≥ 1400px
───────────────────────────────────── */
@media (min-width: 1400px) {
    .container { max-width: 1320px; }
}

/* ─────────────────────────────────────
   TABLET LANDSCAPE  ≤ 1199px
───────────────────────────────────── */
@media (max-width: 1199px) {
    .categories-dropdown { min-width: 220px; }
    .main-menu > li > a  { padding: 18px 12px; font-size: 0.9rem; }
    .hero-title           { font-size: 2.8rem; }
    .product-grid         { grid-template-columns: repeat(3, 1fr); }
}

/* ─────────────────────────────────────
   TABLET PORTRAIT  ≤ 991px
───────────────────────────────────── */
@media (max-width: 991px) {

    /* Top bar */
    .top-bar     { font-size: 0.75rem; }
    .top-bar a   { margin-left: 10px; }

    /* Header */
    .main-header { padding: 15px 0; }
    .logo-text   { font-size: 1.8rem; }
    .header-actions { gap: 15px; }
    .header-action span { display: none !important; }

    /* Navigation – hide desktop menu, show mobile hamburger */
    .categories-dropdown { display: none; }
    .main-menu           { display: none; }
    .nav-wrapper         { justify-content: flex-end; padding: 8px 0; }

    /* Mobile hamburger toggle */
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        cursor: pointer;
        color: var(--dark-text);
        font-size: 1.5rem;
        padding: 6px 10px;
        border-radius: 8px;
        transition: var(--transition);
    }
    .mobile-menu-toggle:hover { color: var(--primary-rose-gold); }

    /* Mobile slide-down menu */
    .mobile-nav-menu {
        display: none !important;
        background: var(--white);
        border-top: 1px solid var(--gray-100);
        padding: 10px 0;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 9999;
        box-shadow: var(--shadow-lg);
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    .mobile-nav-menu.open { display: block !important; }
    .mobile-nav-menu ul   { list-style: none; margin: 0; padding: 0; }
    .mobile-nav-menu ul li a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 13px 24px;
        color: var(--dark-text);
        font-size: 0.95rem;
        font-weight: 500;
        border-bottom: 1px solid var(--gray-100);
        transition: var(--transition);
    }
    .mobile-nav-menu ul li a:hover { background: var(--soft-pink); color: var(--primary-rose-gold); }
    .mobile-nav-menu ul li a.sale-link { color: var(--primary-rose-gold); font-weight: 700; }

    /* Hero */
    .hero-slide { min-height: 400px; padding: 40px 30px; }
    .hero-title  { font-size: 2.2rem; }
    .hero-description { font-size: 0.95rem; }

    /* Sections */
    .section-heading { font-size: 1.8rem; }
    .product-grid    { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .feature-item    { flex-direction: column; text-align: center; }
    .instagram-grid  { grid-template-columns: repeat(4, 1fr); }
    .newsletter-wrapper { padding: 40px 25px; }
    .newsletter-title   { font-size: 1.5rem; }
    .newsletter-text    { font-size: 0.9rem; }

    /* Footer */
    .footer-widget      { text-align: center; }
    .widget-title::after{ left: 50%; transform: translateX(-50%); }
    .footer-menu li a   { justify-content: center; }
    .contact-info li    { justify-content: center; }
    .footer-social      { justify-content: center; }
    .payment-icons      { justify-content: center; }

    /* Cart – make table scrollable */
    .cart-items {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
    }
    .cart-items table { min-width: 520px; }

    /* Checkout */
    .checkout-form { padding: 20px !important; }

    /* Product page actions */
    .product-detail-section .product-actions {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .product-actions .add-to-cart-form {
        flex-wrap: wrap;
    }
    .product-actions .add-to-cart-form .qty-wrapper { width: auto; }
    .product-actions .add-to-cart-form .add-to-cart-btn { width: 100%; }

    /* Shop sidebar - remove sticky on tablet */
    .shop-sidebar { position: relative !important; top: 0 !important; }

    /* Product tabs on tablet */
    .product-tabs .nav-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Hero buttons wrapping */
    .hero-buttons { flex-wrap: wrap; }
}

/* ─────────────────────────────────────
   MOBILE  ≤ 767px
───────────────────────────────────── */
@media (max-width: 767px) {

    body { font-size: 14px; }

    /* Top bar hidden */
    .top-bar { display: none; }

    /* Header */
    .main-header { padding: 10px 0; }
    .logo-text   { font-size: 1.5rem; letter-spacing: 2px; }
    .logo-tagline { font-size: 0.6rem; }
    .header-actions { gap: 12px; }
    .header-action i { font-size: 1.2rem; }
    .badge-count { width: 18px; height: 18px; font-size: 0.65rem; }

    /* Nav */
    .main-nav { position: relative; }

    /* Hero */
    .hero-section { padding: 15px 0; }
    .hero-slide   { min-height: 320px; padding: 25px 18px; }
    .hero-subtitle { font-size: 0.7rem; letter-spacing: 2px; margin-bottom: 15px; }
    .hero-title    { font-size: 1.6rem; }
    .hero-description { font-size: 0.85rem; margin-bottom: 20px; }
    .hero-buttons  { flex-direction: column; gap: 10px; }
    .btn-luxury,
    .btn-outline-luxury { width: 100%; justify-content: center; font-size: 0.82rem; padding: 12px 20px; }

    /* Sections */
    .section-title   { margin-bottom: 25px; }
    .section-heading { font-size: 1.4rem; }
    .section-subtitle { font-size: 0.7rem; letter-spacing: 2px; }

    /* Features bar */
    .features-bar   { padding: 25px 0; }
    .feature-item   { flex-direction: row; text-align: left; padding: 15px; }
    .feature-icon   { width: 50px; height: 50px; font-size: 1.2rem; }
    .feature-content h5 { font-size: 0.9rem; }
    .feature-content p  { font-size: 0.75rem; }

    /* Sections padding */
    .categories-section,
    .product-section,
    .testimonials-section,
    .instagram-section,
    .newsletter-section,
    .brands-section { padding: 40px 0; }

    /* Category cards */
    .category-card         { height: 200px; }
    .category-card-content { padding: 20px; }
    .category-name         { font-size: 1.1rem; }

    /* Product grid */
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-info { padding: 12px; }
    .product-name { font-size: 0.88rem; min-height: 2.5em; }
    .product-price .regular { font-size: 16px; }

    /* ── PRODUCT CARDS ON MOBILE (always show buttons) ── */
    .product-add-cart {
        transform: translateY(0) !important;
        position: relative !important;
    }
    .product-actions {
        opacity: 1 !important;
        transform: translateX(0) !important;
    }
    .product-card:hover .product-add-cart {
        transform: translateY(0) !important;
    }
    .product-card:hover .product-actions {
        opacity: 1 !important;
        transform: translateX(0) !important;
    }
    .product-image-wrapper {
        padding-top: 80%;
    }

    /* ── CART PAGE ── */
    .cart-items {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
    }
    .cart-items table { min-width: 480px; }
    .cart-items td, .cart-items th { padding: 12px 10px !important; }
    .cart-items thead { display: table-header-group; }
    .cart-items tr { display: table-row; }
    .cart-items td, .cart-items th { display: table-cell; }

    /* Cart summary stacks below on mobile */
    .cart-summary {
        position: static !important;
        margin-top: 20px;
    }

    /* WhatsApp cart button */
    #cart-whatsapp-btn { font-size: 0.88rem; padding: 12px 16px; }

    /* ── CHECKOUT PAGE ── */
    .checkout-form { padding: 18px !important; margin-bottom: 16px !important; }
    .checkout-form h3 { font-size: 1.1rem !important; }

    /* ── PRODUCT DETAIL PAGE ── */
    .product-gallery  { padding: 15px !important; }
    .gallery-main     { margin-bottom: 10px !important; }
    .gallery-thumbs   { gap: 6px; }
    .gallery-thumb    { width: 60px !important; height: 60px !important; }

    .product-details h1 { font-size: 1.5rem !important; }
    .product-price span { font-size: 0.75rem !important; }
    .product-actions .add-to-cart-form { flex-direction: column; gap: 10px; }
    .product-actions .add-to-cart-form .add-to-cart-btn,
    .product-actions .add-to-cart-form .qty-wrapper { width: 100%; justify-content: center; }
    .product-actions > div { flex-direction: column; }
    .wishlist-btn, .whatsapp-buy-btn { width: 100% !important; justify-content: center; }
    #wa-status-box { font-size: 0.83rem !important; }

    /* Product tabs */
    .product-tabs .nav-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .product-tabs .tab-btn  { white-space: nowrap; padding: 12px 16px !important; font-size: 0.85rem; }
    .tab-contents           { padding: 20px !important; }

    /* ── ORDER PAGES ── */
    .order-summary { position: static !important; }

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

    /* Newsletter */
    .newsletter-wrapper { padding: 25px 15px; border-radius: 16px; }
    .newsletter-title   { font-size: 1.2rem; }
    .newsletter-form .form-control { padding: 12px 18px; font-size: 0.85rem; }
    .btn-subscribe { padding: 12px 18px; font-size: 0.75rem; }
    .newsletter-form .input-group { flex-direction: column; gap: 10px; }
    .newsletter-form .input-group .form-control {
        border-radius: 50px !important;
        width: 100%;
    }
    .newsletter-form .input-group .btn-subscribe {
        border-radius: 50px !important;
        width: 100%;
        justify-content: center;
    }

    /* Footer */
    .main-footer    { padding-top: 40px; }
    .footer-bottom  { text-align: center; }
    .footer-bottom-menu { justify-content: center; gap: 12px; margin-top: 10px; }
    .footer-bottom-menu li a { font-size: 0.75rem; }

    /* Floating buttons */
    .whatsapp-float { width: 46px; height: 46px; font-size: 1.3rem; bottom: 16px; right: 16px; }
    .btn-back-to-top { width: 40px; height: 40px; font-size: 1rem; bottom: 16px; left: 16px; }

    /* Misc cards */
    .testimonial-card { padding: 22px 16px; }
    .brand-card       { padding: 18px; }

    /* Tables (orders list etc.) */
    .table-responsive-xs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ─────────────────────────────────────
   SMALL MOBILE  ≤ 575px
───────────────────────────────────── */
@media (max-width: 575px) {

    /* Container breathing room */
    .container { padding: 0 12px; }

    /* 1-column product grid */
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }

    /* Hero */
    .hero-title { font-size: 1.35rem; }
    .hero-slide { min-height: 280px; padding: 20px 15px; }

    /* Header */
    .header-actions { gap: 8px; }
    .search-input  { font-size: 0.83rem; padding: 10px 50px 10px 16px; }
    .search-btn    { width: 44px; }

    /* Cart - full single column */
    .cart-items table { min-width: 420px; }

    /* Checkout pill inputs */
    .checkout-form input,
    .checkout-form select,
    .checkout-form textarea {
        border-radius: 12px !important;
        font-size: 0.88rem;
    }

    /* Payment method items */
    .payment-method-item { padding: 12px 14px !important; }

    /* Order success page */
    .order-success-card { padding: 25px 15px !important; }

    /* Addresses page */
    .address-card { padding: 15px !important; }

    /* Account page tabs */
    .account-tabs .nav-link { padding: 10px 14px !important; font-size: 0.83rem; }
}

/* ─────────────────────────────────────
   VERY SMALL  ≤ 400px
───────────────────────────────────── */
@media (max-width: 400px) {
    .product-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
    .product-name { font-size: 0.8rem; }
    .hero-title   { font-size: 1.2rem; }

    /* Single column product grid for very small screens */
    .product-grid.single-col-xs { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────
   MOBILE NAV HAMBURGER & MENU – always hidden
   on desktop, shown via media queries
───────────────────────────────────── */
.mobile-menu-toggle { display: none; }
.mobile-nav-menu { display: none !important; }

/* ─────────────────────────────────────
   TOUCH DEVICES – disable hover effects
───────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
    .product-actions {
        opacity: 1 !important;
        transform: translateX(0) !important;
    }
    .product-add-cart {
        transform: translateY(0) !important;
        position: relative !important;
    }
    .product-card:hover .product-add-cart {
        transform: translateY(0) !important;
    }
    .product-card:hover .product-actions {
        opacity: 1 !important;
        transform: translateX(0) !important;
    }
    .product-card:hover {
        transform: none !important;
        box-shadow: var(--shadow-sm) !important;
    }
    .feature-item:hover {
        transform: none !important;
        background: transparent !important;
    }
    .feature-item:hover .feature-icon {
        background: var(--gradient-soft) !important;
        color: var(--primary-rose-gold) !important;
    }
    .category-card:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    .category-card:hover .category-card-bg {
        transform: none !important;
    }
    .testimonial-card:hover {
        transform: none !important;
    }
    .brand-card:hover {
        transform: none !important;
    }
    .btn-luxury:hover,
    .btn-outline-luxury:hover {
        transform: none !important;
    }
    .header-action:hover {
        transform: none !important;
    }
    .instagram-item:hover img {
        transform: none !important;
    }
}

/* ─────────────────────────────────────
   STICKY NAV ON MOBILE
───────────────────────────────────── */
@media (max-width: 991px) {
    .main-nav.sticky-nav {
        z-index: 9999 !important;
    }
}

/* ─────────────────────────────────────
   SHOP PAGE RESPONSIVE
───────────────────────────────────── */
@media (max-width: 767px) {
    .page-header-section h1 {
        font-size: 1.8rem !important;
    }
    .shop-toolbar {
        flex-direction: column;
        align-items: flex-start !important;
    }
    .shop-toolbar select {
        width: 100%;
    }
    .product-detail-section .product-details h1 {
        font-size: 1.5rem !important;
    }
    .product-detail-section .product-price span:first-child {
        font-size: 1.5rem !important;
    }
    .variation-group > div {
        gap: 6px !important;
    }
    .variation-group label {
        padding: 6px 12px !important;
        font-size: 0.82rem !important;
    }
    .add-to-cart-btn {
        min-width: 100% !important;
        width: 100%;
    }
    .wishlist-btn,
    .whatsapp-buy-btn {
        width: 100% !important;
    }
    .cart-section h1 {
        font-size: 1.6rem !important;
    }
    .coupon-section {
        width: 100%;
    }
    .coupon-section input {
        max-width: 100% !important;
        flex: 1;
    }
    .banner-card h3 {
        font-size: 1.2rem !important;
    }
    .banner-card p {
        font-size: 0.85rem !important;
    }
}

/* ─────────────────────────────────────
   VERY SMALL SCREENS ≤ 400px
───────────────────────────────────── */
@media (max-width: 400px) {
    .product-grid { gap: 6px; }
    .product-info { padding: 10px; }
    .product-name { font-size: 0.78rem; min-height: 2.2em; }
    .product-price .regular { font-size: 0.82rem; }
    .product-price .sale { font-size: 0.72rem; }
}

/* ─────────────────────────────────────
   PRINT
───────────────────────────────────── */
@media print {
    .top-bar,
    .main-nav,
    .whatsapp-float,
    .btn-back-to-top,
    #preloader,
    .newsletter-section { display: none !important; }
    body { background: white; }
}
