/* =============================================
   WAVENEXA — Product Detail Styles
   ============================================= */

.product-page {
  padding-top: calc(var(--nav-h) + 24px);
  padding-bottom: 80px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 36px;
}

.breadcrumb a {
  transition: var(--transition);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb span {
  color: var(--text-dim);
}

/* ── Product Layout ───────────────────────────── */
.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  margin-bottom: 80px;
}

/* ── Gallery ─────────────────────────────────── */
.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gallery-main-img {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border);
  cursor: zoom-in;
  aspect-ratio: 1/1;
}

.gallery-main-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-origin: center center;
}

.gallery-main-img:hover img {
  transform: scale(1.5);
}

.gallery-zoom-hint {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 0.72rem;
  padding: 6px 12px;
  border-radius: 20px;
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}

.gallery-main-img:hover .gallery-zoom-hint {
  opacity: 1;
}

.gallery-thumbs {
  display: flex;
  gap: 12px;
}

.gallery-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumb:hover,
.gallery-thumb.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

/* ── Product Details ─────────────────────────── */
.product-details {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.product-details-top {}

.product-cat {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.product-name {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 900;
  margin-bottom: 10px;
}

.product-ratings {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stars {
  font-size: 0.9rem;
}

.rating-count {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.product-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.product-price-current {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  color: var(--text);
}

.product-price-original {
  font-size: 1rem;
  color: var(--text-dim);
  text-decoration: line-through;
}

.product-price-discount {
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #4CAF50, #2E7D32);
  padding: 3px 10px;
  border-radius: 20px;
}

.product-stock {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #4CAF50;
}

.stock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4CAF50;
  animation: pulse 2s infinite;
}

.product-description {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-muted);
}

/* ── Selectors ───────────────────────────────── */
.selector-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.selector-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.selector-label>span:first-child {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.selected-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
}

.size-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.size-option {
  min-width: 52px;
  height: 48px;
  padding: 0 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.size-option:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.size-option.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.size-option.unavailable {
  opacity: 0.3;
  cursor: not-allowed;
  text-decoration: line-through;
}

.size-guide-link {
  font-size: 0.82rem;
  color: var(--primary);
  cursor: pointer;
  text-decoration: underline;
  width: fit-content;
}

.size-guide-link:hover {
  opacity: 0.8;
}

.color-selector {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.selected {
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--primary);
  transform: scale(1.15);
}

.color-swatch.selected::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: white;
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* ── Qty Control ─────────────────────────────── */
.qty-control {
  display: flex;
  align-items: center;
  gap: 0;
}

.qty-btn {
  width: 44px;
  height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  border-radius: 0;
}

.qty-btn:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.qty-btn:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.qty-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.qty-input {
  width: 64px;
  height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: none;
  border-right: none;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  border-radius: 0;
}

/* ── Actions ─────────────────────────────────── */
.product-actions {
  display: flex;
  gap: 12px;
}

.product-actions .btn {
  flex: 1;
}

/* ── Meta ────────────────────────────────────── */
.product-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-meta-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}

.product-meta-item:hover {
  border-color: var(--primary);
}

.meta-icon {
  font-size: 1.1rem;
}

.product-meta-item>div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.meta-val {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ── Trust Badges ────────────────────────────── */
.trust-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Related ─────────────────────────────────── */
.related-section {
  padding-top: 20px;
}

.related-section .section-header {
  text-align: left;
  margin-bottom: 28px;
}

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

/* ── Size Guide Modal ────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 500px;
  width: 100%;
  animation: scaleIn 0.3s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-header h3 {
  font-size: 1.1rem;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.size-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.size-table {
  min-width: 360px;
  width: 100%;
  border-collapse: collapse;
}

.size-table th,
.size-table td {
  padding: 12px 14px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.size-table th {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.size-table tr:hover td {
  background: var(--surface);
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 1024px) {
  .product-layout {
    gap: 40px;
  }

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

@media (max-width: 768px) {
  .product-page {
    padding-top: calc(var(--nav-h) + 16px);
    padding-bottom: 50px;
  }

  .breadcrumb {
    margin-bottom: 20px;
    font-size: 0.78rem;
    flex-wrap: wrap;
  }

  .product-layout {
    grid-template-columns: 1fr;
    gap: 28px;
    margin-bottom: 50px;
  }

  .gallery-thumbs {
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }

  .gallery-thumbs::-webkit-scrollbar {
    display: none;
  }

  .gallery-thumb {
    width: 64px;
    height: 64px;
    min-width: 64px;
  }

  .product-name {
    font-size: 1.6rem;
  }

  .product-actions {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .product-actions .btn {
    width: 100%;
    min-height: 48px;
  }

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

  .modal-box {
    padding: 24px 18px;
    max-height: 85vh;
    overflow-y: auto;
  }
}

@media (max-width: 480px) {
  .product-price-current {
    font-size: 1.6rem;
  }

  .size-option {
    min-width: 48px;
    height: 44px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .trust-badges {
    flex-direction: column;
    gap: 8px;
    padding: 14px;
  }

  .product-meta-item {
    padding: 12px 14px;
  }
}

@media (max-width: 340px) {
  .related-grid {
    grid-template-columns: 1fr;
  }
}