/* ============================================================
   KRITANSH ENTERPRISES — USER PANEL RESPONSIVE CSS
   Breakpoints:
   LG  : 1200px (large laptop)
   MD  : 1024px (laptop / small laptop)
   TAB : 768px  (tablet portrait)
   SM  : 600px  (large mobile / phablet)
   XS  : 480px  (mobile landscape)
   XXS : 360px  (small mobile)
   ============================================================ */

/* ============================================================
   GLOBAL — All screens
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
img { max-width: 100%; height: auto; display: block; }
.container { width: 100%; padding: 0 16px; }

/* ============================================================
   LG — ≤1200px  (large laptop)
   ============================================================ */
@media (max-width: 1200px) {
  :root { --header-height: 90px; }

  .container { max-width: 1100px; }

  /* Header */
  .header-inner { gap: 16px; }
  .header-search { max-width: 420px; }
  .logo img { max-height: 80px !important; }

  /* Nav */
  .nav-list > li > a { padding: 0 11px; font-size: 13px; }
  .mega-dropdown { min-width: 400px; }

  /* Hero */
  .hero-title { font-size: 46px; }
  .hero-image { max-width: 44%; }

  /* Products */
  .products-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }

  /* Brands */
  .brand-showcase { gap: 20px; }
  .brand-showcase-card { padding: 36px 28px; }

  /* Footer */
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
  .footer-about { grid-column: 1 / -1; }
}

/* ============================================================
   MD — ≤1024px  (laptop / small laptop)
   ============================================================ */
@media (max-width: 1024px) {
  :root { --header-height: 84px; }

  .container { max-width: 960px; }

  /* Header */
  .header-search { max-width: 340px; }
  .logo img { max-height: 72px !important; }
  .logo-name { font-size: 17px; }
  .logo-brands { font-size: 9px; }

  /* Nav */
  .nav-list > li > a { padding: 0 9px; font-size: 12.5px; }
  .mega-dropdown { min-width: 360px; }
  .axor-mega-dropdown { min-width: 540px !important; }
  .axor-mega-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 16px !important; }

  /* Hero */
  .hero-title { font-size: 40px; }
  .hero-desc  { font-size: 15px; }
  .hero-image { max-width: 46%; }
  .hero-slide { min-height: 440px; }

  /* Product grid */
  .products-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }

  /* Brands */
  .brand-showcase { gap: 18px; }
  .brand-showcase-name { font-size: 38px; }

  /* Features */
  .features-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }

  /* Section */
  .section { padding: 64px 0; }
  .section-title { font-size: 34px; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-about { grid-column: 1 / -1; }

  /* Cart */
  .cart-layout { grid-template-columns: minmax(0,1fr) 300px; gap: 20px; }

  /* Checkout */
  .checkout-grid { grid-template-columns: minmax(0,1fr) 320px; gap: 20px; }

  /* Profile */
  .profile-grid { grid-template-columns: 240px 1fr; gap: 20px; }
}

