* {
  font-family: 'Exo 2', Arial, sans-serif;
  box-sizing: border-box;
}

body {
  margin: 0;
}

/* Header Styles */
header {
  background: linear-gradient(135deg, #1a2a6c 0%, #2a4a7c 50%, #3d6ea0 100%);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: all 0.3s ease;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 80px;
}

/* Logo - Updated */
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo img {
  transition: transform 0.3s ease;
  height: 50px;
  width: auto;
}

.logo:hover img {
  transform: scale(1.05);
}

/* Main Navigation */
.main-nav {
  display: block;
}

.main-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 30px;
}

.main-nav ul li {
  float: left;
}

/* Mega Menu Styles */
.has-mega {
  position: relative;
}

.mega-menu {
  position: absolute;
  top: 100%;
  left: 0; /* Changed from 50% to 0 */
  transform: translateY(10px); /* Removed translateX */
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  padding: 10px 0;
}

.has-mega:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0); /* Removed translateX */
}

/* Optional: If you want the menu to align to the right for the last few items */
.main-nav ul li:last-child .mega-menu,
.main-nav ul li:nth-last-child(2) .mega-menu {
  left: auto;
  right: 0;
}

.mega-menu ul {
  display: flex;
  flex-direction: column;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mega-menu ul li {
  width: 100%;
  margin: 0;
}

.mega-menu ul li a {
  display: block;
  padding: 10px 20px;
  color: #333;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.mega-menu ul li a:hover {
  background: #f5f5f5;
  color: #ff6b35;
  padding-left: 25px;
}

/* Add a small arrow indicator for categories with subcategories */
.has-mega > a::after {
  content: '▼';
  font-size: 0.7rem;
  margin-left: 5px;
  display: inline-block;
  transition: transform 0.3s ease;
}

.has-mega:hover > a::after {
  transform: rotate(180deg);
}

/* Ensure the main navigation li doesn't overflow */
.main-nav ul li {
  position: relative;
}

.has-mega {
  position: relative;
}

/* Add a small triangle/arrow on top of the mega menu */
.mega-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 20px;
  width: 12px;
  height: 12px;
  background: white;
  transform: rotate(45deg);
  box-shadow: -2px -2px 5px rgba(0, 0, 0, 0.04);
}

/* Adjust the arrow position for right-aligned menus */
.main-nav ul li:last-child .mega-menu::before,
.main-nav ul li:nth-last-child(2) .mega-menu::before {
  left: auto;
  right: 20px;
}


