/* ==============================================================================
   Roopb / Kito Super App - Full Product Detail Page Styles
   Matching iOS ProductDetailView & StoreProductGalleryView
   ============================================================================== */

.pd-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--surface, #FAF9F6);
  color: var(--text, #1E2022);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .pd-overlay {
  background: #0F1218;
  color: #F1F5F9;
}

/* Floating Top Navigation Bar with Liquid Glass Circular Buttons */
.pd-nav-bar {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 1020;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  pointer-events: none;
}

.pd-glass-btn {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text, #1E2022);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, background 0.2s ease;
}

[data-theme="dark"] .pd-glass-btn {
  background: rgba(23, 28, 38, 0.75);
  border-color: rgba(255, 255, 255, 0.1);
  color: #F1F5F9;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.pd-glass-btn:hover {
  transform: scale(1.06);
}

.pd-glass-btn.liked {
  color: #EF4444;
}

.pd-glass-btn.liked svg {
  fill: #EF4444;
}

/* Toast Notification Overlay */
.pd-toast {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1030;
  background: rgba(23, 28, 38, 0.9);
  backdrop-filter: blur(12px);
  color: #FFFFFF;
  padding: 10px 20px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.pd-toast-btn {
  background: #C4F135;
  color: #171C26;
  border: none;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
}

/* Main Container (Two-column layout on Desktop, single on Mobile) */
.pd-container {
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
  padding: 80px 24px 140px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

@media (max-width: 900px) {
  .pd-container {
    grid-template-columns: 1fr;
    padding: 70px 16px 140px;
    gap: 28px;
  }
}

/* 1. Stretchy Hero Gallery with Vertical Floating Thumbnails */
.pd-gallery-section {
  position: sticky;
  top: 80px;
}

.pd-hero-media-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.05;
  border-radius: 32px;
  overflow: hidden;
  background: var(--surface-raised, #EBEAE8);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .pd-hero-media-wrapper {
  background: #171C26;
}

.pd-hero-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pd-hero-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 90px;
  background: linear-gradient(to top, rgba(0,0,0,0.18), transparent);
  pointer-events: none;
}

/* Thumbnails list below/side */
.pd-thumbs-track {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.pd-thumb-btn {
  flex-shrink: 0;
  width: 68px;
  height: 68px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  background: var(--surface-raised, #EBEAE8);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

[data-theme="dark"] .pd-thumb-btn {
  background: #1F2430;
}

.pd-thumb-btn.active {
  border-color: #1E2022;
  transform: scale(1.05);
}

[data-theme="dark"] .pd-thumb-btn.active {
  border-color: #FFFFFF;
}

.pd-thumb-btn img,
.pd-thumb-btn video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pd-thumb-video-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 9px;
  display: flex;
  align-items: center;
}

/* 2. Product Details & Editorial Content */
.pd-info-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pd-brand {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted, #8B8B7A);
}

.pd-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.02em;
}

@media (max-width: 640px) {
  .pd-title {
    font-size: 26px;
  }
}

/* Price & Discount */
.pd-price-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.pd-current-price {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pd-was-price {
  font-size: 20px;
  color: var(--muted, #8B8B7A);
  text-decoration: line-through;
}

.pd-discount-badge {
  background: #EF4444;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}

/* Rating / Sold meta row */
.pd-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted, #8B8B7A);
}

.pd-rating-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--text, #1E2022);
}

[data-theme="dark"] .pd-rating-badge {
  color: #F1F5F9;
}

.pd-rating-badge svg {
  fill: #F5B83D;
  width: 14px;
  height: 14px;
}

/* Store Badge Card */
.pd-store-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-raised, #F4F3F1);
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .pd-store-card {
  background: #171C26;
  border-color: rgba(255, 255, 255, 0.06);
}

.pd-store-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pd-store-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #2563EB;
  color: #FFFFFF;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
}

/* Variants Selection (Colors & Sizes) */
.pd-variants-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .pd-variants-section {
  border-color: rgba(255, 255, 255, 0.08);
}

.pd-variant-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--muted, #8B8B7A);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pd-chips-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pd-chip-btn {
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: var(--surface, #FFFFFF);
  color: var(--text, #1E2022);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

[data-theme="dark"] .pd-chip-btn {
  background: #171C26;
  border-color: rgba(255, 255, 255, 0.12);
  color: #F1F5F9;
}

.pd-chip-btn:hover {
  border-color: var(--text, #1E2022);
}

.pd-chip-btn.active {
  background: #1E2022;
  color: #FFFFFF;
  border-color: #1E2022;
}

[data-theme="dark"] .pd-chip-btn.active {
  background: #FFFFFF;
  color: #0F1218;
  border-color: #FFFFFF;
}

/* Quantity Controls */
.pd-qty-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pd-qty-selector {
  display: inline-flex;
  align-items: center;
  background: var(--surface-raised, #F4F3F1);
  border-radius: 14px;
  padding: 4px;
}

[data-theme="dark"] .pd-qty-selector {
  background: #171C26;
}

.pd-qty-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: transparent;
  font-size: 18px;
  font-weight: 600;
  color: var(--text, #1E2022);
  cursor: pointer;
  display: grid;
  place-items: center;
}

[data-theme="dark"] .pd-qty-btn {
  color: #F1F5F9;
}

.pd-qty-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .pd-qty-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.pd-qty-val {
  min-width: 36px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
}

/* Accordions (Description & Reviews) */
.pd-accordion {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .pd-accordion {
  border-color: rgba(255, 255, 255, 0.08);
}

.pd-accordion-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  background: transparent;
  border: none;
  font-size: 16px;
  font-weight: 700;
  color: var(--text, #1E2022);
  cursor: pointer;
  text-align: left;
}

[data-theme="dark"] .pd-accordion-header {
  color: #F1F5F9;
}

.pd-accordion-body {
  padding-bottom: 20px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text, #334155);
  white-space: pre-line;
}

[data-theme="dark"] .pd-accordion-body {
  color: #CBD5E1;
}

/* Reviews List in Accordion */
.pd-reviews-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px;
  background: var(--surface-raised, #F4F3F1);
  border-radius: 14px;
}

[data-theme="dark"] .pd-reviews-summary {
  background: #171C26;
}

.pd-score-num {
  font-size: 32px;
  font-weight: 800;
}

.pd-review-card {
  padding: 12px 0;
  border-top: 1px solid rgba(0,0,0,0.05);
}

[data-theme="dark"] .pd-review-card {
  border-color: rgba(255,255,255,0.05);
}

/* 3. Floating Bottom Purchase Bar (Matching ProductPurchaseBar.swift) */
.pd-bottom-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 32px));
  z-index: 1020;
  display: flex;
  gap: 12px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 10px 14px;
  border-radius: 28px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .pd-bottom-bar {
  background: rgba(23, 28, 38, 0.85);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.pd-btn-buy {
  flex: 1;
  height: 52px;
  border-radius: 20px;
  border: none;
  background: #2563EB;
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.pd-btn-buy:hover {
  background: #1D4ED8;
  transform: translateY(-1px);
}

.pd-btn-buy:disabled {
  background: #94A3B8;
  cursor: not-allowed;
}

.pd-btn-cart-secondary {
  height: 52px;
  padding: 0 20px;
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: var(--surface-raised, #F4F3F1);
  color: var(--text, #1E2022);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

[data-theme="dark"] .pd-btn-cart-secondary {
  background: #1F2430;
  border-color: rgba(255, 255, 255, 0.12);
  color: #F1F5F9;
}

