/*
 * product-page.css: shared styles for product description pages (Bootstrap 5 based).
 *
 * How to reuse for another product:
 *   1. Load Bootstrap 5 first (grid, buttons, spacing), then this file. No icon font is needed: icons are inline SVG.
 *   2. Wrap the whole page in <div class="product-page"> ... </div>.
 *   3. Change ONLY the theme variables below (or override them in a <style> block on the page).
 *
 * Everything is scoped under .product-page so nothing leaks into the surrounding site template.
 * Class names are product-neutral: product-hero, product-section, product-card, product-check, ...
 */

/* ---------- Theme (change these per product) ---------- */
.product-page {
  --brand: #2f6fb5;        /* main brand colour: eyebrows, icons, step numbers, price */
  --brand-dark: #1b4a80;   /* hero / call-to-action gradient start */
  --brand-light: #3b86d1;  /* hero gradient end */
  --brand-tint: #e6f0fa;   /* soft background for icons, badges, open accordion item */
  --accent: #287b35;       /* buy button and check marks; white text passes AA */
  --accent-dark: #1e6029;  /* buy button hover */
  --negative: #c0504d;     /* "look elsewhere" marks */
  --ink: #1f2d3d;          /* headings and body text */
  --muted: #5d6b7c;        /* secondary text */
  --soft: #f5f8fc;         /* alternate section background */
  --line: #e3eaf3;         /* card borders */
  --video-bg: #0d1b2a;     /* video placeholder background */
  color: var(--ink);
}

/* ---------- Typography ---------- */
.product-page h1,
.product-page h2,
.product-page h3 { color: var(--ink); font-weight: 700; }
.product-page .lead { color: var(--muted); }
.product-page { font-size: 1rem; line-height: 1.6; }
.product-page .row.g-5 { --bs-gutter-x: 1.5rem; margin-left: -.75rem; margin-right: -.75rem; }
.product-page .row.g-5 > * { padding-left: .75rem; padding-right: .75rem; }
.product-page a:focus-visible,
.product-page button:focus-visible,
.product-page summary:focus-visible { outline: 3px solid #d69b00; outline-offset: 4px; }

/* ---------- Inline SVG icons ---------- */
.product-svg { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.125em; }

/* ---------- Sections ---------- */
.product-section { padding: 4.5rem 0; }
.product-section--alt { background: var(--soft); }
.product-eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; color: var(--brand); }