/* CART SIDEBAR */
.cart-sidebar {
  position: fixed; top: 0; right: -400px; width: 400px; height: 100%;
  background: #fff; box-shadow: -2px 0 8px rgba(0,0,0,0.1); transition: right 0.3s ease; z-index: 10000;
  display: flex; flex-direction: column; border-left: 1px solid #eee;
}
.cart-sidebar.open { right: 0; }
.cart-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid #eee; font-weight: 500; font-size: 16px; background: #fafafa; }
.close-cart { cursor: pointer; font-size: 20px; color: #666; }
.close-cart:hover { color: #000; }
.cart-items-head { flex: 1; overflow-y: auto; padding: 16px; }
.cart-item { display: flex; align-items: flex-start; margin-bottom: 16px; border-bottom: 1px solid #f0f0f0; padding-bottom: 12px; }
.cart-item img { width: 50px; height: 50px; object-fit: cover; border-radius: 4px; margin-right: 12px; }
.cart-item p { margin: 0; font-size: 14px; font-weight: 500; }
.cart-item small { display: block; color: #888; margin: 4px 0; font-size: 12px; }
.empty-cart { text-align: center; color: #888; font-size: 0.95rem; margin: 20px 0; font-style: italic; width: 100%; }

.cart-footer { padding: 16px; border-top: 1px solid #ddd; background: #fafafa; }
.cart-footer .total { display: flex; justify-content: space-between; font-weight: 600; font-size: 16px; margin-bottom: 12px; }
/* Responsive adjustments */
@media only screen and (max-width: 1024px) {
  .mega-menu {
    min-width: 200px;
  }
  
  .mega-menu ul li a {
    white-space: normal;
    word-wrap: break-word;
  }
}

.nav-link {
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 8px 16px;
  border-radius: 25px;
  transition: all 0.3s ease;
  position: relative;
  display: block;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.15);
  color: #ff6b35;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: #ff6b35;
  border-radius: 50%;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Search Box */
.search-box {
  display: flex;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 25px;
  padding: 5px;
  backdrop-filter: blur(10px);
}

.search-input {
  background: transparent;
  border: none;
  color: white;
  padding: 8px 15px;
  width: 200px;
  outline: none;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.search-btn {
  background: #ff6b35;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn:hover {
  background: #e55a2b;
  transform: scale(1.05);
}
/* SEARCH OVERLAY */
.search-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65);
  display: none; z-index: 10002; justify-content: flex-start; align-items: center; flex-direction: column; padding-top: 120px;
}
.search-box { position: relative; width: 80%; max-width: 600px; }
.search-box input { width: 100%; padding: 16px 18px; font-size: 16px; border: 1px solid #ddd; border-radius: 4px; outline: none; }
.close-search { position: absolute; right: 15px; top: 12px; font-size: 26px; cursor: pointer; color: #333; }
.search-results {
  margin-top: 20px; width: 80%; max-width: 600px; background: #fff;
  border: 1px solid #eee; border-radius: 4px; padding: 15px; max-height: 400px; overflow-y: auto; 
}
.search-result-item {
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
}

.search-result-item a {
  text-decoration: none;
  color: #333;
  display: block;
}

.search-result-item:hover {
  background: #f5f5f5;
}

.no-results {
  padding: 12px;
  color: #777;
  text-align: center;
}
/* Header Icons */
.header-icons {
  display: flex;
  gap: 15px;
}

.icon-link {
  color: white;
  text-decoration: none;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.icon-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ff6b35;
}

.cart-icon {
  position: relative;
}

.cart-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ff6b35;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 10px;
  transition: color 0.3s ease;
}

.mobile-menu-btn:hover {
  color: #ff6b35;
}

/* Mobile Navigation */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 320px;
  height: 100vh;
  background: white;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
  transition: right 0.4s ease;
  z-index: 1001;
}

.mobile-nav.active {
  right: 0;
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
  background: #2a4a7c;
  color: white;
}

.mobile-nav-title {
  font-size: 1.2rem;
  font-weight: 600;
}

.mobile-nav-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
  transition: color 0.3s ease;
}

.mobile-nav-close:hover {
  color: #ff6b35;
}

.mobile-nav-content {
  padding: 20px;
}

.mobile-nav-content ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-nav-link {
  display: block;
  padding: 15px 0;
  color: #333;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid #eee;
  transition: color 0.3s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: #2a4a7c;
}

.mobile-nav-actions {
  margin-top: 30px;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

.mobile-action-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.mobile-action-link:hover {
  color: #2a4a7c;
}

/* Responsive Design */
@media only screen and (max-width: 1024px) {
  .main-nav {
    display: none;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .search-input {
    width: 150px;
  }
}

@media only screen and (max-width: 768px) {
  .header-container {
    padding: 0 15px;
    height: 70px;
  }
  
  .logo img {
    height: 40px;
  }
  
  .search-box {
    display: none;
  }
  
  .header-actions {
    gap: 10px;
  }
}

@media only screen and (max-width: 480px) {
  .mobile-nav {
    width: 100%;
  }
  
  .logo img {
    height: 35px;
  }
}




/* VARIANT MODAL - Responsive */
.variant-modal {
  display: none;
  position: fixed;
  z-index: 10001;
  inset: 0;
  background: rgba(0,0,0,0.6);
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
}

.variant-content {
  background: #fff;
  width: 90%;
  max-width: 900px;
  margin: 20px auto;
  padding: 20px;
  border-radius: 12px;
  position: relative;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.close-variant {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.close-variant:hover {
  background: #f0f0f0;
}

.variant-body {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
}

/* LEFT: Images */
.variant-images {
  flex: 1;
  min-width: 300px;
  padding-right: 20px;
}

.main-image {
  width: 100%;
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
}

#variantMainImage {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  display: block;
}

.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.thumbs img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.thumbs img:hover {
  transform: scale(1.05);
  border-color: #007bff;
}

.thumbs img.active {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.2);
}

/* RIGHT: Info + Options */
.variant-info {
  flex: 1;
  min-width: 280px;
  padding-left: 20px;
  border-left: 1px solid #eee;
}

#variantTitle {
  margin: 0 0 10px 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
}

#variantPrice {
  font-size: 22px;
  font-weight: 700;
  color: #007bff;
  margin-bottom: 20px;
}

/* Form elements */
.variant-info label {
  display: block;
  margin-top: 20px;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 15px;
  color: #333;
}

.variant-info select, 
.variant-info input[type="number"] {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 15px;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.variant-info select:focus,
.variant-info input[type="number"]:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

/* Color Swatches */
.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.color-swatches .swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  margin: 0;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.color-swatches .swatch:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.2);
}

.color-swatches .swatch.active {
  border: 3px solid #000;
  box-shadow: 0 0 0 2px #007bff;
  transform: scale(1.05);
}

/* Size Buttons */
.size-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.size-buttons .size-btn {
  padding: 10px 18px;
  margin: 0;
  cursor: pointer;
  border: 2px solid #e0e0e0;
  background: #fff;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s ease;
  min-width: 50px;
  text-align: center;
}

.size-buttons .size-btn:hover {
  background: #f5f5f5;
  border-color: #999;
}

.size-buttons .size-btn.active {
  border: 2px solid #007bff;
  background: #007bff;
  color: #fff;
}

/* Form actions */
#variantForm {
  margin-top: 25px;
}

#variantQuantity {
  width: 100px;
  margin-bottom: 15px;
}



/* Tablet Responsive */
@media screen and (max-width: 768px) {
  .variant-content {
    width: 95%;
    padding: 15px;
    margin: 10px auto;
  }
  
  .variant-body {
    flex-direction: column;
    gap: 15px;
  }
  
  .variant-images {
    min-width: 100%;
    padding-right: 0;
  }
  
  .variant-info {
    min-width: 100%;
    padding-left: 0;
    border-left: none;
    border-top: 1px solid #eee;
    padding-top: 20px;
  }
  
  #variantMainImage {
    max-height: 350px;
  }
  
  .thumbs img {
    width: 60px;
    height: 60px;
  }
  
  #variantTitle {
    font-size: 22px;
  }
  
  #variantPrice {
    font-size: 20px;
  }
}

