/* ==========================================================================
   TULIP BEAUTY MARKETPLACE - REFACTORED RESPONSIVE STYLES (responsive.css)
   Consolidated Breakpoints: 320px to 1920px+
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. BASE MOBILE ELEMENTS & NAVIGATION DRAWER
   -------------------------------------------------------------------------- */

/* Fixed Bottom Navigation Bar (100% Full Width Edge-To-Edge, Highest Priority Z-Index) */
.mobile-bottom-nav {
  display: none;
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100vw !important;
  margin: 0 !important;
  padding: 0 0 env(safe-area-inset-bottom) 0 !important;
  height: calc(60px + env(safe-area-inset-bottom)) !important;
  background-color: #FFFFFF !important;
  border-top: 1px solid #E2E8F0 !important;
  z-index: 999999 !important; /* Highest z-index so it never hides under content */
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08) !important;
}

/* Hide bottom nav on PDP page when sticky PDP bar is present */
body.pdp-page .mobile-bottom-nav {
  display: none !important;
}

.mobile-bottom-nav-inner {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  height: 60px !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.mobile-nav-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  color: var(--tulip-secondary) !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  height: 100% !important;
  width: 100% !important;
}

.mobile-nav-item i {
  font-size: 1.25rem !important;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
  color: var(--tulip-primary) !important;
}

/* Mobile Slide-Over Navigation Drawer */
.mobile-drawer-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.55);
  z-index: var(--z-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mobile-drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: min(320px, 85vw);
  background-color: var(--tulip-bg);
  z-index: var(--z-drawer);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--tulip-shadow-lg);
}

.mobile-drawer.is-open {
  transform: translateX(0);
}

.mobile-drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--tulip-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--tulip-primary-light);
}

.mobile-drawer-title {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--tulip-primary);
  letter-spacing: 1px;
}

.mobile-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.mobile-cat-list {
  list-style: none;
}

.mobile-cat-item {
  border-bottom: 1px solid var(--tulip-border-light);
}

.mobile-cat-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--tulip-dark);
  min-height: 48px;
}

.mobile-cat-sublist {
  background-color: var(--tulip-bg-soft);
  list-style: none;
  display: none;
  padding: 8px 0;
}

.mobile-cat-sublist.is-open {
  display: block;
}

.mobile-cat-sublist a {
  display: block;
  padding: 10px 32px;
  font-size: 0.88rem;
  color: var(--tulip-secondary);
}

/* Mobile Search Toolbar Below Main Header */
.mobile-search-bar-wrap {
  display: none;
  padding: 8px 16px;
  background-color: var(--tulip-bg);
  border-bottom: 1px solid var(--tulip-border-light);
}

/* Sticky Mobile Filter Toolbar for PLP */
.mobile-filter-toolbar {
  display: none;
  position: sticky;
  top: 56px;
  z-index: var(--z-sticky);
  background-color: var(--tulip-bg);
  border-bottom: 1px solid var(--tulip-border);
  grid-template-columns: 1fr 1fr;
  box-shadow: var(--tulip-shadow-sm);
}

.mobile-filter-btn {
  padding: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--tulip-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-right: 1px solid var(--tulip-border);
  min-height: 44px;
}

.mobile-filter-btn:last-child {
  border-right: none;
}

/* Sticky Mobile Purchase Bar for PDP */
.mobile-sticky-pdp-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--tulip-bg);
  border-top: 1px solid var(--tulip-border);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  z-index: var(--z-sticky);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
}

.mobile-sticky-pdp-bar .btn-add-to-bag {
  padding: 12px;
  font-size: 0.95rem;
  min-height: 48px;
}


/* --------------------------------------------------------------------------
   2. BREAKPOINT GROUPS
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   LARGE DESKTOP (1600px+)
   -------------------------------------------------------------------------- */
@media (min-width: 1600px) {
  :root {
    --tulip-container-max: 1360px;
    --container-padding: 32px;
  }
  .product-grid { grid-template-columns: repeat(5, 1fr); }
  .top-category-grid { grid-template-columns: repeat(6, 1fr); }
  
  .product-slider-track .product-card {
    flex: 0 0 calc((100% - (4 * 16px)) / 5);
    min-width: calc((100% - (4 * 16px)) / 5);
    max-width: calc((100% - (4 * 16px)) / 5);
  }
}

/* --------------------------------------------------------------------------
   STANDARD DESKTOP (1440px – 1599px)
   -------------------------------------------------------------------------- */
