/* GLOBAL */
* { font-family: 'Exo 2', Arial, sans-serif; letter-spacing: 0.5px; box-sizing:border-box; }
body { margin: 0; background: #fff; color: #111; }

/* HEADER BASE */
header {
  width: 100%;
  height: 80px;
  position: fixed;
  top: 0; left: 0;
  z-index: 20;
  background-color: #fff;
  display: flex;
  align-items: center;
  padding: 0 40px;
  box-sizing: border-box;
  border-bottom: 1px solid #eee;
  transition: border-color 0.3s ease;
}
header.scrolled { border-color: #ddd; }

/* LOGO */
.logo { float:left; flex-shrink: 0; }
.logo a {
  color: #06014a;
}
.logo img {float:left; width: 80px; height: auto;  }
.logo span {
  float:left;
  font-size: 20px;
  font-weight: 700;
  margin-top: 30px;
}

/* CENTER NAVIGATION */
.nav-container { flex: 1; display: flex; justify-content: center; }
.nav-left { display: flex; gap: 28px; list-style: none; padding: 0; margin: 0; }
.nav-left a {
  text-decoration: none; color: #111;
  font-weight: 500; text-transform: uppercase; font-size: 14px;
  position: relative;
}
.nav-left a::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 0%; height: 1px; background: #111; transition: width 0.3s ease;
}
.nav-left a:hover::after { width: 100%; }

/* RIGHT ICONS */
.nav-right { display: flex; align-items: center; gap: 20px; list-style: none; margin-left: auto; }
.nav-right a { text-decoration: none; color: #111; font-size: 18px; padding: 6px; transition: color 0.25s ease; }
.nav-right a:hover { color: #555; }
.nav-btn.logout {
  background-color: #111; color: #fff !important; padding: 8px 14px;
  border-radius: 4px; font-size: 13px; text-transform: uppercase;
}
.nav-btn.logout:hover { background-color: #333; }

/* HAMBURGER */
.hamburger { font-size: 26px; cursor: pointer; color: #111; padding: 8px; margin-left: 15px; }
@media (min-width: 901px) { .hamburger { display: none !important; } }

/* MOBILE NAV OVERLAY */
.mobile-overlay {
  position: fixed; inset: 0; background-color: rgba(0,0,0,0.45);
  z-index: 9998; display: none;
}
.mobile-overlay.show { display: block; }

/* MOBILE NAV PANEL */
.mobile-nav {
  position: fixed; top: 0; right: -100%;
  width: 260px; height: 100%; background-color: #111;
  z-index: 9999; transition: right 0.3s ease; padding-top: 80px; overflow-y: auto;
}
.mobile-nav.open { right: 0; }
.mobile-nav ul { list-style: none; padding: 0 20px; }
.mobile-nav ul li { margin: 18px 0; }
.mobile-nav a { color: #fff; text-decoration: none; font-weight: 500; display: block; padding: 10px; transition: color 0.25s ease; }
.mobile-nav a:hover { color: #ccc; }
.mobile-close { position: absolute; top: 20px; right: 20px; font-size: 28px; color: #fff; cursor: pointer; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .nav-container { display: none; }
  .nav-right { display: flex !important; }
  .hamburger { display: block !important; }
  .logo {  }
}

/* MEGA MENU */
.has-mega { position: relative; }
.mega-menu {
  position: absolute; top: 100%; left: 0; min-width: 220px; background: #fff;
  padding: 20px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); display: none; z-index: 999;
}
.mega-menu ul { list-style: none; padding: 0; margin: 0; }
.mega-menu ul li { margin-bottom: 10px; }
.mega-menu ul li a { color: #111; text-decoration: none; font-weight: 400; font-size: 13px; transition: color 0.2s ease; }
.mega-menu ul li a:hover { color: #000; }
.has-mega:hover .mega-menu { display: block; }

/* MOBILE ACCORDION */
.mobile-accordion .accordion-item { border-bottom: 1px solid rgba(255,255,255,0.1); }
.accordion-header { padding: 12px 10px; color: #fff; font-weight: 500; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.accordion-header .arrow { font-size: 18px; }
.accordion-content { display: none; padding-left: 15px; }
.accordion-content li { margin: 10px 0; }
.accordion-content a { color: #fff; font-weight: 400; text-decoration: none; font-size: 13px; }

/* 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;
}
/* 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; }
.btn-primary {
  display: inline-block; width: 100%; padding: 12px; background: #111; color: #fff; border: none; border-radius: 4px; font-size: 15px; cursor: pointer; text-align: center;
}
.btn-primary:hover { background: #333; }

/* CART BADGE */
.cart-icon { position: relative; display: inline-block; }
.cart-count {
  position: absolute; top: -6px; right: -8px; background-color: #91042c; color: #fff;
  font-size: 11px; font-weight: 500; padding: 2px 6px; border-radius: 50%; min-width: 18px; text-align: center; line-height: 1.2; border: 1px solid #fff;
}

/* 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;
}