/* Mobile Responsive */
@media screen and (max-width: 480px) {
  .variant-modal {
    padding: 10px;
  }
  
  .variant-content {
    width: 100%;
    padding: 15px 12px;
    margin: 0;
    border-radius: 16px;
  }
  
  .close-variant {
    top: 10px;
    right: 15px;
    width: 35px;
    height: 35px;
    font-size: 24px;
  }
  
  #variantMainImage {
    max-height: 250px;
  }
  
  .thumbs {
    justify-content: center;
    gap: 6px;
  }
  
  .thumbs img {
    width: 50px;
    height: 50px;
  }
  
  .color-swatches .swatch {
    width: 35px;
    height: 35px;
  }
  
  .size-buttons .size-btn {
    padding: 8px 14px;
    font-size: 14px;
    min-width: 45px;
  }
  
  #variantTitle {
    font-size: 20px;
  }
  
  #variantPrice {
    font-size: 18px;
  }
  
  .variant-info label {
    margin-top: 15px;
    font-size: 14px;
  }
  
  .btn-primary {
    padding: 14px;
    font-size: 15px;
  }
  
  #variantQuantity {
    width: 100%;
    margin-bottom: 15px;
  }
}

/* Small Mobile */
@media screen and (max-width: 360px) {
  .variant-content {
    padding: 12px 10px;
  }
  
  .thumbs img {
    width: 45px;
    height: 45px;
  }
  
  .color-swatches .swatch {
    width: 30px;
    height: 30px;
  }
  
  .size-buttons .size-btn {
    padding: 6px 10px;
    font-size: 13px;
    min-width: 40px;
  }
  
  #variantTitle {
    font-size: 18px;
  }
  
  .btn-primary {
    padding: 12px;
    font-size: 14px;
  }
}

/* Landscape orientation on mobile */
@media screen and (max-width: 768px) and (orientation: landscape) {
  .variant-content {
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .variant-body {
    flex-direction: row;
  }
  
  .variant-images,
  .variant-info {
    min-width: 45%;
  }
  
  #variantMainImage {
    max-height: 200px;
  }
  
  .thumbs img {
    width: 45px;
    height: 45px;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  .size-buttons .size-btn,
  .color-swatches .swatch,
  .thumbs img,
  .btn-primary {
    cursor: default;
    -webkit-tap-highlight-color: transparent;
  }
  
  .size-buttons .size-btn:active,
  .color-swatches .swatch:active {
    transform: scale(0.95);
  }
}

/* Loading state (optional) */
.variant-modal.loading .variant-content {
  opacity: 0.7;
  pointer-events: none;
}

.variant-modal.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 10000;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* CART OVERLAY */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px); /* Optional: adds blur effect */
  z-index: 9999; /* Just below the cart sidebar (which is 9999) */
  display: none;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.cart-overlay.show {
  display: block;
  opacity: 1;
}

/* Optional: Add animation for the overlay */
@keyframes overlayFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.cart-overlay.show {
  animation: overlayFadeIn 0.3s ease forwards;
}