/* ==================== */
/* Desktop Layout       */
/* ==================== */
.product-page-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.product-container {
  display: flex;
  min-height: 100vh;
}

/* Left: Image Grid - 70% width */
.product-gallery {
  width: 70%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  padding: 0;
}

.gallery-image {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
}

.gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Right: Product Info - 30% width, sticky */
.product-info-sticky {
  width: 30%;
  position: sticky;
  top: 60px; /* Adjust to your header height */
  height: fit-content;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}

.product-info {
  padding: 40px;
}

/* ==================== */
/* Product Info Styling */
/* ==================== */
.product-title {
  font-family: 'CHANEY', sans-serif;
  font-size: 28px;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.product-price {
  font-size: 22px;
  margin-bottom: 30px;
  font-weight: 600;
  color: #000;
}

.product-description {
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 30px;
  color: #666;
}

/* Color Variants */
.color-variants {
  margin-bottom: 25px;
}

.color-swatches {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #ddd;
  cursor: pointer;
  transition: all 0.3s;
  display: block;
}

.color-swatch:hover {
  border-color: #000;
  transform: scale(1.05);
}

.color-swatch.active {
  border-color: #000;
  box-shadow: 0 0 0 2px white, 0 0 0 4px #000;
}

/* Options */
.product-options {
  margin-bottom: 25px;
}

.option-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  margin-bottom: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.size-select {
  width: 100%;
  padding: 14px;
  border: 2px solid #000;
  background: white;
  font-size: 13px;
  cursor: pointer;
  text-transform: uppercase;
  font-weight: 500;
  transition: all 0.3s;
}

.size-select:hover,
.size-select:focus {
  outline: none;
  border-color: rgb(216, 82, 132);
}

/* Add to Cart Button */
.product-actions {
  margin-bottom: 30px;
}

.btn-add-to-cart {
  width: 100%;
  padding: 16px;
  background: #000;
  color: #fff;
  border: none;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-add-to-cart:hover {
  background: rgb(216, 82, 132);
}

.btn-add-to-cart:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Product Meta */
.product-meta,
.product-attributes {
  margin-top: 25px;
  font-size: 11px;
  color: #666;
  line-height: 1.8;
}

.attribute-item {
  margin-bottom: 8px;
}

.meta-label {
  font-weight: 600;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==================== */
/* Mobile Layout        */
/* ==================== */
@media (max-width: 768px) {

  .product-page-wrapper {
    padding: 0;
  }

  .product-container {
    flex-direction: column;
    min-height: auto;
  }

  /* Gallery: Horizontal scroll on mobile */
  body.page-product .product-gallery {
    width: 100%;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    padding: 0;
  }

  body.page-product .gallery-image {
    flex: 0 0 100%;
    width: 100%;
    height: auto; /* Changed from 100vh */
    aspect-ratio: 3/4; /* Keep the aspect ratio */
    scroll-snap-align: start;
  }

  body.page-product .gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Product info below gallery on mobile */
  .product-info-sticky {
    width: 100%;
    position: relative;
    top: auto;
    height: auto;
    max-height: none;
    overflow-y: visible;
  }

  .product-info {
    padding: 30px 20px;
    padding-bottom: 120px; /* Space for sticky button */
  }

  .product-title {
    font-size: 22px;
    margin-bottom: 15px;
  }

  .product-price {
    font-size: 18px;
    margin-bottom: 20px;
  }

  .product-description {
    font-size: 13px;
    margin-bottom: 25px;
  }

  .color-variants,
  .product-options {
    margin-bottom: 20px;
  }

  /* Sticky Add to Cart on mobile */
  .product-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 15px 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
    margin-bottom: 0;
  }

  .btn-add-to-cart {
    margin: 0;
  }

  /* Hide scrollbar on mobile for cleaner look */
  .product-gallery::-webkit-scrollbar {
    display: none;
  }
  
  .product-gallery {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .product-gallery {
    width: 65%;
  }

  .product-info-sticky {
    width: 35%;
  }

  .product-info {
    padding: 30px;
  }

  .product-title {
    font-size: 24px;
  }
}

/* Mobile scroll indicator */
.mobile-scroll-indicator {
  display: none;
}

@media (max-width: 768px) {
  .mobile-scroll-indicator {
    display: block;
    position: relative;
    width: 100%;
    height: 4px;
    background: #fff;
    margin-bottom: 20px;
  }

  .scroll-indicator-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #d8528c;
    width: 33.33%; /* Adjust based on number of images */
    transition: left 0.1s ease-out;
  }
}


/* Lightbox */
.product-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 100000;
  display: none;
  align-items: flex-start; /* Changed from center */
  justify-content: center;
  cursor: zoom-out;
  overflow-y: auto; /* Allow scrolling for tall images */
}

.product-lightbox img {
  width: 100vw;
  height: auto;
  object-fit: contain;
  cursor: zoom-out;
  display: block;
}

.product-lightbox.active {
  display: flex;
}


.lightbox-close {
  position: absolute;
  top: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0);
  border: none;
  border-radius: 50%;
  color: black;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
  z-index: 1000000;
}

.lightbox-close:hover {
    color: #d8528c;
}

/* Hide lightbox on mobile */
@media (max-width: 768px) {
  .product-lightbox {
    display: none !important;
  }
}

/* Color Variants Section */
.color-variants-section {
  margin: 10px 0;
  padding: 20px 0;
  border: none;
}

.color-variants-label {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #000;
  margin-bottom: 15px;
  display: block;
}

.color-variants-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.color-variant-item {
  position: relative;
}

.variant-link {
  display: block;
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0);
  transition: border-color 0.2s ease;
}

.variant-link:hover {
  border-color: rgb(216, 82, 132);
}

.variant-thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  display: block;
}

/* Pink bar under active color */
.color-variant-item.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: rgb(216, 82, 132);
}

@media (max-width: 768px) {
  .variant-thumbnail {
    width: 80px;
    height: 80px;
  }

  .color-variants-grid {
    gap: 10px;
  }
}