/* ============================================================
   TAB — ≤768px  (tablet portrait / large phablet)
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --header-height: 76px;
    --topbar-height: 32px;
  }

  /* Container */
  .container { max-width: 100%; padding: 0 14px; }

  /* ---- TOPBAR ---- */
  .topbar-left { display: none; }
  .topbar-right { gap: 12px; font-size: 11px; }
  .topbar-right span { display: none; }
  .topbar-right a { display: flex; }

  /* ---- HEADER ---- */
  .header-inner { gap: 10px; }
  .logo img { max-height: 62px !important; }
  .logo-brands { display: none; }
  .header-search { max-width: none; flex: 1; }
  .hamburger { display: flex !important; }

  /* Hide action btn text labels if any */
  .action-btn-label { display: none; }

  /* ---- OFF-CANVAS MOBILE NAV ---- */
  .main-nav {
    display: block;
    position: fixed;
    top: 0; left: -100%;
    width: 290px; max-width: 85vw;
    height: 100vh;
    background: var(--white);
    border-right: 2px solid var(--primary);
    z-index: 1002;
    overflow-y: auto;
    transition: left 0.32s cubic-bezier(.4,0,.2,1);
    padding: 0 0 40px;
    border-bottom: none;
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }
  .main-nav.open { left: 0; }
  .main-nav > .container { padding: 0; }

  /* Mobile nav header */
  .mobile-nav-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--dark-4);
    background: var(--dark-3);
    position: sticky; top: 0; z-index: 2;
  }
  .mobile-nav-title { font-size: 15px; font-weight: 700; color: var(--blue); letter-spacing: 1px; font-family: var(--font-heading); }
  .mobile-nav-close {
    width: 30px; height: 30px;
    background: var(--dark-4);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: var(--light-3); font-size: 14px; cursor: pointer;
    transition: var(--transition-fast);
  }
  .mobile-nav-close:hover { background: var(--primary); color: white; }

  /* Nav list mobile */
  .nav-list { flex-direction: column; align-items: flex-start; gap: 0; padding: 6px 0; }
  .nav-list > li { width: 100%; border-bottom: 1px solid var(--dark-4); }
  .nav-list > li:last-child { border-bottom: none; }
  .nav-list > li > a {
    padding: 13px 18px;
    height: auto; width: 100%;
    justify-content: space-between;
    font-size: 14px; border-radius: 0;
    color: var(--light-2);
  }
  .nav-list > li > a::after { display: none; }
  .nav-list > li > a::before { display: none; }
  .nav-list > li > a:hover, .nav-list > li > a.active { color: var(--primary); background: var(--dark-3); }

  /* Dropdowns mobile */
  .dropdown {
    position: static;
    opacity: 1; visibility: visible; transform: none;
    border: none;
    border-top: 1px solid var(--dark-4);
    background: var(--dark-2);
    box-shadow: none;
    display: none; border-radius: 0; min-width: unset;
  }
  .has-dropdown.open .dropdown { display: block; }
  .dropdown ul { padding: 4px 0; }
  .dropdown ul li a { padding: 10px 18px 10px 28px; font-size: 13px; color: var(--light-3); }
  .dropdown ul li a:hover { padding-left: 32px; color: var(--primary); background: var(--dark-3); }

  /* Mega dropdown mobile */
  .mega-dropdown { padding: 12px; min-width: unset; }
  .brand-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .brand-card { padding: 14px 10px; }
  .brand-card h4 { font-size: 15px; }
  .axor-mega-dropdown { min-width: 100% !important; padding: 14px !important; }
  .axor-mega-grid { grid-template-columns: 1fr 1fr !important; gap: 12px !important; }
  .mega-column h4 { font-size: 12px; color: var(--primary); }

  /* Mobile only nav items */
  .mobile-only-nav { display: block !important; }

  /* ---- HERO ---- */
  .hero-image { display: none; }
  .hero-slide { min-height: 360px; text-align: center; padding: 40px 0; }
  .hero-content { max-width: 100%; }
  .hero-title { font-size: 36px; }
  .hero-desc { font-size: 15px; }
  .hero-btns { justify-content: center; flex-wrap: wrap; gap: 12px; }
  .hero-arrow { display: none; }
  .hero-controls { bottom: 16px; }

  /* ---- FEATURES BAR ---- */
  .features-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .feature-item { flex-direction: column; text-align: center; gap: 6px; }
  .feature-icon { width: 44px; height: 44px; font-size: 18px; margin: 0 auto; }

  /* ---- CATEGORIES ---- */
  .categories-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 12px; }
  .category-card { padding: 18px 10px; }
  .category-icon { width: 52px; height: 52px; font-size: 22px; }

  /* ---- PRODUCTS ---- */
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .product-name { font-size: 14px; }
  .current-price { font-size: 17px; }

  /* ---- UTILITY GRIDS ---- */
  .stats-grid-row { grid-template-columns: repeat(2, 1fr) !important; gap: 20px !important; }
  .why-choose-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 16px !important; }
  .reviews-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 16px !important; }

  /* ---- SECTION ---- */
  .section { padding: 50px 0; }
  .section-header { margin-bottom: 30px; }
  .section-title { font-size: 28px; }
  .section-desc { font-size: 14px; }

  /* ---- BRANDS ---- */
  .brand-showcase { grid-template-columns: 1fr; gap: 16px; }
  .brand-showcase-card { min-height: 180px; padding: 28px 22px; }
  .brand-showcase-name { font-size: 36px; }
  .brand-showcase-desc { font-size: 13px; }

  /* ---- FOOTER ---- */
  .footer-top { padding: 40px 0 28px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-about { grid-column: 1 / -1; }
  .footer-logo img { max-height: 90px !important; }
  .footer-col h4 { font-size: 14px; margin-bottom: 14px; }

  /* ---- CART PAGE ---- */
  .cart-layout { grid-template-columns: 1fr; gap: 20px; }
  .cart-summary-box { position: static !important; }
  /* Stack cart table rows on tablet */
  .cart-layout thead th:nth-child(3),
  .cart-layout tbody td:nth-child(3) { display: none; }

  /* ---- CHECKOUT PAGE ---- */
  .checkout-grid { grid-template-columns: 1fr !important; gap: 20px; }
  .checkout-steps { gap: 6px !important; }

  /* ---- PROFILE PAGE ---- */
  .profile-grid { grid-template-columns: 1fr !important; gap: 20px; }

  /* ---- ORDERS PAGE ---- */
  .order-summary-grid { grid-template-columns: 1fr 1fr !important; gap: 14px; }

  /* ---- AUTH PAGES ---- */
  .auth-page { padding: 28px 14px; }
  .auth-card { padding: 28px 22px; }

  /* ---- PRODUCT DETAIL ---- */
  .product-detail-grid { grid-template-columns: 1fr !important; gap: 28px; }
  .product-thumbnails { flex-direction: row !important; justify-content: center; }

  /* ---- TABLE GLOBAL ---- */
  .table-wrap { border-radius: var(--radius); }
  thead th { font-size: 12px; padding: 12px 10px; white-space: nowrap; }
  tbody td { font-size: 13px; padding: 11px 10px; }

  /* ---- BREADCRUMB ---- */
  .breadcrumb { padding: 10px 0; }
  .breadcrumb-list { font-size: 12px; }

  /* ---- PAGE SIDEBAR ---- */
  .page-with-sidebar { grid-template-columns: 1fr !important; }
  .sidebar { display: none; }
  .sidebar.show { display: block; }
  .filter-toggle-btn { display: flex !important; }
}

