/* =========================
   GLOBAL STYLES
========================= */
:root {
  --primary-bg: #f4e1e1;
  --dark-bg: #1e1e1e;
  --accent: #ffc9e3;
  --light: #ffffff;
  --text-dark: #333;
  --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--primary-bg);
  color: var(--text-dark);
  line-height: 1.6;
}

/* =========================
   HEADER & NAV
========================= */
header {
  background: var(--dark-bg);
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1000;
}

.logo a {
  color: var(--light);
  font-size: 1.4rem;
  font-weight: bold;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 25px;
  margin-left: auto;
  align-items: center;
}

.nav-links a {
  color: var(--light);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  position: relative;
  transition: 0.3s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: 0.3s;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a.active {
  color: var(--accent);
}

.cart-container {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-left: 20px;
}

.cart-icon {
  width: 28px;
  height: 28px;
}

#cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff6b6b;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

/* Hamburger Styles */
.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  background: transparent;
  border: none;

}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--light); /* ensures three lines visible */
  border-radius: 2px;
  transition: 0.3s;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    background: var(--dark-bg);
    position: absolute;
    top: 70px;
    right: 16px;
    width: calc(100% - 32px);
    padding: 14px;
    border-radius: 0 0 10px 10px;
  }

  .nav-links.show {
    display: flex;
  }

  .menu-toggle {
    display: flex;
  }
}

/* =========================
   PAGE TITLE
========================= */
.page-title {
  text-align: center;
  margin: 80px 20px 40px;
}

.page-title h1 {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  color: #4a2c2c;
  margin-bottom: 15px;
}

.page-title p {
  font-size: 18px;
  color: #333;
  margin: 0 auto;
  max-width: 600px;
}

/* =========================
   CATEGORIES
========================= */
.category-section {
  text-align: center; /* centers the heading */
  margin: 60px 20px 30px;
}

.category-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  color: #4a2c2c;
  margin-bottom: 30px;
}

.category-list {
  display: flex;
  justify-content: center; /* centers categories */
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 50px;
}

.category-card {
  background: var(--accent);
  color: var(--light);
  padding: 20px;
  border-radius: 12px;
  width: 140px;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--box-shadow);
  transition: 0.3s ease;
}

.category-card:hover {
  transform: translateY(-5px);
  background: #ffbde0;
}

/* =========================
   PRODUCT LISTINGS
========================= */
.product-listings {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.wig-card {
  display: flex;
  background: var(--light);
  box-shadow: var(--box-shadow);
  border-radius: 16px;
  margin: 20px auto;
  max-width: 800px;
  overflow: hidden;
  transition: transform 0.3s;
}

.wig-card:hover {
  transform: translateY(-5px);
}

.wig-card video {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  margin: 15px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.wig-card img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  margin: 15px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.wig-card img:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(255, 182, 193, 0.4);
}

.wig-info {
  flex: 1;
  padding: 20px 30px;
  background: var(--dark-bg);
  color: var(--light);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.wig-info h2 {
  color: #ffbde0;
  font-size: 22px;
  margin-bottom: 8px;
}

.wig-info p {
  margin: 4px 0;
  font-size: 15px;
}

.wig-info .final-sale {
  color: #ff6b6b;
  font-weight: bold;
  margin-top: 10px;
}

.view-details-btn {
  display: inline-block;
  background: #ffbde0;
  color: #1a1a1a;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  transition: 0.3s;
  margin-top: 15px;
  align-self: flex-start;
}

.view-details-btn:hover {
  background: #ff9cc9;
  color: #fff;
}

/* Bundle Table */
.bundle-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

.bundle-table th, .bundle-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: center;
}

.bundle-table th {
  background: #ffbde0;
  color: #1a1a1a;
}

/* Add to Cart Button */
.add-cart-btn {
  background: #ffbde0;
  color: #1a1a1a;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
  white-space: nowrap; /* prevents extra spaces after text */
}

.add-cart-btn:hover {
  background: #ff9cc9;
  color: #fff;
}

.wig-card {
  display: flex;
  background: var(--light);
  box-shadow: var(--box-shadow);
  border-radius: 16px;
  margin: 20px auto;
  max-width: 800px;
  overflow: hidden;
  transition: transform 0.3s;
}

.wig-card img,
.wig-card video {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  margin: 15px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.wig-info {
  flex: 1;
  padding: 20px 30px;
  background: var(--dark-bg);
  color: var(--light);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.view-details-btn {
  align-self: center;
}

.page-title h1,
.page-title p {
  text-align: center;
}

.category-list {
  justify-content: center;
}

.wig-details-dropdown {
  display: none;
  margin: 25px 0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  animation: slideDown 0.3s ease;
}

#wif-details-frame,
#wig-details-frame {
  width: 100%;
  height: 800px;
  border: none;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.image-carousel {
  position: relative;
  max-width: 900px;
  margin: 0 auto 40px;
  display: flex;
  align-items: center;
}

.carousel-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 10px 0;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-track img {
  width: 180px;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: var(--box-shadow);
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.carousel-track img:hover {
  transform: scale(1.05);
}

.carousel-track video {
  width: 180px;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: var(--box-shadow);
  flex-shrink: 0;
  transition: transform 0.3s ease;
  pointer-events: none;
}

.carousel-track img:hover,
.carousel-track video:hover {
  transform: scale(1.05);
}

/* Arrow buttons */
.carousel-btn {
  background: #ffbde0;
  border: none;
  color: #1a1a1a;
  font-size: 20px;
  padding: 10px 14px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--box-shadow);
  transition: 0.3s;
  z-index: 5;
}

.carousel-btn:hover {
  background: #ff9cc9;
  color: #fff;
}

.carousel-btn.left {
  margin-right: 10px;
}

.carousel-btn.right {
  margin-left: 10px;
}

/* =========================
   FIX SCROLL FREEZE AFTER IFRAME
========================= */

/* Allow scroll to continue to page after iframe ends */
#wig-details-frame {
  overscroll-behavior: auto;
}

/* Ensure page can always continue scrolling */
html, body {
  overscroll-behavior-y: auto;
}

/* =========================
   CLEAR CART BUTTON (ID)
========================= */

#clear-cart {
  background: linear-gradient(135deg, #ff9cc9, #ffc9e3);
  color: #1a1a1a;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255, 156, 201, 0.5);
  transition: all 0.25s ease;
}

#clear-cart:hover {
  background: linear-gradient(135deg, #ff7eb3, #ffbde0);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(255, 156, 201, 0.7);
}

#clear-cart:active {
  transform: scale(0.97);
}

/* =========================
   MOBILE IMAGE / VIDEO SCALING
========================= */
@media (max-width: 768px) {

  /* Wig cards (list view) */
  .wig-card img,
  .wig-card video {
    width: 120px;
    height: 120px;
    margin: 10px;
  }

  .wig-card .wig-info{
    padding:12px 20px
  }

  /* Carousel items */
  .carousel-track img,
  .carousel-track video {
    width: 120px;
    height: 160px;
  }

  /* Allow more items visible */
  .carousel-track {
    gap: 10px;
    padding: 8px 0;
  }
}

/* Extra small phones */
@media (max-width: 480px) {

  .wig-card img,
  .wig-card video {
    width: 100px;
    height: 100px;
  }

  .wig-card .wig-info{
    padding:8px 16px
  }

  .carousel-track img,
  .carousel-track video {
    width: 100px;
    height: 140px;
  }
}
