/* Product details page (product-details.php), 2026-11 redesign. Self-contained: no Tailwind classes needed. */
/* colour tokens: the floating buy bar and photo viewer sit outside .pd, so they get them too */
.pd, #floating-buy-bar, .pd-lb { --ink: #0f172a; --body: #334155; --muted: #64748b; --faint: #94a3b8; --line: #e2e8f0; --soft: #f6f8fb; --brand: #008a00; --brand-dark: #006d00; --brand-soft: #e7f6e7; --yellow: #ffbf00; --red: #dc2626; }
.pd { max-width: 1240px; margin: 0 auto; padding: 18px 16px 40px; color: var(--body); font-family: 'Montserrat', sans-serif; }
.pd *, .pd *::before, .pd *::after { box-sizing: border-box; }
.pd a { color: inherit; }

/* breadcrumb */
.pd-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.pd-crumbs a { text-decoration: none; } .pd-crumbs a:hover { color: var(--brand); }
.pd-crumbs li + li::before { content: '›'; margin-right: 6px; color: var(--faint); }
.pd-crumbs li:last-child { color: var(--ink); max-width: 60ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* top: gallery + buy box */
.pd-top { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .pd-top { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 44px; align-items: start; } .pd-gallery { position: sticky; top: 132px; } }

.pd-stage { position: relative; aspect-ratio: 1; border-radius: 26px; background: #fff; border: 1px solid var(--line); overflow: hidden; box-shadow: 0 30px 60px -40px rgba(15,23,42,.35); }
.pd-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 22px; transition: opacity .2s, transform .4s; cursor: zoom-in; }
.pd-stage:hover img { transform: scale(1.03); }
.pd-badges { position: absolute; top: 14px; left: 14px; display: flex; flex-direction: column; gap: 6px; z-index: 2; align-items: flex-start; }
.pd-badge { padding: 5px 11px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.pd-badge.is-new { background: var(--brand); } .pd-badge.is-refurb { background: #0369a1; } .pd-badge.sale { background: var(--red); } .pd-badge.hidden { display: none; }
.pd-zoom { position: absolute; right: 14px; bottom: 14px; z-index: 2; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.92); color: var(--ink); cursor: pointer; font-size: 15px; }
.pd-zoom:hover { color: var(--brand); border-color: var(--brand); }
.pd-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.92); color: var(--ink); cursor: pointer; opacity: 0; transition: opacity .2s; }
.pd-arrow.prev { left: 12px; } .pd-arrow.next { right: 12px; }
.pd-stage:hover .pd-arrow, .pd-arrow:focus-visible { opacity: 1; }
@media (hover: none) { .pd-arrow { opacity: 1; } }
.pd-thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding: 4px 2px; scrollbar-width: none; }
.pd-thumbs::-webkit-scrollbar { display: none; }
.pd-thumbs .thumbnail { flex: none; width: 76px; height: 76px; border-radius: 16px; border: 2px solid var(--line); background: #fff; padding: 6px; cursor: pointer; transition: border-color .15s, transform .15s; }
.pd-thumbs .thumbnail img { width: 100%; height: 100%; object-fit: contain; }
.pd-thumbs .thumbnail:hover { transform: translateY(-2px); }
.pd-thumbs .thumbnail.active { border-color: var(--brand); box-shadow: 0 8px 18px -10px rgba(0,138,0,.6); }
.pd-perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.pd-perks div { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 12px 8px; border-radius: 16px; background: var(--soft); font-size: 11.5px; font-weight: 700; color: var(--body); line-height: 1.35; }
.pd-perks i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #fff; color: var(--brand); font-size: 14px; }

/* buy box */
.pd-seller { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; margin-bottom: 12px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--body); text-decoration: none; }
.pd-seller:hover { border-color: var(--brand); color: var(--brand-dark); }
.pd-seller .fa-store { color: var(--brand); } .pd-seller .fa-circle-check { color: #0ea5e9; font-size: 12px; } .pd-seller small { color: var(--faint); font-weight: 600; }
.pd h1 { margin: 0; font-size: clamp(22px, 1.2rem + 1.3vw, 34px); line-height: 1.18; font-weight: 800; color: var(--ink); letter-spacing: -.02em; text-wrap: balance; overflow-wrap: anywhere; }
.pd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 12px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.pd-meta .pd-rate { display: inline-flex; align-items: center; gap: 8px; }
.pd-rate .pd-stars { display: inline-flex; gap: 2px; color: var(--yellow); font-size: 13px; }
#rev-stats-label { font-size: 13px; font-weight: 700; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.pd-meta .sep { width: 4px; height: 4px; border-radius: 50%; background: #cbd5e1; }

.pd-price { margin-top: 20px; padding: 20px; border-radius: 22px; background: linear-gradient(135deg, #f6fbf6, #fff 60%); border: 1px solid #dcefdc; }
.pd-price-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
#prod-price { font-size: clamp(30px, 1.4rem + 2vw, 42px); font-weight: 800; color: var(--ink); letter-spacing: -.03em; line-height: 1; white-space: nowrap; }
#prod-orig { font-size: 18px; font-weight: 700; color: var(--faint); text-decoration: line-through; white-space: nowrap; }
#prod-orig:empty { display: none; }
#pd-disc { padding: 4px 9px; border-radius: 8px; background: #fee2e2; color: #b91c1c; font-size: 12px; font-weight: 800; }
.pd-save { margin: 8px 0 0; font-size: 13.5px; font-weight: 700; color: #b91c1c; }
.pd-ends { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 0; padding: 5px 10px; border-radius: 10px; background: #fff7ed; color: #9a3412; font-size: 12.5px; font-weight: 700; }
.pd-small { margin: 8px 0 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.pd-stock { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; font-size: 13.5px; font-weight: 700; }
.pd-stock::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent); }
.pd-stock.ok { color: #15803d; } .pd-stock.low { color: #c2410c; } .pd-stock.out { color: var(--red); }

.pd-hl { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.pd-hl li { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); font-size: 12.5px; font-weight: 700; color: var(--ink); }
.pd-hl i { color: var(--brand); font-size: 11px; }

.pd-buy { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; margin-top: 18px; }
.pd-qty { display: inline-flex; align-items: center; height: 56px; border: 1.5px solid var(--line); border-radius: 16px; background: #fff; }
.pd-qty button { width: 42px; height: 100%; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; border-radius: 14px; }
.pd-qty button:hover { color: var(--brand); } .pd-qty button:disabled { opacity: .35; cursor: default; }
.pd-qty input { width: 38px; border: 0; text-align: center; font: 800 16px 'Montserrat', sans-serif; color: var(--ink); background: none; outline: none; -moz-appearance: textfield; }
.pd-qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.pd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 56px; padding: 0 20px; border-radius: 16px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font: 800 15px 'Montserrat', sans-serif; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .1s; }
.pd-btn:active { transform: scale(.98); }
.pd-btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 14px 28px -14px rgba(0,138,0,.7); }
.pd-btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.pd-btn.primary:disabled { background: #cbd5e1; border-color: #cbd5e1; box-shadow: none; cursor: not-allowed; }
.pd-btn.primary.in-cart { background: var(--ink); border-color: var(--ink); }
.pd-btn.icon { width: 56px; padding: 0; font-size: 19px; color: var(--muted); }
.pd-btn.icon:hover { color: var(--red); border-color: #fecaca; background: #fef2f2; }
.pd-btn.icon.on { color: var(--red); }
.pd-btn.wa { background: #25d366; border-color: #25d366; color: #fff; }
.pd-btn.wa:hover { background: #1ebe5b; }
.pd-btn.wa-line { border-color: #25d366; color: #0f7a5c; }
.pd-btn.wa-line:hover { background: #effcf4; }
.pd-btn.wa-line i, .pd-btn.wa-line .fa-whatsapp { color: #25d366; font-size: 18px; }
.pd-row2 { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 10px; }
.pd-row2 .pd-btn { height: 48px; font-size: 13.5px; font-weight: 700; }
.pd-row2 .pd-share { width: auto; padding: 0 16px; color: var(--body); }
.pd-row2 .pd-share:hover { border-color: var(--brand); color: var(--brand); }
:is(.pd-btn, .pd-qty button, .pd-zoom, .pd-arrow, .thumbnail):focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(0,138,0,.25); }

.pd-info-list { margin: 18px 0 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.pd-info-list li { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; font-size: 13px; color: var(--body); line-height: 1.5; }
.pd-info-list li + li { border-top: 1px solid var(--line); }
.pd-info-list i { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-size: 13px; }
.pd-info-list b { display: block; color: var(--ink); font-size: 13.5px; }
.pd-info-list a { color: var(--brand-dark); font-weight: 700; }

/* sections */
.pd-sec { margin-top: 44px; }
.pd-sec h2 { margin: 0 0 16px; font-size: clamp(19px, 1rem + .8vw, 24px); font-weight: 800; color: var(--ink); letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.pd-sec h2 i { color: var(--brand); font-size: .85em; }
.pd-details { display: grid; gap: 22px; }
@media (min-width: 960px) { .pd-details.two { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; } }
.pd-card { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 22px; }
#prod-desc { font-size: 15px; line-height: 1.8; color: #475569; overflow-wrap: anywhere; }
#prod-desc p { margin: 0 0 12px; } #prod-desc p:last-child { margin-bottom: 0; }
.pd-specs { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pd-specs th, .pd-specs td { padding: 11px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.pd-specs tr:last-child th, .pd-specs tr:last-child td { border-bottom: 0; }
.pd-specs th { width: 42%; color: var(--muted); font-weight: 700; }
.pd-specs th i { width: 18px; color: var(--faint); margin-right: 6px; font-size: 12px; }
.pd-specs td { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.pd-specs tr:nth-child(odd) { background: var(--soft); }
.pd .sk-dr { margin-top: 18px; border-radius: 20px; }

/* reviews */
.pd-rev-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 18px; }
.pd-rev-head h2 { margin: 0; }
.pd-rev-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.pd-rev-score { display: flex; align-items: center; gap: 16px; }
#avg-rating { padding: 8px 14px; border-radius: 14px; background: var(--yellow); color: #3b2f00; font-size: 17px; font-weight: 800; }
#rev-count { margin: 4px 0 0; font-size: 11.5px; font-weight: 700; color: var(--muted); text-align: right; }
#review-container { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); margin-bottom: 18px; }
#review-container > .col-span-full { grid-column: 1 / -1; }
.pd-rev-btn { display: flex; width: 100%; max-width: 420px; margin: 0 auto; }
.pd-rev-form { max-width: 620px; margin: 0 auto; padding: 22px; border-radius: 24px; background: var(--soft); border: 1px solid var(--line); }
.pd-rev-form h4 { margin: 0; text-align: center; font-size: 18px; font-weight: 800; color: var(--ink); }
.pd-rev-form h4 + p { margin: 4px 0 14px; text-align: center; font-size: 12px; font-weight: 700; color: var(--brand); }
#star-selector { display: flex; justify-content: center; gap: 10px; margin-bottom: 14px; font-size: 30px; }
#star-selector i { cursor: pointer; }
#review-comment { width: 100%; min-height: 110px; padding: 14px; border-radius: 16px; border: 1.5px solid var(--line); background: #fff; font: 500 14px 'Montserrat', sans-serif; color: var(--ink); resize: vertical; outline: none; margin-bottom: 12px; }
#review-comment:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(0,138,0,.1); }
.pd-rev-form .pd-btn { width: 100%; }
.hidden { display: none !important; }

/* related */
.pd-rel { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 230px); gap: 14px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.pd-rel a { scroll-snap-align: start; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 20px; background: #fff; overflow: hidden; text-decoration: none; transition: transform .2s, box-shadow .2s; }
.pd-rel a:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -24px rgba(15,23,42,.35); }
.pd-rel figure { position: relative; margin: 0; aspect-ratio: 1; background: var(--soft); }
.pd-rel figure img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.pd-rel figure span { position: absolute; top: 10px; left: 10px; padding: 3px 8px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; }
.pd-rel .b { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pd-rel h3 { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--ink); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pd-rel p { margin: auto 0 0; font-size: 15px; font-weight: 800; color: var(--ink); }
.pd-rel p s { margin-left: 4px; font-size: 12px; font-weight: 600; color: var(--faint); }
.pd-more { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--brand-dark); text-decoration: none; }

/* not found */
.pd-missing { max-width: 560px; margin: 40px auto; text-align: center; padding: 40px 24px; border: 1.5px dashed var(--line); border-radius: 26px; }
.pd-missing i { font-size: 36px; color: #cbd5e1; }
.pd-missing h1 { margin: 14px 0 8px; font-size: 24px; }
.pd-missing p { color: var(--muted); margin: 0 0 18px; }

/* image viewer */
.pd-lb { position: fixed; inset: 0; z-index: 3000; background: rgba(2,6,23,.92); display: none; align-items: center; justify-content: center; }
.pd-lb.open { display: flex; }
.pd-lb img { max-width: 94vw; max-height: 86vh; object-fit: contain; border-radius: 12px; background: #fff; }
.pd-lb button { position: absolute; border: 0; background: rgba(255,255,255,.12); color: #fff; width: 48px; height: 48px; border-radius: 50%; font-size: 18px; cursor: pointer; }
.pd-lb button:hover { background: rgba(255,255,255,.25); }
.pd-lb .x { top: 16px; right: 16px; } .pd-lb .l { left: 16px; top: 50%; transform: translateY(-50%); } .pd-lb .r { right: 16px; top: 50%; transform: translateY(-50%); }
.pd-lb .n { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: #cbd5e1; font-size: 13px; font-weight: 700; }

/* phone buy bar */
#floating-buy-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1900; display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.97); border-top: 1px solid var(--line); box-shadow: 0 -16px 30px -18px rgba(0,0,0,.25); transform: translateY(120%); transition: transform .35s; font-family: 'Montserrat', sans-serif; }
#floating-buy-bar.show { transform: none; }
#floating-buy-bar small { display: block; font-size: 11px; font-weight: 700; color: #64748b; }
#float-price { font-size: 18px; font-weight: 800; color: #0f172a; white-space: nowrap; }
#floating-buy-bar .pd-btn { flex: 1; height: 48px; font-size: 14px; }
#floating-buy-bar .pd-btn.icon { flex: none; width: 48px; }
@media (min-width: 768px) { #floating-buy-bar { display: none; } }

@media (max-width: 560px) {
    .pd { padding-top: 12px; }
    .pd-stage { border-radius: 20px; }
    .pd-stage img { padding: 14px; }
    .pd-thumbs .thumbnail { width: 64px; height: 64px; }
    .pd-perks div { font-size: 10.5px; padding: 10px 6px; }
    .pd-card { padding: 16px; border-radius: 20px; }
    .pd-specs th { width: 45%; }
    .pd-rel { grid-auto-columns: 46%; }
    .pd-price { padding: 16px; border-radius: 18px; }
    .pd-buy { gap: 8px; }
    .pd-qty { height: 52px; }
    .pd-qty button { width: 32px; }
    .pd-qty input { width: 28px; }
    .pd-btn { height: 52px; padding: 0 12px; font-size: 14px; gap: 8px; white-space: nowrap; }
    .pd-btn.icon { width: 52px; }
    .pd-row2 .pd-btn { height: 46px; }
    .pd-row2 .pd-share span { display: none; }
    .pd-info-list li { padding: 12px 14px; }
}
html.sk-tabs #floating-buy-bar { padding-bottom: 12px; }
@media (prefers-reduced-motion: reduce) { .pd-stage img, .pd-rel a, #floating-buy-bar { transition: none; } }

/* phones and small tablets: get the name and price on screen sooner */
@media (max-width: 959px) {
    .pd-top { gap: 16px; }
    .pd-crumbs { margin-bottom: 10px; flex-wrap: nowrap; overflow: hidden; }
    .pd-crumbs li:last-child { display: none; }
    .pd-gallery .pd-perks { display: none; }       /* the same points are in the list under the price */
    .pd-stage { aspect-ratio: 4 / 3; border-radius: 20px; box-shadow: none; }
    .pd-thumbs { margin-top: 10px; }
    .pd h1 { font-size: 21px; line-height: 1.25; }
    .pd-meta { margin-top: 8px; font-size: 12.5px; }
    .pd-price { margin-top: 14px; }
    #prod-price { font-size: 30px; }
    .pd-zoom { width: 38px; height: 38px; right: 10px; bottom: 10px; }
}

/* phones: the sticky buy bar replaces the back-to-top button, which covered the footer links */
@media (max-width: 767px) {
    #back-to-top { display: none !important; }
    footer { padding-bottom: 96px !important; }
}

/* very small phones (320–380px) */
@media (max-width: 380px) {
    .pd { padding-left: 12px; padding-right: 12px; }
    .pd-price { padding: 14px 12px; }
    .pd-qty button { width: 28px; }
    .pd-qty input { width: 24px; font-size: 15px; }
    .pd-btn { padding: 0 10px; font-size: 13px; gap: 6px; }
    .pd-btn.icon { width: 46px; }
    .pd-rev-score { flex-wrap: wrap; width: 100%; }
    .pd-rev-score .rv-bars { min-width: 0; width: 100%; }
}
@media (max-width: 380px) { .pd-buy #buy-btn i { display: none; } .pd-buy #buy-btn { overflow: hidden; } }
@media (max-width: 380px) {
    #floating-buy-bar { gap: 8px; padding-left: 10px; padding-right: 10px; }
    #float-price { font-size: 16px; }
    #floating-buy-bar .pd-btn.primary { min-width: 0; padding: 0 10px; font-size: 13px; }
    #floating-buy-bar .pd-btn.primary i { display: none; }
    #floating-buy-bar .pd-btn.icon { width: 44px; height: 44px; }
}