/* ============================================================
   SM — ≤600px  (large mobile / phablet)
   ============================================================ */
@media (max-width: 600px) {
  :root { --header-height: 70px; }

  /* ---- TOPBAR ---- */
  .topbar { display: none; }

  /* ---- HEADER ---- */
  .header-inner { gap: 8px; }
  .logo img { max-height: 54px !important; }
  .header-search input { font-size: 13px; padding: 8px 12px; }
  .header-search button { padding: 8px 14px; }
  .action-btn { width: 40px; height: 40px; font-size: 17px; }
  .header-actions { gap: 6px; }
  .hamburger { width: 40px !important; height: 40px !important; }

  /* ---- HERO ---- */
  .hero-slide { min-height: 300px; padding: 32px 0; }
  .hero-title { font-size: 28px; }
  .hero-tag { font-size: 11px; padding: 5px 12px; margin-bottom: 14px; }
  .hero-desc { font-size: 14px; margin-bottom: 22px; }
  .hero-btns .btn { padding: 11px 22px; font-size: 14px; }
  .hero-btns { flex-direction: column; align-items: center; }
  .hero-controls { bottom: 12px; }
  .hero-dot { width: 10px; height: 10px; }
  .hero-dot.active { width: 20px; }

  /* ---- FEATURES ---- */
  .features-bar { padding: 14px 0; }
  .features-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .feature-icon { width: 40px; height: 40px; font-size: 16px; }
  .feature-text h5 { font-size: 13px; }
  .feature-text p { font-size: 11px; }

  /* ---- TICKER ---- */
  .ticker-item { padding: 0 20px; font-size: 11.5px; }

  /* ---- CATEGORIES ---- */
  .categories-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 8px; }
  .category-card { padding: 14px 8px; }
  .category-icon { width: 44px; height: 44px; font-size: 20px; margin-bottom: 8px; }
  .category-card h4 { font-size: 12px; }
  .category-card p { display: none; }

  /* ---- PRODUCTS ---- */
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .product-card { border-radius: var(--radius); }
  .product-info { padding: 11px; }
  .product-name { font-size: 13px; }
  .current-price { font-size: 15px; }
  .original-price { font-size: 12px; }
  .btn-add-cart { font-size: 12px; padding: 9px 8px; }
  .product-actions-hover { display: none; }
  .product-badge { font-size: 10px; padding: 3px 7px; }

  /* ---- SECTION ---- */
  .section { padding: 36px 0; }
  .section-header { margin-bottom: 24px; }
  .section-title { font-size: 24px; }
  .section-tag { font-size: 11px; letter-spacing: 2px; }
  .section-desc { font-size: 13px; }

  /* ---- BRAND SHOWCASE ---- */
  .brand-showcase-name { font-size: 30px; }
  .brand-showcase-card { padding: 22px 16px; min-height: 140px; }

  /* ---- FOOTER ---- */
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-about p { font-size: 13px; }
  .footer-logo img { max-height: 80px !important; }
  .footer-bottom .container { flex-direction: column; text-align: center; gap: 8px; }
  .footer-bottom-links { gap: 14px; flex-wrap: wrap; justify-content: center; }
  .footer-bottom p, .footer-bottom-links a { font-size: 12px; }

  /* ---- FORMS ---- */
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .btn-lg { padding: 13px 24px; font-size: 15px; }
  .btn { padding: 11px 20px; font-size: 14px; }
  .form-control { font-size: 14px; }

  /* ---- TABLES ---- */
  .table-wrap { border-radius: var(--radius); }
  thead th { font-size: 11.5px; padding: 10px 8px; }
  tbody td { font-size: 12.5px; padding: 10px 8px; }

  /* ---- CART PAGE ---- */
  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary-box { position: static !important; }
  /* Hide price column on small screens — shown on product name cell */
  thead th:nth-child(3), tbody td:nth-child(3) { display: none; }

  /* ---- CHECKOUT ---- */
  .checkout-steps { gap: 4px !important; overflow-x: auto; padding-bottom: 4px; }
  .step-label { font-size: 11px; }
  .step-num { width: 32px !important; height: 32px !important; font-size: 13px !important; }

  /* ---- PROFILE ---- */
  .profile-grid { grid-template-columns: 1fr !important; }

  /* ---- ORDERS ---- */
  .order-summary-grid { grid-template-columns: 1fr 1fr !important; gap: 10px; }

  /* ---- PRODUCT DETAIL ---- */
  .product-detail-grid { grid-template-columns: 1fr !important; }
  .detail-tabs { gap: 2px; }
  .tab-btn { padding: 10px 16px; font-size: 12px; }
  .tab-content-wrap { padding: 18px; }

  /* ---- AUTH ---- */
  .auth-card { padding: 22px 16px !important; }
  .auth-title { font-size: 22px; }
  .auth-logo { font-size: 20px; }

  /* ---- TRACK ORDER ---- */
  .track-order-card { padding: 20px 16px; }

  /* ---- PAGINATION ---- */
  .pagination { gap: 4px; }
  .page-btn { width: 36px; height: 36px; font-size: 13px; }

  /* ---- TOAST ---- */
  .toast-container { right: 10px; left: 10px; bottom: 16px; }
  .toast { min-width: unset; }

  /* ---- BACK TO TOP ---- */
  .back-to-top { bottom: 70px; right: 14px; width: 40px; height: 40px; font-size: 14px; }

  /* ---- MODAL ---- */
  .modal-box { width: 95% !important; padding: 22px 16px !important; }
}