/* ---------- Hero and call to action ---------- */
.product-hero { padding: 3rem 0; background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 70%, var(--brand-light) 100%); color: #fff; }
.product-hero h1,
.product-hero .lead { color: #fff; }
.product-hero .lead { opacity: .92; }
.product-hero h1 { font-size: clamp(2rem, 3.2vw, 2.75rem); line-height: 1.15; letter-spacing: -.025em; }
.product-hero .product-eyebrow { color: #fff; font-size: .9rem; }
.product-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.product-actions .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; }
.product-hero .product-actions .btn { font-size: 1rem; padding: .8rem 1rem; }
.product-hero .product-doc-link { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; color: #fff; font-size: 1rem; text-decoration: underline; text-underline-offset: .2em; }
.product-hero .product-doc-link:hover { color: #fff; text-decoration-thickness: 2px; }
.product-trust.product-release { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin-top: .5rem; }
.product-trust.product-release > span { margin: 0; }
.product-hero .product-caption,
.product-cta .lead { color: #fff; opacity: .95; }
.product-caption { font-size: .875rem; color: var(--muted); }
.product-hero .product-caption a { color: inherit; text-underline-offset: .2em; }
.product-cta { background: linear-gradient(135deg, var(--brand-dark), var(--brand)); color: #fff; }
.product-cta h2 { color: #fff; }

.btn.product-btn-buy { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.product-btn-buy:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn.product-btn-buy:focus-visible { color: #fff; background: var(--accent-dark); }

.product-trust span { display: inline-flex; align-items: center; gap: .4rem; margin-right: 1.1rem; font-size: .9rem; opacity: .9; }

/* Compatibility badges (for example "Joomla 4", "Joomla 5") */
.product-compat-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .8rem; border-radius: 999px; font-weight: 700; font-size: .9rem; margin: 0 .35rem .35rem 0; background: #fff; color: var(--brand-dark); }
.product-compat-badge .product-svg { color: var(--accent); }
.product-card .product-compat-badge { background: var(--brand-tint); }

/* ---------- Cards, icons, images ---------- */
.product-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 2px 10px rgba(31, 45, 61, .04); transition: transform .15s, box-shadow .15s; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(31, 45, 61, .09); }
.product-icon { width: 48px; height: 48px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-tint); color: var(--brand); font-size: 1.4rem; }
.product-feature-img { width: 100%; height: auto; border-radius: 24px; box-shadow: 0 14px 34px rgba(31, 45, 61, .12); }

/* ---------- Lists and steps ---------- */
.product-check { list-style: none; padding: 0; margin: 1rem 0 0; }
.product-check li { position: relative; padding-left: 1.7rem; margin-bottom: .55rem; color: var(--muted); }
.product-check li::before { content: ""; position: absolute; left: 0; top: .2em; width: 1.1em; height: 1.1em; background-color: var(--accent); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.product-check--cross li::before { background-color: var(--negative); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6L6 18' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6L6 18' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E"); }
.product-step { width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.product-price { font-size: 3.2rem; font-weight: 800; color: var(--brand); line-height: 1; }

/* ---------- Video (click to load, 16:9) ---------- */
.product-video { position: relative; border-radius: 18px; overflow: hidden; background: var(--video-bg); box-shadow: 0 20px 50px rgba(0, 0, 0, .35); aspect-ratio: 16 / 9; }
.product-video iframe,
.product-video img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.product-video-play { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; cursor: pointer; }
.product-video-play-icon {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 84px; height: 84px; border-radius: 50%; background: #fff; color: var(--brand);
  display: flex; align-items: center; justify-content: center; padding-left: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3); transition: transform .15s;
}
.product-video-play-icon svg { width: 2.4rem; height: 2.4rem; }
.product-video-play:hover .product-video-play-icon { transform: translate(-50%, -50%) scale(1.08); }

@media (max-width: 575.98px) {
  .product-section { padding: 3rem 0; }
  .product-page .row.g-5 { --bs-gutter-y: 2rem; margin-top: -2rem; }
  .product-page .row.g-5 > * { margin-top: 2rem; }
  .product-hero { padding: 2.5rem 0; }
  .product-hero .lead { font-size: 1.0625rem; line-height: 1.6; }
  .product-hero .product-actions .btn,
  .product-cta .product-actions .btn { flex: 1 1 100%; }
  .product-trust span { display: flex; margin: 0 0 .5rem; }
  .product-video-play-icon { width: 64px; height: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .product-page *, .product-page *::before, .product-page *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- FAQ (native <details>, no JavaScript needed) ---------- */
.product-faq-item { border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: .75rem; overflow: hidden; }
.product-faq-item summary { cursor: pointer; padding: 1rem 1.25rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.product-faq-item summary::-webkit-details-marker { display: none; }
.product-faq-item summary::after { content: ""; width: 1.1em; height: 1.1em; flex: none; background-color: var(--brand); transition: transform .2s; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.product-faq-item[open] summary { background: var(--brand-tint); }
.product-faq-item[open] summary::after { transform: rotate(180deg); }
.product-faq-body { padding: 1rem 1.25rem; color: var(--muted); }

/* Payment Form uses the shared layout with a static hero poster. */
.payment-form-page .product-hero-link { color: inherit; }
.payment-form-page .product-centered-heading { max-width: 720px; }
.payment-form-page .product-main-feature .product-feature-img { display: block; }

.product-layout-slider { position: relative; min-width: 0; margin: 0; padding: 0; border: 0; }
.product-layout-choice {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.product-layout-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: .75rem;
  padding: 4px;
  border: 1px solid #ccddec;
  border-radius: 12px;
  background-color: #edf5fc;
}
.product-layout-controls label {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: .3rem .12rem;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  font-size: .9rem;
  font-weight: 600;
}
.product-layout-controls label:hover { background-color: #fff; }
#product-layout-stacked:checked ~ .product-layout-controls label[for="product-layout-stacked"],
#product-layout-horizontal:checked ~ .product-layout-controls label[for="product-layout-horizontal"],
#product-layout-grid:checked ~ .product-layout-controls label[for="product-layout-grid"],
#product-layout-hidden:checked ~ .product-layout-controls label[for="product-layout-hidden"] {
  color: #fff;
  background-color: #155998;
}
#product-layout-stacked:focus-visible ~ .product-layout-controls label[for="product-layout-stacked"],
#product-layout-horizontal:focus-visible ~ .product-layout-controls label[for="product-layout-horizontal"],
#product-layout-grid:focus-visible ~ .product-layout-controls label[for="product-layout-grid"],
#product-layout-hidden:focus-visible ~ .product-layout-controls label[for="product-layout-hidden"] {
  outline: 2px solid #123b65;
  outline-offset: 2px;
}
.product-layout-window {
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(31, 45, 61, .12);
  background-color: #dceffc;
}
.product-layout-track { display: flex; transition: transform .25s ease; }
.product-layout-slide {
  display: block;
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  height: auto;
  visibility: hidden;
  transition: visibility 0s .25s;
}
#product-layout-horizontal:checked ~ .product-layout-window .product-layout-track { transform: translateX(-100%); }
#product-layout-grid:checked ~ .product-layout-window .product-layout-track { transform: translateX(-200%); }
#product-layout-hidden:checked ~ .product-layout-window .product-layout-track { transform: translateX(-300%); }
#product-layout-stacked:checked ~ .product-layout-window .product-layout-slide:nth-child(1),
#product-layout-horizontal:checked ~ .product-layout-window .product-layout-slide:nth-child(2),
#product-layout-grid:checked ~ .product-layout-window .product-layout-slide:nth-child(3),
#product-layout-hidden:checked ~ .product-layout-window .product-layout-slide:nth-child(4) {
  visibility: visible;
  transition-delay: 0s;
}
@media (prefers-reduced-motion: reduce) {
  .product-layout-track, .product-layout-slide { transition: none; }
}
@media (max-width: 575.98px) {
  .product-layout-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
  .payment-form-page .product-main-feature .row { flex-direction: column-reverse; }
}

/* ---------- Payment Form: key-points band under the hero ---------- */
.pmf-band { background: #fff; border-bottom: 1px solid var(--line); }
.pmf-band-list { list-style: none; margin: 0; padding: 1.1rem 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem 1.5rem; }
.pmf-band-list li { display: flex; gap: .7rem; align-items: flex-start; font-size: .9rem; color: var(--muted); line-height: 1.35; }
.pmf-band-list .product-svg { width: 1.6rem; height: 1.6rem; color: var(--brand); margin-top: .1rem; }
.pmf-band-list strong { display: block; color: var(--ink); font-size: .95rem; }
@media (max-width: 991.98px) { .pmf-band-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .pmf-band-list { grid-template-columns: 1fr; } }

/* ---------- Product page tabs (Joomla joomla-tab, used by the Documents Seller product layouts) ---------- */
.product-page .product-tabs { background: #fff; }
.product-page .product-tabs joomla-tab { display: block; margin: 0; }
.product-page .product-tabs joomla-tab > div[role="tablist"] {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: center; overflow-x: auto; scrollbar-width: thin;
  margin: 0; padding: 0 1rem; background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); box-shadow: none;
}
.product-page .product-tabs joomla-tab > div[role="tablist"] > button[role="tab"] {
  margin: 0; padding: 1.25rem 1.7rem 1.1rem; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  background: transparent; box-shadow: none; color: var(--muted); white-space: nowrap;
  font-size: .9375rem; font-weight: 600; line-height: 1.3; cursor: pointer;
  transition: color .15s, background-color .15s, border-color .15s;
}
.product-page .product-tabs joomla-tab > div[role="tablist"] > button[role="tab"]:hover { color: var(--brand); background: var(--soft); }
.product-page .product-tabs joomla-tab > div[role="tablist"] > button[role="tab"][aria-selected="true"] {
  color: var(--brand); border-bottom-color: var(--brand); background: var(--soft);
}
.product-page .product-tabs joomla-tab-element { padding: 0; border: 0; background: none; }
.product-page .product-tab-legacy { padding: 2.5rem 0 3rem; }
/* Same width as the standard product layout (no side padding), so galleries and tables keep their usual columns */
.product-page .product-tab-legacy .container { padding-left: 0; padding-right: 0; }
@media (max-width: 1399.98px) { .product-page .product-tab-legacy .container { padding-left: 1rem; padding-right: 1rem; } }
@media (max-width: 530px) {
  .product-page .product-tabs joomla-tab > div[role="tablist"] { justify-content: flex-start; padding: 0; }
  .product-page .product-tabs joomla-tab > div[role="tablist"] > button[role="tab"] { flex: 1 0 auto; padding-inline: .7rem; font-size: .8125rem; }
}
/* fallback: if the tabs are switched to an accordion on narrow screens */
.product-page .product-tabs joomla-tab > button[aria-expanded] {
  display: block; width: 100%; margin: 0; padding: 1rem 1.25rem; border: 0; border-bottom: 1px solid var(--line);
  background: var(--soft); color: var(--ink); font-weight: 700; text-align: left; box-shadow: none;
}
.product-page .product-tabs joomla-tab > button[aria-expanded="true"] { color: var(--brand); background: var(--brand-tint); }

/* The site template styles figcaption as a dark label: use the product page caption instead */
.product-page figcaption { background: none; padding: 0; text-transform: none; letter-spacing: normal; }
.product-hero figcaption.product-caption { color: rgba(255, 255, 255, .88); }

/* ---------- Documents Seller: in-page navigation (first tab) ---------- */
.documents-seller-page [id] { scroll-margin-top: 4.5rem; }
.documents-seller-page .product-nav { background: #fff; border-bottom: 1px solid var(--line); }
.documents-seller-page .product-nav ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .15rem 1.6rem; margin: 0; padding: .35rem 0; }
.documents-seller-page .product-nav a { display: inline-block; padding: .55rem 0; font-weight: 600; font-size: .95rem; color: var(--ink); text-decoration: none; border-bottom: 2px solid transparent; }
.documents-seller-page .product-nav a:hover { color: var(--brand); border-bottom-color: var(--brand); }
@media (max-width: 575.98px) { .documents-seller-page .product-nav ul { justify-content: flex-start; gap: .1rem 1.1rem; } }
