/* product.css — the customer-facing product purchase page.

   Redesigned 2026-08-26 to Lakshay's layout direction: cover as the visual
   hero on the left, one premium purchase card on the right, tabbed detail
   sections beneath, collapsing to a single column on mobile in the order
   cover → badges → title → price → buy → benefits → tabs.

   Same register as store.css: no site-nav, no Zyentora wordmark — the
   reseller's store carries the page.

   EVERY colour here comes from a theme token (themes.css). Nothing is
   hardcoded, so all four themes restyle this page without a single rule
   below changing. Structure is shared; only the visual language differs.

   This page is the Razorpay checkout entry point. product.js binds to these
   nodes by id — nothing here renames, moves or removes one. */

/* ---------------- States ---------------- */
.state-message { padding: var(--space-8) 0; text-align: center; }
#product-not-found[hidden] { display: none; }
#product-not-found .btn-secondary { display: inline-flex; margin-top: var(--space-3); }
#product-content[hidden] { display: none; }

.back-to-store-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding-block: 10px;
  margin-block: var(--space-3) 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}
.back-to-store-link:hover { color: var(--text-primary); }

/* ---------------- Hero ---------------- */
.pdp-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  padding-block: var(--space-4) var(--space-6);
  align-items: start;
}

/* Cover is the visual hero. Fixed 3:4 box with the real cover filling it —
   these are 3D hardcover renders at roughly 0.64, so they letterbox slightly
   and the mat behind makes that read as intentional. */
.product-detail-thumb {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--t-radius, 14px);
  background: var(--thumb-mat, var(--surface-2));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.product-detail-thumb-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

/* ---------------- Right column ---------------- */
.pdp-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.pdp-badges:empty { display: none; }

/* Matches the live page (id) and the theme preview (structural), so the
   preview cannot drift from what customers actually see. */
.pdp-buy-col h1,
#product-name {
  margin: 0 0 var(--space-2);
  overflow-wrap: anywhere;
  font-family: var(--t-display, 'Space Grotesk', sans-serif);
  font-weight: var(--t-display-weight, 700);
  font-size: clamp(28px, 5.5vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.product-sold-by {
  margin: 0 0 var(--space-4);
  font-size: 15px;
  color: var(--text-secondary);
}
.product-sold-by a { color: var(--text-primary); text-decoration: none; border-bottom: 1px solid var(--border-default); }
.product-sold-by a:hover { border-bottom-color: var(--t-accent); }

/* ---------------- The purchase card ---------------- */
/* One unit, not scattered: price, CTA, benefits and the download note all
   live inside a single raised panel. */
.pdp-card {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--t-radius, 14px);
  box-shadow: var(--shadow-soft);
  padding: var(--space-4);
}

.pdp-price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.product-detail-price {
  font-family: var(--t-display, 'Space Grotesk', sans-serif);
  font-weight: var(--t-display-weight, 700);
  font-size: clamp(34px, 7vw, 46px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.product-detail-was {
  font-size: 18px;
  color: var(--text-tertiary);
  text-decoration-thickness: 1px;
}
.product-detail-was[hidden] { display: none; }

.product-price-save {
  margin: var(--space-2) 0 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--t-accent-text, var(--t-accent));
}
.product-price-save[hidden] { display: none; }

.product-price-meta {
  margin: var(--space-2) 0 var(--space-4);
  font-size: 15px;
  color: var(--text-tertiary);
}

/* Primary action. Takes the theme's accent rather than the global brand
   button, so a Minimal store gets ink and a Premium store gets bronze. */
.pdp-buy-btn.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--t-radius-sm, 10px);
  background: var(--t-accent);
  color: var(--t-accent-ink);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  transition: background 200ms ease-out, transform 200ms ease-out;
}
.pdp-buy-btn.btn-primary:hover { background: var(--t-accent-hover); }
.pdp-buy-btn.btn-primary:active { transform: translateY(1px); }
.pdp-buy-btn.btn-disabled,
.pdp-buy-btn[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; }

#buy-error { margin-top: var(--space-3); }
#buy-error[hidden] { display: none; }

/* Benefits, inside the same card as the button. */
.pdp-benefits {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: var(--space-4) 0 0;
  border-top: 1px solid var(--border-subtle);
  display: grid;
  gap: var(--space-3);
  grid-template-columns: minmax(0, 1fr);
}
.pdp-benefits li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.pdp-benefits i {
  flex: none;
  font-size: 20px;
  line-height: 1.3;
  color: var(--t-accent);
}

/* The small print at the foot of the purchase card. */
.purchase-expiry-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: var(--space-4) 0 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-tertiary);
}
.purchase-expiry-note i { flex: none; font-size: 17px; }

/* ---------------- Tabbed detail ---------------- */
.pdp-detail { padding-bottom: var(--space-6); }

.pdp-tabs {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-5);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
}
.pdp-tabs::-webkit-scrollbar { display: none; }
.pdp-tabs[hidden] { display: none; }

.pdp-tab {
  flex: none;
  min-height: 48px;
  padding: 0 var(--space-3);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -3px;
  color: var(--text-tertiary);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 200ms ease-out, border-color 200ms ease-out;
}
.pdp-tab:hover { color: var(--text-secondary); }
.pdp-tab.is-active {
  color: var(--text-primary);
  border-bottom-color: var(--t-accent);
  font-weight: 600;
}
.pdp-tab[hidden] { display: none; }

.product-detail-section[hidden] { display: none; }

.product-detail-section h3 {
  /* Redundant once tabs are showing — the tab already names the section —
     but kept in the DOM so the page still reads correctly when only one
     section has content and the tab bar is suppressed. */
  margin: 0 0 var(--space-3);
  font-family: var(--t-display, 'Space Grotesk', sans-serif);
  font-weight: var(--t-display-weight, 600);
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.pdp-tabs:not([hidden]) ~ .pdp-panels .product-detail-section h3 {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Long-form reading: comfortable measure, generous leading. */
#product-description {
  margin: 0;
  max-width: 68ch;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-secondary);
  white-space: pre-line;   /* honour paragraph breaks in long_description */
}

/* Checklists, not paragraphs. */
#product-included,
#product-features {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 68ch;
  display: grid;
  gap: var(--space-3);
}
#product-included li,
#product-features li {
  position: relative;
  padding-left: var(--space-5);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-secondary);
}
#product-included li::before,
#product-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--t-accent);
}

.product-purchase-note {
  margin: 0 0 var(--space-6);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-tertiary);
}
.product-purchase-note a { color: var(--text-secondary); }

/* ---------------- Desktop ---------------- */
@media (min-width: 900px) {
  .pdp-hero {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: var(--space-6);
    padding-block: var(--space-5) var(--space-8);
  }

  /* Cover stays with the reader while they work down the purchase card. */
  .pdp-media {
    position: sticky;
    top: var(--space-4);
  }

  .pdp-card { padding: var(--space-5); }
  .pdp-benefits { gap: var(--space-3); }
  .product-detail-section h3 { font-size: 24px; }
  .pdp-tab { padding: 0 var(--space-4); font-size: 17px; }
}