@media (min-width: 1440px) and (max-width: 1599px) {
  :root {
    --tulip-container-max: 1280px;
    --container-padding: 24px;
  }
  .product-grid { grid-template-columns: repeat(5, 1fr); }
  .top-category-grid { grid-template-columns: repeat(6, 1fr); }
  
  .product-slider-track .product-card {
    flex: 0 0 calc((100% - (4 * 16px)) / 5);
    min-width: calc((100% - (4 * 16px)) / 5);
    max-width: calc((100% - (4 * 16px)) / 5);
  }
}

/* --------------------------------------------------------------------------
   DESKTOP (1280px – 1439px)
   -------------------------------------------------------------------------- */
@media (min-width: 1280px) and (max-width: 1439px) {
  :root {
    --container-padding: 24px;
  }
  .product-grid { grid-template-columns: repeat(4, 1fr); }
  .top-category-grid { grid-template-columns: repeat(6, 1fr); }
  
  .product-slider-track .product-card {
    flex: 0 0 calc((100% - (3 * 16px)) / 4);
    min-width: calc((100% - (3 * 16px)) / 4);
    max-width: calc((100% - (3 * 16px)) / 4);
  }
}

/* --------------------------------------------------------------------------
   SMALL DESKTOP / LAPTOP (1024px – 1279px)
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) and (max-width: 1279px) {
  :root {
    --container-padding: 20px;
  }
  .brand-logo { font-size: 1.6rem; }
  .main-nav-links { gap: 14px; }
  .main-nav-links a { font-size: 0.88rem; }
  .header-search-wrap { width: 260px; }
  .category-nav-list { gap: 16px; }
  .category-nav-link { font-size: 0.84rem; padding: 10px 2px; }
  
  .product-grid { grid-template-columns: repeat(4, 1fr); }
  .top-category-grid { grid-template-columns: repeat(6, 1fr); }
  .editorial-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: repeat(5, 1fr); gap: 20px; }

  .product-slider-track .product-card {
    flex: 0 0 calc((100% - (3 * 16px)) / 4);
    min-width: calc((100% - (3 * 16px)) / 4);
    max-width: calc((100% - (3 * 16px)) / 4);
  }
}

/* --------------------------------------------------------------------------
   TABLET PORTRAIT & LANDSCAPE (768px – 1023px)
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  :root {
    --container-padding: 18px;
    --tulip-header-height: 64px;
  }
  
  /* Header Adjustments */
  .top-promo-bar { font-size: 0.78rem; }
  .promo-right { display: none; }
  .main-nav-links { display: none; }
  .category-navbar { display: none; }
  .btn-mobile-menu-trigger { display: flex; }
  
  .header-search-wrap { width: 240px; }
  .brand-logo { font-size: 1.5rem; }
  
  /* Grid Adaptations */
  .top-category-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .offer-banners-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .editorial-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .trust-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .footer-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }

  .product-slider-track .product-card {
    flex: 0 0 calc((100% - (2 * 14px)) / 3);
    min-width: calc((100% - (2 * 14px)) / 3);
    max-width: calc((100% - (2 * 14px)) / 3);
  }
  
  /* Hero Carousel Tablet */
  .hero-carousel-wrap { height: 360px; }
  .hero-overlay { padding: 0 32px; }
  .hero-title { font-size: 2rem; }
  .hero-subtitle { font-size: 0.95rem; margin-bottom: 16px; }
  .btn-hero-cta { padding: 10px 20px; font-size: 0.85rem; }
  
  /* PLP 3 Columns Tablet */
  .products-page-layout { grid-template-columns: 200px 1fr !important; }
  
  /* Account Layout Tablet/Mobile Fix */
  .account-layout { grid-template-columns: 1fr !important; gap: 0 !important; }
  .account-sidebar-desktop { display: none !important; }
  .mobile-account-profile-header { display: flex !important; }
  .mobile-account-nav-section { display: block !important; }
}