/* ============================================================
   XS — ≤480px  (mobile landscape / compact mobile)
   ============================================================ */
@media (max-width: 480px) {
  :root { --header-height: 64px; }

  /* Header compact */
  .header-inner { gap: 6px; }
  .logo img { max-height: 48px !important; }
  .action-btn { width: 38px; height: 38px; font-size: 16px; }
  .header-actions { gap: 5px; }
  .header-search input { padding: 7px 10px; font-size: 12.5px; }
  .header-search button { padding: 7px 12px; }

  /* Hero */
  .hero-slide { min-height: 270px; padding: 26px 0; }
  .hero-title { font-size: 24px; }
  .hero-desc { display: none; }
  .hero-tag { font-size: 10px; padding: 4px 10px; }
  .hero-btns .btn { font-size: 13px; padding: 10px 18px; }

  /* Products */
  .products-grid { gap: 8px; }
  .product-img-wrap { aspect-ratio: 1; }
  .product-info { padding: 9px 9px 12px; }
  .product-name { font-size: 12px; }
  .current-price { font-size: 14px; }
  .btn-add-cart { font-size: 11px; padding: 8px 6px; }
  .product-card-buttons { flex-direction: column !important; gap: 6px !important; }
  .product-card-buttons .btn-add-cart,
  .product-card-buttons .btn-buy-now { width: 100% !important; flex: none !important; font-size: 11px !important; padding: 8px 4px !important; }

  /* Utility Grids Mobile */
  .stats-grid-row { grid-template-columns: repeat(2, 1fr) !important; gap: 14px !important; }
  .why-choose-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
  .reviews-grid { grid-template-columns: 1fr !important; gap: 12px !important; }

  /* Categories */
  .categories-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 6px; }
  .category-card { padding: 12px 6px; }
  .category-icon { width: 38px; height: 38px; font-size: 16px; }

  /* Section */
  .section { padding: 30px 0; }
  .section-title { font-size: 21px; }

  /* Cart table mobile card layout */
  .mobile-card-table thead { display: none; }
  .mobile-card-table tbody tr {
    display: block;
    background: var(--white);
    border: 1px solid var(--dark-4);
    border-radius: var(--radius);
    margin-bottom: 12px;
    padding: 12px;
  }
  .mobile-card-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border: none; font-size: 13px;
  }
  .mobile-card-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    font-size: 10.5px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex-shrink: 0; margin-right: 10px;
  }

  /* Auth */
  .auth-card { padding: 18px 14px !important; }
  .auth-title { font-size: 20px; }

  /* Checkout steps */
  .step-label { display: none; }

  /* Admin stats — if visible in user panel */
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ============================================================
   XXS — ≤360px  (small / compact mobile)
   ============================================================ */
