/* ==========================================
   MADHYA EARTH — product.css
   Product detail page styles
   ========================================== */

/* ---- Breadcrumb ---- */
.product-breadcrumb {
  padding-top: calc(var(--nav-h) + 2rem);
  padding-bottom: 0.5rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  list-style: none;
  padding: 0;
  margin: 0;
}

.breadcrumb li + li::before {
  content: '/';
  margin-right: 0.5rem;
  opacity: 0.4;
}

.breadcrumb a { color: var(--text-muted); transition: color var(--t-base); }
.breadcrumb a:hover { color: var(--text-dark); }
.breadcrumb__current { color: var(--text-dark); font-weight: 400; }

/* ---- Product Detail Section ----
   Overrides .section's large symmetric padding — the breadcrumb above
   already clears the navbar and sits right above this, so it shouldn't
   need another ~128px gap before the gallery/info show up. */
.product-detail {
  padding-top: clamp(1rem, 2vw, 1.5rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}

/* ---- Product Detail Grid ---- */
.product-detail__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.product-detail__loading {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  grid-column: 1 / -1;
}

.product-detail__skeleton-info {
  padding-top: 1rem;
}

/* ---- Gallery ---- */
.product-gallery {
  position: sticky;
  top: calc(var(--nav-h-compact) + 1rem);
}

.product-gallery__main {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-cream);
  margin-bottom: 0.75rem;
}

.product-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out);
}

.product-gallery__main img:hover { transform: scale(1.03); }

.product-gallery__thumbs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.product-gallery__thumb {
  width: 72px;
  height: 72px;
  overflow: hidden;
  background: var(--bg-cream);
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color var(--t-base);
  flex-shrink: 0;
}

.product-gallery__thumb.is-active { border-color: var(--accent-terra); }
.product-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Trust badges (shared content, see js/trust-badges.js) ----
   Sits inside .product-gallery (not as a sibling after it) so it scrolls
   as one unit with the sticky image rail instead of risking an overlap
   with the image once the gallery locks in place. Compact icon-over-label
   styling — lighter than the shop page's bordered trust cards, since this
   is a supporting strip under the product photo, not its own section. */
.product-trust {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
}

.product-trust .trust-badge {
  flex: 1 1 0;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 0.5rem;
  min-height: 0;
  padding: 0;
  background: none;
  border: none;
  text-align: center;
}

.product-trust .trust-badge__icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  font-size: 15px;
}

.product-trust .trust-badge__label {
  font-size: 0.66rem;
  letter-spacing: 0.1em;
}

/* ---- Info Panel ---- */
.product-detail__info {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.product-detail__meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.product-detail__cat { color: var(--text-muted); }

.product-detail__name {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--text-dark);
}

.product-detail__desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.product-detail__pricing {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.product-detail__price {
  font-family: var(--font-body);
  font-size: 2rem;
  font-weight: 500;
  color: var(--text-dark);
}

.product-detail__compare {
  font-family: var(--font-body);
  font-size: 1.3rem;
  color: var(--text-muted);
  text-decoration: line-through;
  opacity: 0.6;
}

/* ---- Seasonal / Notify Me ---- */
.product-detail__seasonal-label {
  color: var(--accent-gold);
  margin-bottom: 0.75rem;
}

.product-detail__seasonal .notify-inline {
  display: flex;
}

/* ---- Actions Row ---- */
.product-detail__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Qty stepper */
.product-detail__qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-light);
  height: 46px;
}

.qty-btn {
  width: 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-dark);
  background: none;
  transition: background var(--t-fast);
}

.qty-btn:hover { background: var(--bg-cream); }

.qty-value {
  width: 44px;
  flex: 0 0 auto;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

/* Cart button */
.product-detail__cart-btn {
  flex: 1;
  min-width: 160px;
  justify-content: center;
  height: 46px;
}

.product-detail__cart-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Heart button */
.product-detail__heart {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: rgba(42, 33, 28, 0.4);
  transition: color var(--t-base), border-color var(--t-base), background var(--t-base);
}

.product-detail__heart:hover {
  color: var(--tree-1);
  border-color: var(--tree-1);
}

.product-detail__heart.is-wishlisted {
  color: var(--tree-1);
  border-color: var(--tree-1);
  background: rgba(122, 59, 46, 0.1);
}

.product-detail__heart.is-wishlisted svg {
  fill: var(--tree-1);
}

.product-detail__oos {
  font-size: 0.85rem;
  color: var(--accent-terra);
  font-weight: 500;
  letter-spacing: 0.08em;
}

/* ---- Accordion ---- */
.product-accordion {
  border-top: 1px solid var(--border-light);
  margin-top: 0.25rem;
}

.accordion-item { border-bottom: 1px solid var(--border-light); }

.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  padding: 1rem 0;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-dark);
  transition: color var(--t-base);
}

.accordion-trigger:hover { color: var(--accent-terra); }

.accordion-icon {
  flex-shrink: 0;
  transition: transform var(--t-base);
}

.accordion-trigger[aria-expanded="true"] .accordion-icon {
  transform: rotate(180deg);
}

.accordion-panel {
  padding: 0 0 1.25rem;
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.accordion-panel p {
  white-space: pre-line;
}

/* Benefits list — backend content arrives as "- line" text; parsed into
   real list items in product.js and given a proper bullet marker here
   instead of showing the literal "-" character. */
.accordion-panel__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.accordion-panel__list li {
  position: relative;
  padding-left: 1.15rem;
}

.accordion-panel__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-terra);
}

/* ---- Related Products ----
   .product-detail above already adds its own bottom breathing room, so
   trim this section's inherited top padding to avoid stacking two big
   gaps back to back. */
.related-section {
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
}

.related-section__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 1.75rem;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .product-detail__grid,
  .product-detail__loading {
    grid-template-columns: 1fr;
  }
  .product-gallery { position: static; }
}

@media (max-width: 767px) {
  .product-trust {
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
  }

  .product-trust .trust-badge__icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    font-size: 12px;
  }

  .product-trust .trust-badge__label {
    font-size: 0.6rem;
    line-height: 1.35;
  }
}

@media (max-width: 600px) {
  .product-detail__actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
  }
  /* Qty stepper gets its own row but stays its natural (fixed) width
     rather than stretching edge-to-edge — grid-column spans the row,
     justify-self keeps the box itself compact. */
  .product-detail__qty {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .product-detail__cart-btn {
    grid-column: 1;
    width: auto;
  }
  .product-detail__heart {
    grid-column: 2;
    align-self: center;
  }
}