/* --------------------------------------------------------------------------
   MOBILE SCREENS (PHABLETS & PHONES: 0px – 767px)
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  :root {
    --container-padding: 16px;
    --tulip-header-height: 56px;
  }
  
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  
  .top-promo-bar { height: 30px; font-size: 0.75rem; }
  .promo-bar-content { justify-content: center; }
  .promo-right { display: none; }
  
  .main-header { height: 56px; }
  .header-inner { gap: 10px; }
  .brand-logo { font-size: 1.35rem; }
  .header-search-wrap { display: none; }
  .header-action-text { display: none; }
  
  .mobile-bottom-nav { display: block; }
  .mobile-search-bar-wrap { display: block; }
  .mobile-greeting-pill { display: flex !important; }
  
  /* Account Layout Mobile Fix */
  .account-layout { grid-template-columns: 1fr !important; gap: 0 !important; }
  .account-sidebar-desktop { display: none !important; }
  .mobile-account-profile-header { display: flex !important; }
  .mobile-account-nav-section { display: block !important; }
  .account-fields-grid { grid-template-columns: 1fr !important; gap: 14px !important; }
  
  /* Nykaa / Tira Hero Cards Mobile Swipe Track */
  .nykaa-hero-track {
    gap: 12px !important;
    padding-bottom: 4px !important;
  }
  .nykaa-hero-card {
    flex: 0 0 280px !important;
    min-width: 280px !important;
    height: 320px !important;
    border-radius: 16px !important;
  }
  .nykaa-carousel-next-btn {
    display: none !important;
  }
  
  /* Headings */
  .section-padding { padding: 20px 0; }
  .section-title { font-size: 1.15rem; }
  .section-view-all { font-size: 0.8rem; }
  
  /* Category Horizontal Scroll Track on Mobile (Tira App Style) */
  .top-category-grid,
  .top-category-scroll-track { 
    display: flex !important; 
    overflow-x: auto !important; 
    gap: 14px !important; 
    padding-bottom: 8px !important; 
    scrollbar-width: none !important; 
  }
  .top-category-grid::-webkit-scrollbar,
  .top-category-scroll-track::-webkit-scrollbar { display: none; }
  .country-cat-item { 
    flex: 0 0 110px !important; 
    min-width: 110px !important; 
    max-width: 110px !important;
  }
  .country-cat-img-box {
    width: 110px !important;
    height: 130px !important;
    aspect-ratio: auto !important;
  }
  
  /* Product Grid 2 Columns Compact */
  .product-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .product-card-media { width: 100% !important; height: 0 !important; padding-top: 100% !important; position: relative !important; }
  .product-card-body { padding: 8px; }
  .product-brand { font-size: 0.68rem; }
  .product-name { font-size: 0.78rem; height: 2.4em; }
  .price-selling { font-size: 0.9rem; }
  .price-mrp { font-size: 0.75rem; }
  .price-discount { font-size: 0.75rem; }

  /* Mobile Track Items */
  .product-slider-track .product-card {
    flex: 0 0 calc((100% - 10px) / 2);
    min-width: calc((100% - 10px) / 2);
    max-width: calc((100% - 10px) / 2);
  }
  
  /* Banners & Editorial Mobile */
  .offer-banners-grid { grid-template-columns: 1fr; gap: 12px; }
  .offer-banner-card { aspect-ratio: 21/9; padding: 14px; }
  .offer-banner-title { font-size: 1rem; }
  .offer-banner-discount { font-size: 0.88rem; }
  
  .editorial-grid { grid-template-columns: 1fr; gap: 12px; }
  
  /* Trust & Newsletter */
  .trust-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .trust-icon { width: 36px; height: 36px; font-size: 1.1rem; }
  .trust-text h4 { font-size: 0.85rem; }
  .trust-text p { font-size: 0.75rem; }
  
  .newsletter-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .newsletter-text h3 { font-size: 1.2rem; }
  .newsletter-form { flex-direction: column; max-width: 100%; }
  .btn-subscribe { width: 100%; }
  
  /* Footer Mobile */
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .footer-bottom { flex-direction: column; gap: 10px; align-items: flex-start; }
  
  /* PLP Filter Sidebar & Mobile Toolbar */
  .plp-sidebar-desktop { display: none !important; }
  .plp-main-layout { grid-template-columns: 1fr !important; }
  .mobile-filter-toolbar { display: grid; }
  
  /* PDP Stacked Layout */
  .pdp-main-layout { grid-template-columns: 1fr !important; gap: 24px !important; }
  .pdp-gallery-wrap { flex-direction: column-reverse !important; }
  .pdp-thumbs-col { flex-direction: row !important; overflow-x: auto; }
  .mobile-sticky-pdp-bar { display: block; }
  
  /* Cart Page Table to Cards */
  .cart-layout { grid-template-columns: 1fr !important; }
  
  /* Checkout Stepper & Form */
  .checkout-stepper-row { flex-direction: column; gap: 8px; align-items: flex-start; }
  .form-grid-2col { grid-template-columns: 1fr !important; }
}

/* --------------------------------------------------------------------------
   SMALL MOBILE SCREENS (320px – 359px)
   -------------------------------------------------------------------------- */
@media (max-width: 359px) {
  :root {
    --container-padding: 10px;
  }
  
  .brand-logo { font-size: 1.2rem; }
  .header-actions { gap: 10px; }
  .hero-title { font-size: 1.15rem; }
  .top-category-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  
  .product-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  .product-card-body { padding: 6px; }
  .product-name { font-size: 0.75rem; }
  .price-selling { font-size: 0.85rem; }
  .price-mrp { font-size: 0.7rem; }
  .price-discount { font-size: 0.7rem; width: 100%; }
  
  .footer-grid { grid-template-columns: 1fr; }
}