@media (max-width: 360px) {
  :root { --header-height: 60px; }

  .container { padding: 0 10px; }

  /* Header */
  .logo img { max-height: 42px !important; }
  .action-btn { width: 34px; height: 34px; font-size: 15px; }
  .header-actions { gap: 4px; }
  .header-search { display: none; }

  /* Hero */
  .hero-title { font-size: 21px; }
  .hero-slide { min-height: 240px; padding: 22px 0; }
  .hero-btns .btn { font-size: 12px; padding: 9px 14px; }

  /* Products — 1 col */
  .products-grid { grid-template-columns: 1fr; }
  .stats-grid-row { grid-template-columns: 1fr !important; }

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

  /* Features */
  .features-grid { grid-template-columns: 1fr; }
  .feature-item { flex-direction: row; text-align: left; }

  /* Section */
  .section-title { font-size: 19px; }
  .btn { font-size: 13px; padding: 10px 14px; }
  .btn-lg { font-size: 14px; padding: 11px 18px; }

  /* Footer */
  .social-links a { width: 32px; height: 32px; font-size: 13px; }
}

/* ============================================================
   LANDSCAPE MOBILE — max-height: 500px + max-width: 900px
   ============================================================ */
@media (max-width: 900px) and (orientation: landscape) {
  :root { --header-height: 60px; }
  .hero-slide { min-height: 230px; }
  .hero-title { font-size: 26px; }
  .main-nav { width: 260px; }
  .section { padding: 30px 0; }
}

/* ============================================================
   TOUCH DEVICE IMPROVEMENTS (prevents zoom on input focus)
   ============================================================ */
