/* Affiliate product detail page (PDP)
   Cream / gold panels aligned with boutique affiliate identity.
   Gallery class names must stay stable for product.php JS. */

.product-page {
  padding: 12px 0 100px;
  background: transparent;
}

.product-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 15px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Hide legacy SHEIN bar — ecommerce-header is the nav */
.product-header {
  display: none !important;
}

/* ── Gallery (mobile first) ─────────────────────────────────────────── */

.product-images-container {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border-color, #e6d4c4);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(201, 162, 124, 0.05);
}

.product-thumbnails {
  display: none;
}

.product-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #fff;
}

.product-slides {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.product-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  background: #fff;
}

.product-slide-img-zoom {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-slide img,
.product-slide-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

@media (max-width: 991px) {
  .product-page .product-images-container {
    max-width: 100%;
  }

  .product-slide img:hover {
    transform: scale(1.02);
  }
}

.product-slide img[data-src] {
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
  background: linear-gradient(90deg, #f6eee6 25%, #ead9c8 50%, #f6eee6 75%);
  background-size: 200% 100%;
  animation: pdp-shimmer 1.5s infinite;
}

@keyframes pdp-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.product-slide img:not([data-src]) {
  opacity: 1;
}

.slide-counter {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(201, 162, 124, 0.92);
  color: var(--on-primary, #333);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.product-download-images-btn {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
  transition: background 0.2s ease, transform 0.2s ease;
}

.product-download-images-btn:hover,
.product-download-images-btn:focus {
  background: rgba(201, 162, 124, 0.95);
  color: var(--on-primary, #333);
  transform: translateY(-1px);
}

.product-download-images-btn i {
  font-size: 0.85rem;
}

.product-slider--empty .store-no-image--hero {
  border-radius: 12px;
  width: 100%;
  height: 100%;
}

/* ── Details panel ──────────────────────────────────────────────────── */

.product-details,
.pdp-panel {
  background: #fff;
  border: 1px solid var(--border-color, #e6d4c4);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(201, 162, 124, 0.05);
  padding: 18px 16px;
}

.pdp-title {
  margin: 8px 0 12px;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.45;
  color: var(--text-color, #333333);
}

.pdp-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  font-size: 0.8rem;
  color: var(--dark-gray, #666);
}

.pdp-crumb a {
  color: var(--rose-gold, #c99588);
  text-decoration: none;
  font-weight: 700;
}

.pdp-crumb a:hover {
  color: var(--secondary-color, #333);
}

.pdp-crumb__sep {
  opacity: 0.5;
}

.pdp-stock {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
}

.pdp-stock--ok {
  background: #ecfdf3;
  color: #047857;
}

.pdp-stock--low {
  background: #f7efe6;
  color: #92400e;
}

.pdp-stock--out {
  background: #f3f4f6;
  color: #6b7280;
}

.pdp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.pdp-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--light-gray, #f6eee6);
  color: var(--dark-gray, #4b5563);
  border: 1px solid var(--border-color, #e6d4c4);
  text-decoration: none;
}

.pdp-meta-chip--link,
a.pdp-meta-chip {
  color: var(--rose-gold, #c99588);
  border-color: #e6d4c4;
  background: #f6eee6;
}

.pdp-meta-chip--link:hover,
a.pdp-meta-chip:hover {
  background: #e6d4c4;
  color: var(--secondary-color, #333);
}

/* ── Pricing ───────────────────────────────────────────────────────── */

.pdp-pricing {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  padding: 16px 18px 16px 16px;
  margin-bottom: 16px;
  background:
    linear-gradient(165deg, #fffdf8 0%, #f6eee6 100%);
  border: 1px solid var(--border-color, #e6d4c4);
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(42, 34, 24, 0.05);
}

.pdp-pricing::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: var(--primary-color, #ddc06a);
}

.pdp-price-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pdp-price-lbl {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-light, #f3e6c0);
  color: var(--on-primary, #3a2f26);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.3;
}

.pdp-price-unit {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--dark-gray, #8a7b70);
}

.pdp-price-val {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.pdp-price-amount {
  font-size: clamp(1.7rem, 4.2vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--secondary-color, #3f342c);
}

.pdp-price-cur {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--rose-gold, #c99588);
}

.pdp-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pdp-price-row--mine .pdp-price-amount {
  font-size: clamp(1.7rem, 4.2vw, 2.2rem);
}

.pdp-price-old {
  font-size: 0.85rem;
  color: var(--dark-gray, #6b7280);
  text-decoration: line-through;
  opacity: 0.8;
  font-weight: 600;
}

.pdp-price-row--suggested .pdp-price-amount {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-color, #333333);
}

.pdp-profit {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--primary-dark, #e6c200);
  background: #fff;
  border: 1px solid #e6d4c4;
  border-radius: 8px;
  padding: 4px 10px;
}

/* Legacy price blocks unused in redesigned markup */
.product-price-mobile,
.product-price-desktop {
  display: none !important;
}

/* ── Specs / description panels ─────────────────────────────────────── */

.pdp-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color, #e6d4c4);
}

.pdp-section-title,
.description-title {
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0 0 10px;
  color: var(--text-color, #333333);
}

.product-specs-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-spec-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid rgba(201, 162, 124, 0.08);
}

.product-spec-row:last-child {
  border-bottom: none;
}

.product-spec-row dt {
  margin: 0;
  min-width: 100px;
  color: var(--dark-gray, #6b7280);
  font-size: 0.88rem;
  font-weight: 600;
}

.product-spec-row dd {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-color, #333333);
  font-weight: 700;
}

.description-content {
  color: var(--dark-gray, #4b5563);
  line-height: 1.7;
  font-size: 0.92rem;
}

/* ── Variants & qty ─────────────────────────────────────────────────── */

.product-power-select-wrap,
.product-general-qty-wrap {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color, #e6d4c4);
}

.product-option-pair-hint {
  margin: 6px 0 10px;
  font-size: 0.88rem;
  color: var(--dark-gray, #6b7280);
  line-height: 1.55;
}

.product-option-pair-fields,
.product-prescription-per-eye-qty {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pdp-field {
  flex: 1 1 140px;
  min-width: 0;
}

.pdp-field label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 0.88rem;
  color: var(--text-color, #333333);
}

.product-variant-select {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color, #e6d4c4);
  border-radius: 10px;
  font-size: 0.95rem;
  background: #fff;
  color: var(--text-color, #333333);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.product-variant-select:focus {
  outline: none;
  border-color: var(--primary-color, #ffd700);
  box-shadow: 0 0 0 3px rgba(201, 162, 124, 0.15);
}

.product-cosmetic-qty {
  margin-top: 12px;
}

.product-out-of-stock-msg {
  margin-top: 16px;
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  color: #92400e;
  font-weight: 700;
  font-size: 0.92rem;
}

/* ── Desktop actions ────────────────────────────────────────────────── */

.desktop-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  width: 100%;
}

.desktop-actions .desktop-wishlist-btn,
.desktop-actions .product-wishlist {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: 52px !important;
  height: 52px !important;
  border: 1px solid var(--border-color, #e6d4c4);
  border-radius: 12px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: #fff;
  color: var(--dark-gray, #4b5563);
  cursor: pointer;
  visibility: visible !important;
  opacity: 1 !important;
  transition: all 0.25s ease;
  flex-shrink: 0;
  z-index: 1 !important;
}

.desktop-actions .desktop-wishlist-btn:hover,
.desktop-actions .product-wishlist:hover,
.desktop-actions .desktop-wishlist-btn.wishlist-active,
.desktop-actions .product-wishlist.wishlist-active {
  background: #fff5f5;
  border-color: #fecaca;
  color: #ef4444;
}

.desktop-actions .desktop-wishlist-btn.wishlist-active i.fas,
.desktop-actions .product-wishlist.wishlist-active i.fas {
  color: #ef4444 !important;
}

.desktop-actions .add-to-cart-btn,
button.add-to-cart-btn.related.product-page-add-to-cart {
  flex: 1;
  height: 52px;
  background: var(--primary-color, #ffd700) !important;
  color: var(--on-primary, #333) !important;
  border: none !important;
  border-radius: 12px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  margin: 0 !important;
  padding: 0 20px !important;
}

.desktop-actions .add-to-cart-btn:hover:not(:disabled) {
  background: var(--primary-dark, #e6c200) !important;
}

.desktop-actions .add-to-cart-btn:disabled {
  background: #e5e7eb !important;
  color: #9ca3af !important;
  cursor: not-allowed;
}

/* ── Technical specs block ──────────────────────────────────────────── */

.product-profile-specs-wrap {
  max-width: var(--container-width, 90%);
  margin: 0 auto 24px;
  padding: 0 15px;
  box-sizing: border-box;
}

.product-profile-specs-inner {
  border: 1px solid var(--border-color, #e6d4c4);
  border-radius: 14px;
  padding: 16px 18px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(201, 162, 124, 0.05);
}

.product-profile-specs-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--text-color, #333333);
}

.product-profile-specs-dl {
  margin: 0;
  padding: 0;
}

.product-profile-specs-row {
  display: grid;
  grid-template-columns: minmax(110px, 170px) 1fr;
  gap: 8px 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(201, 162, 124, 0.1);
  align-items: baseline;
}

.product-profile-specs-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.product-profile-specs-dt {
  margin: 0;
  font-size: 0.9rem;
  color: var(--dark-gray, #6b7280);
  font-weight: 600;
}

.product-profile-specs-dd {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-color, #333333);
  font-weight: 700;
}

@media (max-width: 576px) {
  .product-profile-specs-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* ── Related products ───────────────────────────────────────────────── */

.related-products {
  max-width: var(--container-width, 90%);
  margin: 28px auto;
  padding: 0 15px;
  box-sizing: border-box;
}

.related-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text-color, #333333);
  display: flex;
  align-items: center;
  gap: 8px;
}

.related-title i {
  color: var(--primary-color, #ffd700);
  font-size: 1rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.related-grid .aff-card {
  height: 100%;
}

.product-slider--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #f7efe6 0%, #e6d4c4 55%, #c99588 100%);
}

.product-slider--empty .store-no-image--hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(42, 34, 24, 0.45);
}

.product-slider--empty .store-no-image__icon {
  font-size: 2.4rem;
}

/* ── Mobile sticky ATC ──────────────────────────────────────────────── */

@media (max-width: 991px) {
  .desktop-actions {
    display: none;
  }
}

.add-to-cart-section {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  padding: 12px 15px;
  box-shadow: 0 -4px 20px rgba(201, 162, 124, 0.1);
  border-top: 1px solid var(--border-color, #e6d4c4);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  z-index: 100;
}

.add-to-cart-section .wishlist-btn,
.add-to-cart-section .product-wishlist {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: 48px !important;
  height: 48px !important;
  border: 1px solid var(--border-color, #e6d4c4);
  border-radius: 12px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: #fff;
  color: var(--dark-gray, #4b5563);
  cursor: pointer;
  visibility: visible !important;
  opacity: 1 !important;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.add-to-cart-section .wishlist-btn:hover,
.add-to-cart-section .product-wishlist:hover,
.add-to-cart-section .wishlist-btn.wishlist-active,
.add-to-cart-section .product-wishlist.wishlist-active {
  background: #fff5f5;
  border-color: #fecaca;
  color: #ef4444;
}

.add-to-cart-section .wishlist-btn.wishlist-active i.fas,
.add-to-cart-section .product-wishlist.wishlist-active i.fas {
  color: #ef4444 !important;
}

.add-to-cart-section .add-to-cart-btn {
  flex: 1;
  height: 48px;
  background: var(--primary-color, #ffd700) !important;
  color: var(--on-primary, #333) !important;
  border-radius: 12px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.98rem;
  border: none !important;
  cursor: pointer;
}

.add-to-cart-section .add-to-cart-btn:disabled {
  background: #e5e7eb !important;
  color: #9ca3af !important;
  cursor: not-allowed;
}

/* Floating cart sits above sticky bar on mobile */
@media (max-width: 991px) {
  .product-page ~ .floating-cart,
  body > .floating-cart {
    bottom: 80px;
  }
}

/* ── Image modal ────────────────────────────────────────────────────── */

.image-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
  cursor: pointer;
}

.image-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.image-modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px 100px;
  box-sizing: border-box;
  pointer-events: none;
}

.image-modal-content img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.image-modal-close,
.image-modal-download {
  position: fixed;
  top: 15px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.92);
  border: none;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  transition: all 0.25s ease;
  color: #333;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  pointer-events: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.image-modal-close {
  right: 15px;
}

.image-modal-download {
  left: 15px;
}

.image-modal-close:active,
.image-modal-download:active {
  transform: scale(0.95);
}

.image-modal-download span {
  display: none;
}

/* ── Desktop layout ─────────────────────────────────────────────────── */

@media (min-width: 992px) {
  .product-page {
    padding: 28px 0 50px;
  }

  .pdp-title {
    font-size: 1.7rem;
  }

  .pdp-pricing {
    padding: 18px 20px 18px 18px;
  }

  .pdp-price-amount {
    font-size: 2.15rem;
  }

  .product-container {
    max-width: var(--container-width, 90%);
    margin: 0 auto 28px;
    padding: 0 15px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 28px;
    align-items: start;
  }

  .product-images-container {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 16px;
    align-items: start;
    padding: 14px;
    overflow: visible;
  }

  .product-images-container--no-images {
    grid-template-columns: 1fr;
  }

  .product-thumbnails {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100px;
    max-height: 480px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-left: 4px;
    scrollbar-width: thin;
    scrollbar-color: #c99588 #f6eee6;
  }

  .product-thumbnails::-webkit-scrollbar {
    width: 5px;
  }

  .product-thumbnails::-webkit-scrollbar-track {
    background: #f6eee6;
    border-radius: 10px;
  }

  .product-thumbnails::-webkit-scrollbar-thumb {
    background: #c99588;
    border-radius: 10px;
  }

  .product-thumbnail {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #fff;
    box-shadow: 0 1px 3px rgba(201, 162, 124, 0.08);
  }

  .product-thumbnail:hover {
    transform: translateY(-2px);
    border-color: #e6d4c4;
  }

  .product-thumbnail.active {
    border-color: var(--primary-color, #ffd700);
    box-shadow: 0 0 0 2px rgba(201, 162, 124, 0.2);
  }

  .product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    transition: transform 0.3s ease;
  }

  .product-thumbnail:hover img {
    transform: scale(1.05);
  }

  .product-slider {
    aspect-ratio: auto;
    height: 480px;
    min-height: 480px;
    max-height: 480px;
    border-radius: 12px;
    border: 1px solid var(--border-color, #e6d4c4);
  }

  .product-slide {
    padding: 24px;
  }

  .product-slide-img-zoom {
    overflow: hidden;
  }

  .product-slide img {
    cursor: zoom-in;
    transition: transform 0.15s ease-out, transform-origin 0.12s ease-out;
  }

  .product-slide .product-slide-img.is-zooming {
    transform: scale(2.35);
    cursor: crosshair;
  }

  .product-details,
  .pdp-panel {
    padding: 22px 20px;
    position: sticky;
    top: 110px;
  }

  .related-products {
    padding-bottom: 0;
  }

  .related-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .add-to-cart-section {
    display: none;
  }

  .floating-cart {
    display: none;
  }

  .image-modal-content {
    height: auto;
    padding: 20px;
  }

  .image-modal-close,
  .image-modal-download {
    position: absolute;
    top: 20px;
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  .image-modal-close {
    right: 20px;
  }

  .image-modal-download {
    left: 20px;
  }

  .image-modal-close:hover,
  .image-modal-download:hover {
    background: #fff;
    transform: scale(1.08);
  }
}

@media (min-width: 1200px) {
  .related-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}
