/* ==========================================================================
   ULTRA-PREMIUM FASHION E-COMMERCE DESIGN SYSTEM & LAYOUT FIX
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #e0e7ff;
  --secondary: #ec4899;
  --accent: #f59e0b;
  --dark: #0f172a;
  --dark-surface: #1e293b;
  --light-bg: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.03);
  --shadow-md: 0 10px 30px rgba(0,0,0,0.06);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.12);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-main: 'Plus Jakarta Sans', sans-serif;
  --font-heading: 'Outfit', sans-serif;
}

/* Base Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--light-bg);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  padding-bottom: 70px;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Full-Width Section Wrappers & Centered Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Top Announcement Bar - Full Width Bleed */
.top-bar {
  width: 100%;
  background: linear-gradient(90deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  color: #f1f5f9;
  font-size: 0.85rem;
  padding: 10px 0;
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.top-bar strong {
  color: #f43f5e;
  font-weight: 700;
}

/* Glassmorphic Navbar - Full Width Bleed */
.navbar {
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  padding: 14px 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.7rem;
  color: var(--dark);
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.nav-categories {
  display: flex;
  align-items: center;
  gap: 16px;
  list-style: none;
}

.nav-item {
  position: relative;
}

.nav-link {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--dark);
  padding: 8px 14px;
  border-radius: 50px;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* Mega Dropdown */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 220px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 10px 0;
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 100;
  list-style: none;
  border: 1px solid var(--border-color);
}
.nav-item:hover .dropdown-menu {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
.dropdown-item a {
  display: block;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}
.dropdown-item a:hover {
  background: var(--light-bg);
  color: var(--primary);
  padding-left: 24px;
}

/* Search Field */
.search-form {
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 50px;
  padding: 4px 6px 4px 18px;
  width: 320px;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.search-form:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}
.search-input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 0.9rem;
}
.search-btn {
  background: var(--primary);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark);
  font-size: 1.15rem;
  transition: var(--transition);
}
.icon-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-light);
}

.badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--secondary);
  color: white;
  font-size: 0.75rem;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  padding: 10px 0;
  z-index: 1000;
  justify-content: space-around;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
}
.mobile-nav-item {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
}
.mobile-nav-item i {
  font-size: 1.3rem;
  display: block;
  margin-bottom: 2px;
}
.mobile-nav-item.active {
  color: var(--primary);
}

/* Premium Hero Section */
.hero-section {
  width: 100%;
  margin-top: 24px;
  margin-bottom: 40px;
}

.hero-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #4338ca 100%);
  border-radius: var(--radius-lg);
  color: white;
  padding: 50px 44px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  width: 100%;
}

.hero-content h1 {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.hero-content p {
  font-size: 1.05rem;
  opacity: 0.9;
  margin-bottom: 26px;
  font-weight: 400;
  line-height: 1.6;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #ec4899 0%, #d946ef 100%);
  color: white;
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(236, 72, 153, 0.4);
  transition: var(--transition);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(236, 72, 153, 0.6);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--dark);
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 700;
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* Category Grid */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  width: 100%;
}
.section-title h2 {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--dark);
  letter-spacing: -0.5px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 50px;
  width: 100%;
}

.category-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  display: block;
}
.category-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.category-card .icon-wrap {
  width: 64px;
  height: 64px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 1.8rem;
}
.category-card h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--dark);
}

/* Flash Sale Banner */
.flash-sale-box {
  width: 100%;
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
  border: 2px dashed #f43f5e;
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 50px;
}
.timer-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-family: monospace;
}
.time-box {
  background: #be123c;
  color: white;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
  width: 100%;
}

.product-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  position: relative;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  width: 100%;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: rgba(79, 70, 229, 0.4);
}

.product-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4/5;
  overflow: hidden;
  background: #f1f5f9;
  display: block;
}
.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.product-card:hover .product-thumb img {
  transform: scale(1.06);
}

.badge-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: white;
  z-index: 10;
}
.badge-offer { background: #be123c; }
.badge-featured { background: #7c3aed; }
.badge-new { background: #059669; }

.wishlist-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: var(--transition);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.wishlist-btn:hover, .wishlist-btn.active {
  color: #ef4444;
  background: white;
  transform: scale(1.1);
}

.product-info {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.product-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.product-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--dark);
  margin-bottom: 10px;
  line-clamp: 2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.price-box {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
  margin-bottom: 14px;
}
.current-price {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--primary);
}
.original-price {
  font-size: 0.9rem;
  text-decoration: line-through;
  color: var(--text-muted);
}

.add-cart-btn {
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.add-cart-btn:hover {
  background: var(--primary);
  color: white;
}

/* FIX MODAL OVERLAY POPUP */
.popup-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(15, 23, 42, 0.75) !important;
  backdrop-filter: blur(8px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 99999 !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.popup-overlay.active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.popup-content {
  background: white;
  width: 90%;
  max-width: 480px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  transform: scale(0.85);
  transition: var(--transition);
  box-shadow: var(--shadow-lg);
}

.popup-overlay.active .popup-content {
  transform: scale(1);
}

.popup-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-body {
  padding: 30px 24px;
  text-align: center;
}

.popup-body img {
  width: 100%;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  max-height: 200px;
  object-fit: cover;
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast-msg {
  background: var(--dark);
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid var(--primary);
}

/* Product Detail Page Layout */
.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin: 30px 0 50px;
  width: 100%;
}

.gallery-main {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: white;
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
}
.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumbs {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.thumb-item {
  width: 75px;
  height: 75px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
}
.thumb-item.active {
  border-color: var(--primary);
}
.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.option-title {
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.color-swatches {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}
.color-option {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}
.color-option.selected {
  border-color: var(--primary);
  transform: scale(1.15);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.size-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.size-btn {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: white;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.size-btn:hover, .size-btn.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}
.size-btn.out-of-stock {
  opacity: 0.4;
  text-decoration: line-through;
  cursor: not-allowed;
  background: #f1f5f9;
}

/* Footer Full Width */
footer {
  width: 100%;
  background: var(--dark);
  color: #94a3b8;
  padding: 60px 0 30px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h4 {
  font-family: var(--font-heading);
  color: white;
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 20px;
}

.footer-links {
  list-style: none;
}
.footer-links li {
  margin-bottom: 12px;
}
.footer-links a:hover {
  color: white;
}

.copyright {
  border-top: 1px solid var(--dark-surface);
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
}

/* Responsive Page Layouts */
.shop-layout-grid { display: grid; grid-template-columns: 260px 1fr; gap: 30px; }
.checkout-layout-grid { display: grid; grid-template-columns: 1fr 380px; gap: 30px; }
.reviews-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* Responsive Overrides */
@media (max-width: 992px) {
  .hero-banner { grid-template-columns: 1fr; padding: 36px 24px; text-align: center; }
  .hero-content h1 { font-size: 2.2rem; }
  .product-detail-layout, .shop-layout-grid, .checkout-layout-grid, .reviews-grid { grid-template-columns: 1fr; }
  .nav-categories { display: none; }
  .mobile-bottom-nav { display: flex; }
}

@media (max-width: 600px) {
  .search-form { display: none; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .product-info { padding: 12px; }
  .product-title { font-size: 0.95rem; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; gap: 12px; }
}