@media (hover: none) and (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }
  .form-control { min-height: 46px; font-size: 16px !important; }
  .btn { min-height: 46px; }
  .action-btn { min-width: 44px; min-height: 44px; }
  .nav-list > li > a { min-height: 48px; }

  /* Remove hover-only transforms */
  .product-card:hover { transform: none; }
  .btn-primary:hover { transform: none; }
  .btn-outline:hover { transform: none; }
  .category-card:hover { transform: none; }
  .brand-card:hover { transform: none; }

  /* Use :active instead */
  .product-card:active { border-color: var(--primary); }
  .btn:active { opacity: 0.85; }
  .category-card:active { background: rgba(232,119,34,0.08); }

  /* Smooth scroll iOS */
  .main-nav { -webkit-overflow-scrolling: touch; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .topbar, .main-header, .main-nav, .site-footer,
  .back-to-top, .toast-container, .hamburger,
  .mobile-overlay, .hero-slider, .ticker,
  .btn-add-cart, .product-actions-hover { display: none !important; }
  body { background: #fff; color: #111; }
  .container { max-width: 100%; padding: 0 12px; }
  .products-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .product-card { border: 1px solid #ddd; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* ============================================================
   SPECIFIC PAGE FIXES — CART
   ============================================================ */
@media (max-width: 768px) {
  /* Cart quantity stepper — bigger on mobile */
  .qty-stepper .qty-btn { width: 40px; height: 42px; font-size: 13px; }
  .qty-stepper input[type=number] { width: 48px; height: 42px; font-size: 14px; }

  /* Cart total summary stays clean */
  .summary-total { font-size: 16px; }
  .cart-remove-btn { width: 38px; height: 38px; font-size: 16px; }
}

/* ============================================================
   SPECIFIC PAGE FIXES — CHECKOUT
   ============================================================ */
@media (max-width: 768px) {
  .checkout-grid { grid-template-columns: 1fr !important; }
  .checkout-summary-box { position: static !important; top: auto !important; }
  .checkout-steps { padding: 0 0 12px; overflow-x: auto; }
}

/* ============================================================
   SPECIFIC PAGE FIXES — PRODUCTS / FILTERS
   ============================================================ */
@media (max-width: 768px) {
  .products-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .products-topbar .view-sort { width: 100%; justify-content: space-between; }
  .filter-toggle-btn { display: flex !important; }
  .sidebar { display: none; }
  .sidebar.show { display: block; position: fixed; top: 0; left: 0; width: 280px; max-width: 85vw; height: 100vh; z-index: 1002; overflow-y: auto; background: var(--white); box-shadow: 4px 0 20px rgba(0,0,0,0.15); padding: 20px 16px; }
}

/* ============================================================
   SPECIFIC PAGE FIXES — TRACK ORDER
   ============================================================ */
@media (max-width: 600px) {
  .track-timeline { padding-left: 12px; }
  .track-timeline-step { gap: 10px; }
  .track-timeline-icon { width: 32px; height: 32px; font-size: 13px; }
  .track-order-card { padding: 16px; }
}

/* ============================================================
   SPECIFIC PAGE FIXES — PRODUCT DETAIL
   ============================================================ */
@media (max-width: 600px) {
  .product-detail-grid { gap: 20px !important; }
  .size-btns, .color-btns { flex-wrap: wrap; gap: 6px; }
  .size-btn { padding: 7px 14px; font-size: 12px; }
  .product-qty-row { flex-wrap: wrap; gap: 10px; }
  .product-action-btns { flex-direction: column; }
  .product-action-btns .btn { width: 100%; justify-content: center; }
}

/* ============================================================
   SPECIFIC PAGE FIXES — WISHLIST
   ============================================================ */
@media (max-width: 600px) {
  .wishlist-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
@media (max-width: 360px) {
  .wishlist-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   SPECIFIC PAGE FIXES — ABOUT / CONTACT
   ============================================================ */
@media (max-width: 600px) {
  .about-grid { grid-template-columns: 1fr !important; }
  .contact-grid { grid-template-columns: 1fr !important; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* ============================================================
   NAV STICKY OFFSET FIX FOR ALL PAGES
   ============================================================ */
@media (max-width: 768px) {
  /* Nav is off-canvas, no sticky top offset needed for content */
  .main-nav {
    top: 0;
    position: fixed;
  }
  /* Breadcrumbs don't overlap header */
  .breadcrumb { position: relative; z-index: 1; }
}

/* ============================================================
   PROFILE PAGE — FULL RESPONSIVE
   ============================================================ */

/* Profile grid is declared inline in profile.php — override here */
.profile-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
}

/* Profile sidebar cards full-width on mobile */
@media (max-width: 600px) {
  .profile-grid { gap: 12px !important; }

  /* Profile avatar section */
  .profile-grid > div:first-child > div:first-child {
    padding: 20px 16px !important;
  }

  /* Quick links font size */
  .profile-grid a[style*="display:flex"] {
    padding: 12px 14px !important;
    font-size: 13px !important;
  }

  /* Forms */
  .profile-grid .form-row { grid-template-columns: 1fr !important; }
}

/* ============================================================
   ORDERS PAGE — FULL RESPONSIVE
   ============================================================ */

/* Order card header — wrap on smaller screens */
@media (max-width: 640px) {
  .order-card-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  /* Show order details inline on mobile */
  .order-card-header > div { min-width: unset !important; }

  /* Order meta row: group date+items+total horizontally */
  .order-card-header { display: grid !important; grid-template-columns: 1fr 1fr !important; row-gap: 10px !important; column-gap: 14px !important; }
  /* Order number takes full row */
  .order-card-header > div:first-child { grid-column: 1 / -1; }
  /* View button takes full row */
  .order-card-header > a { grid-column: 1 / -1; width: 100% !important; justify-content: center; text-align: center; }
}

@media (max-width: 480px) {
  /* Order progress bar labels */
  .order-card [style*="justify-content:space-between"] span { font-size: 10px !important; }

  /* Order detail items — stack image and text */
  .order-detail-card [style*="display:flex;gap:14px"] {
    flex-wrap: wrap;
    gap: 10px !important;
  }
}

/* Order info grid at bottom of order detail */
@media (max-width: 600px) {
  .order-info-grid { grid-template-columns: 1fr !important; }
  .order-info-box { border-right: none !important; border-bottom: 1px solid var(--dark-4) !important; padding: 16px !important; }
  .order-info-box:last-child { border-bottom: none !important; }
}

/* ============================================================
   CART PAGE — FULL RESPONSIVE
   ============================================================ */

/* On mobile, cart table becomes card stack */
@media (max-width: 540px) {
  /* Hide table headers entirely */
  .cart-items-col table thead { display: none; }

  /* Each row becomes a mini card */
  .cart-items-col table tbody tr {
    display: grid;
    grid-template-columns: 72px 1fr;
    grid-template-rows: auto auto;
    gap: 8px 12px;
    padding: 14px 12px;
    background: var(--dark-3);
    border: 1px solid var(--dark-4);
    border-radius: var(--radius-lg);
    margin-bottom: 10px;
    align-items: start;
  }

  /* Image cell — spans first column, both rows */
  .cart-items-col table tbody tr td:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / 3;
    padding: 0;
    border: none;
  }
  .cart-items-col table tbody tr td:nth-child(1) img {
    width: 64px !important;
    height: 64px !important;
    border-radius: var(--radius) !important;
  }

  /* Product name cell */
  .cart-items-col table tbody tr td:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    padding: 0;
    border: none;
  }

  /* Price cell (hidden on xs but show here in stacked layout) */
  .cart-items-col table tbody tr td:nth-child(3) {
    display: table-cell !important;  /* override hide rule */
    grid-column: 2;
    grid-row: 2;
    padding: 0;
    border: none;
    font-size: 13px;
  }

  /* Quantity cell */
  .cart-items-col table tbody tr td:nth-child(4) {
    grid-column: 1;
    grid-row: 3;
    padding: 0;
    border: none;
  }

  /* Item total */
  .cart-items-col table tbody tr td:nth-child(5) {
    grid-column: 2;
    grid-row: 3;
    padding: 0;
    border: none;
    font-size: 15px;
  }

  /* Remove button */
  .cart-items-col table tbody tr td:nth-child(6) {
    grid-column: 2;
    grid-row: 3;
    padding: 0;
    border: none;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }

  /* Remove all inherited table borders */
  .cart-items-col table tbody tr td { border-bottom: none !important; }

  /* Qty stepper smaller */
  .qty-stepper .qty-btn { width: 36px; height: 36px; }
  .qty-stepper input[type=number] { width: 40px; height: 36px; }

  /* Summary box padding */
  .cart-summary-box { padding: 18px 14px !important; }
  .summary-total { font-size: 17px !important; }
}

/* ============================================================
   CHECKOUT PAGE — FULL RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  /* Checkout summary box no longer sticky */
  .checkout-summary-box {
    position: static !important;
    top: auto !important;
  }

  /* Payment options side by side on tablet */
  .payment-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  /* Payment options single column on mobile */
  .payment-options { grid-template-columns: 1fr !important; }

  .payment-option { padding: 12px 12px !important; gap: 10px !important; }
  .payment-icon { width: 36px !important; height: 36px !important; font-size: 16px !important; }

  .checkout-section { padding: 16px 14px !important; }
  .checkout-section-title { font-size: 15px !important; margin-bottom: 14px !important; }

  /* Checkout summary items list smaller */
  .checkout-summary-box { padding: 16px 14px !important; }
}

/* ============================================================
   AUTH PAGES — FULL RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .auth-page { padding: 20px 10px !important; }
  .auth-card { border-radius: var(--radius-lg) !important; padding: 20px 14px !important; }
  .auth-divider { margin: 16px 0 !important; }
  .auth-footer-links { flex-direction: column !important; align-items: center !important; gap: 8px !important; }
  .input-icon-wrap i { font-size: 14px !important; }
}

/* ============================================================
   TRACK ORDER PAGE — FULL RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .track-hero { padding: 28px 0 !important; }
  .track-hero h1 { font-size: 26px !important; }
}

@media (max-width: 480px) {
  .track-order-result { padding: 16px !important; }
  .track-summary-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .track-progress-stages { flex-wrap: wrap; gap: 8px; justify-content: center; }
}

/* ============================================================
   WISHLIST PAGE — FULL RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  /* Wishlist header action bar */
  #wishlistGrid + * { flex-direction: column; gap: 10px; }
  
  /* Make "Add All to Cart" button full width on mobile */
  .wishlist-header-bar { flex-direction: column !important; align-items: flex-start !important; gap: 12px !important; }
  .wishlist-header-bar .btn { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .wishlist-item-wrap > .btn { font-size: 12px !important; padding: 9px 8px !important; }
}

/* ============================================================
   PRODUCTS PAGE — FULL RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .products-topbar { flex-direction: column !important; align-items: flex-start !important; }
  .products-topbar .view-sort { width: 100%; justify-content: space-between; }
}

@media (max-width: 480px) {
  .products-sort select { font-size: 13px; padding: 8px 10px; }
  .view-btn { width: 34px; height: 34px; font-size: 13px; }
}

/* ============================================================
   GENERAL INLINE STYLE OVERRIDES FOR MOBILE
   These handle inline styles used in PHP files
   ============================================================ */

/* Page top padding consistent */
@media (max-width: 600px) {
  .container[style*="padding-top:32px"] {
    padding-top: 20px !important;
    padding-bottom: 40px !important;
  }
}

/* H1 page titles smaller on mobile */
@media (max-width: 600px) {
  h1[style*="font-size:28px"] { font-size: 22px !important; }
  h2[style*="font-size:20px"] { font-size: 17px !important; }
  h3[style*="font-size:18px"] { font-size: 16px !important; }
}

/* Empty state boxes */
@media (max-width: 480px) {
  div[style*="padding:80px 20px"] { padding: 50px 16px !important; }
  div[style*="padding:80px 20px"] > div[style*="width:100px"] {
    width: 80px !important; height: 80px !important; font-size: 36px !important;
    margin-bottom: 16px !important;
  }
  div[style*="padding:80px 20px"] h3 { font-size: 20px !important; }
  div[style*="padding:80px 20px"] p { font-size: 13px !important; margin-bottom: 20px !important; }
}

/* Order success box */
@media (max-width: 480px) {
  div[style*="text-align:center;padding:28px"] { padding: 20px 14px !important; }
  div[style*="width:64px;height:64px"] { width: 52px !important; height: 52px !important; font-size: 22px !important; }
}

/* Free shipping progress bar */
@media (max-width: 480px) {
  div[style*="padding:14px 18px;margin-bottom:24px"] {
    padding: 12px 14px !important;
    margin-bottom: 16px !important;
  }
}

/* Profile stats card */
@media (max-width: 480px) {
  div[style*="flex-direction:column;gap:14px"] > div { padding-bottom: 10px !important; }
}
