/**
 * Storefront Pages — Neomorphism primitives shared by Shop, Product Detail,
 * Cart, Checkout, Wishlist, Account, and Policy/static pages.
 *
 * These pages are NOT part of the 8-family Theme Engine variant system (that
 * only covers the homepage). They get one dedicated Neomorphism treatment,
 * built from the same global color/shape tokens every family already uses
 * (--bg-color, --card-bg-color, --heading-color, --text-color, --muted-color,
 * --primary-color, --theme-radius-*) so they still track live Theme Customizer
 * edits, plus the same hardcoded soft-UI shadow recipe already established by
 * the homepage's neo.php variants (see e.g.
 * resources/views/storefront/sections/variants/product-card/neo.php).
 */

.sfp-page { padding: 2.5rem 0 4rem; }
.sfp-container { max-width: var(--theme-max-width, 1280px); margin: 0 auto; padding: 0 1.25rem; }

/* Checkout Continue button: same visual language as Add to Cart (same
   --add-to-cart-* / data-atc-* tokens), kept as its own class since those
   live in a per-family product-card file this button has no reason to
   depend on. */
.sfp-continue-btn {
    position: relative; isolation: isolate; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: none; padding: 16px 20px; border-radius: var(--add-to-cart-radius, 999px);
    font-size: 0.95rem; font-weight: 700; cursor: pointer;
    background: var(--add-to-cart-bg, #6655F5);
    color: var(--add-to-cart-text, #ffffff);
    box-sizing: border-box;
    transition: background-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease, opacity 0.2s ease;
}
.sfp-continue-btn .ccb-arrow { transition: transform 0.25s ease; }
.sfp-continue-btn:focus-visible { outline: 2px solid var(--add-to-cart-bg, #6655F5); outline-offset: 3px; }

body[data-atc-shadow="1"] .sfp-continue-btn { box-shadow: 0 8px 18px color-mix(in srgb, var(--add-to-cart-bg, #6655F5) 32%, transparent), 0 2px 5px rgba(0,0,0,0.18); }
body[data-atc-shadow="1"][data-atc-shadow-intensity="low"] .sfp-continue-btn { box-shadow: 0 4px 10px color-mix(in srgb, var(--add-to-cart-bg, #6655F5) 25%, transparent), 0 1px 3px rgba(0,0,0,0.14); }
body[data-atc-shadow="1"][data-atc-shadow-intensity="high"] .sfp-continue-btn { box-shadow: 0 12px 26px color-mix(in srgb, var(--add-to-cart-bg, #6655F5) 40%, transparent), 0 3px 7px rgba(0,0,0,0.24); }

.sfp-continue-btn::after {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: linear-gradient(115deg, transparent 40%, color-mix(in srgb, white 55%, transparent) 50%, transparent 60%);
    background-size: 220% 100%; background-position: 140% 0;
    opacity: 0; transition: opacity 0.2s ease;
}
.sfp-continue-btn:hover:not(:disabled)::after { opacity: 0.7; animation: ccb-shine 0.9s ease-out 1; }
@keyframes ccb-shine { from { background-position: 140% 0; } to { background-position: -40% 0; } }

.sfp-continue-btn:hover:not(:disabled) {
    background: var(--add-to-cart-hover-bg, #5646d6);
    transform: translateY(-2px) scale(1.015);
}
body[data-atc-shadow="1"] .sfp-continue-btn:hover:not(:disabled) { box-shadow: 0 12px 24px color-mix(in srgb, var(--add-to-cart-bg, #6655F5) 38%, transparent), 0 3px 7px rgba(0,0,0,0.22); }
.sfp-continue-btn:hover:not(:disabled) .ccb-arrow { transform: translateX(3px); }

.sfp-continue-btn:active:not(:disabled) {
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
    transform: translateY(0) scale(0.98);
}

.sfp-continue-btn:disabled {
    opacity: 0.5; cursor: not-allowed;
    box-shadow: none; transform: none;
}
.sfp-continue-btn:disabled::after { display: none; }

@media (prefers-reduced-motion: reduce) {
    .sfp-continue-btn { transition: background-color 0.15s ease; }
    .sfp-continue-btn:hover:not(:disabled), .sfp-continue-btn:active:not(:disabled) { transform: none; }
    .sfp-continue-btn:hover:not(:disabled)::after { animation: none; opacity: 0; }
}

@media (max-width: 640px) {
    .sfp-continue-btn { padding: 15px 18px; font-size: 0.98rem; }
}

.sfp-page-title { font-family: var(--theme-heading-font); font-weight: var(--theme-heading-weight, 600); color: var(--heading-color); font-size: 1.6rem; margin: 0 0 1.5rem; }

/* Raised surface — the default "molded from the background" card/panel. */
.sfp-panel {
    background: var(--card-bg-color);
    border-radius: var(--theme-radius-card, 24px);
    box-shadow: 8px 8px 16px rgba(163,171,186,0.45), -8px -8px 16px rgba(255,255,255,0.85);
}

/* Inset well — image containers, input fields, anything "pressed into" the surface. */
.sfp-well {
    background: var(--card-bg-color);
    border-radius: var(--theme-radius-image, 18px);
    box-shadow: inset 5px 5px 10px rgba(163,171,186,0.4), inset -5px -5px 10px rgba(255,255,255,0.75);
}

/* Raised button with a press-in (inset) active/pressed state — the family's
   signature interaction, matching .pc-neo-btn:active in the product card. */
.sfp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--card-bg-color); color: var(--heading-color);
    border: none; border-radius: var(--theme-radius-button, 18px);
    padding: 12px 28px; font-weight: 600; font-size: 0.95rem; cursor: pointer;
    box-shadow: 6px 6px 12px rgba(163,171,186,0.45), -6px -6px 12px rgba(255,255,255,0.85);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    text-decoration: none;
}
.sfp-btn:hover { transform: translateY(-1px); }
.sfp-btn:active, .sfp-btn[data-state="pressed"] {
    box-shadow: inset 4px 4px 8px rgba(163,171,186,0.5), inset -4px -4px 8px rgba(255,255,255,0.8);
    transform: translateY(0);
}
.sfp-btn-primary { color: var(--primary-color); }
.sfp-btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.sfp-btn-icon { padding: 10px; width: 40px; height: 40px; border-radius: 50%; }
.sfp-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Inset text input / select — the same well recipe as .sfp-well, tuned for form controls. */
.sfp-input {
    width: 100%; box-sizing: border-box;
    background: var(--card-bg-color); color: var(--text-color);
    border: none; border-radius: var(--theme-radius-input, 14px);
    padding: 13px 16px; font-size: 0.95rem; font-family: var(--theme-body-font);
    box-shadow: inset 4px 4px 8px rgba(163,171,186,0.4), inset -4px -4px 8px rgba(255,255,255,0.7);
    transition: box-shadow 0.15s ease;
}
.sfp-input:focus {
    outline: none;
    box-shadow: inset 5px 5px 10px rgba(163,171,186,0.5), inset -5px -5px 10px rgba(255,255,255,0.8), 0 0 0 2px color-mix(in srgb, var(--primary-color) 45%, transparent);
}
.sfp-input::placeholder { color: var(--muted-color); }

/* State dropdown — same inset "well" recipe as every other .sfp-input, just
   with the native select chrome swapped for a themed chevron so it doesn't
   look like a stray browser-default control sitting on a neomorphic
   surface. Color follows --heading-color/--muted-color like the rest of
   the theme (not a hardcoded gray), so it stays correct across presets. */
select.sfp-input.sfp-select {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    padding-right: 42px; cursor: pointer;
    background-image: var(--sfp-select-arrow, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 7l5 5 5-5'/%3E%3C/svg%3E"));
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px 16px;
}
select.sfp-input.sfp-select:invalid { color: var(--muted-color); }
select.sfp-input.sfp-select option { color: var(--text-color); background: var(--card-bg-color); }
select.sfp-input.sfp-select option[value=""] { color: var(--muted-color); }
.sfp-field { position: relative; margin-bottom: 1.1rem; }
.sfp-label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--muted-color); margin-bottom: 6px; }

/* Inline validation states (checkout-address-validate.js toggles these
   classes on .sfp-field; no markup/structure change needed elsewhere). */
.sfp-field.is-invalid .sfp-input { box-shadow: inset 4px 4px 8px rgba(163,171,186,0.4), inset -4px -4px 8px rgba(255,255,255,0.7), 0 0 0 2px color-mix(in srgb, #ef4444 55%, transparent); }
.sfp-field.is-valid .sfp-input { box-shadow: inset 4px 4px 8px rgba(163,171,186,0.4), inset -4px -4px 8px rgba(255,255,255,0.7), 0 0 0 2px color-mix(in srgb, #16a34a 40%, transparent); }
.sfp-field-check {
    position: absolute; right: 14px; top: 36px; color: #16a34a; font-size: 0.85rem;
    opacity: 0; transform: scale(0.6); transition: opacity 0.15s ease, transform 0.15s ease; pointer-events: none;
}
.sfp-field.is-valid .sfp-field-check { opacity: 1; transform: scale(1); }
.sfp-field-error {
    margin: 0; padding: 0; font-size: 0.78rem; color: #ef4444;
    max-height: 0; opacity: 0; overflow: hidden;
    transition: max-height 0.2s ease, opacity 0.2s ease, margin-top 0.2s ease;
}
.sfp-field-error.show { max-height: 40px; opacity: 1; margin-top: 6px; }

/* Raised or inset icon badge (checkmarks, category icons, nav glyphs). */
.sfp-icon-circle {
    display: flex; align-items: center; justify-content: center;
    width: 64px; height: 64px; border-radius: 50%; background: var(--card-bg-color); flex-shrink: 0;
    box-shadow: 6px 6px 12px rgba(163,171,186,0.45), -6px -6px 12px rgba(255,255,255,0.85);
    color: var(--primary-color);
}
.sfp-icon-circle-inset { box-shadow: inset 4px 4px 8px rgba(163,171,186,0.45), inset -4px -4px 8px rgba(255,255,255,0.8); }

/* Selectable pill (payment method, address type, filter chips) — raised by
   default, flips to inset + accent border when checked/active. */
.sfp-pill {
    display: flex; align-items: center; gap: 12px; cursor: pointer;
    background: var(--card-bg-color); border-radius: var(--theme-radius-button, 18px);
    padding: 14px 18px; box-shadow: 6px 6px 12px rgba(163,171,186,0.4), -6px -6px 12px rgba(255,255,255,0.8);
    transition: box-shadow 0.15s ease;
}
.sfp-pill.sfp-pill-active {
    box-shadow: inset 4px 4px 8px rgba(163,171,186,0.45), inset -4px -4px 8px rgba(255,255,255,0.8);
    color: var(--primary-color);
}

.sfp-empty { text-align: center; padding: 4rem 1.5rem; color: var(--muted-color); }
.sfp-empty .sfp-icon-circle { margin: 0 auto 1.25rem; width: 88px; height: 88px; }

@media (max-width: 640px) {
    .sfp-page { padding: 1.5rem 0 3rem; }
    .sfp-btn { padding: 11px 22px; }
}

/* ===========================================================
   Product Detail page — reuses the SAME add-to-cart visual language as
   Checkout's .sfp-continue-btn (itself already documented as "same visual
   language as Add to Cart, same --add-to-cart-*/data-atc-* tokens"), just
   extended here with the two behavior states the Home Page's product-card
   button (.pc-neo-btn in product-card/neo.php) has that Checkout's button
   never needed: the post-AJAX-add "success" color swap and the
   "bird-flies-to-cart" launch glow. Both are driven by the exact same
   data-atc-success/data-added/sf-bird-launch hooks cart-ajax.js already
   sets on ANY button it's told to animate — nothing page-specific about
   the JS, only these two extra CSS rules were missing here.
   =========================================================== */
body[data-atc-success="1"] .sfp-continue-btn[data-added] { background: var(--add-to-cart-hover-bg, #5646d6); }

.sfp-continue-btn.sf-bird-launch::before {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: inherit;
    background: radial-gradient(circle, color-mix(in srgb, var(--add-to-cart-bg, #6655F5) 55%, white), transparent 70%);
    opacity: 0;
    animation: sf-bird-launch-glow 0.7s ease-out 1;
}
@keyframes sf-bird-launch-glow { 0% { opacity: 0.85; transform: scale(0.8); } 40% { opacity: 0.6; transform: scale(1); } 100% { opacity: 0; transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .sfp-continue-btn.sf-bird-launch::before { animation: none !important; } }

/* Discount / Free Delivery badges — same visual recipe (shadow, radius,
   font, --badge-color/--accent-color tokens) as the Home Page product
   card's .pc-neo-chip/.pc-neo-chip-delivery, given their own class here
   since this page family isn't part of the 8-variant homepage dispatch
   (see file header) and so can't literally share that per-family file. */
.pd-badge-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; min-height: 24px; }
.pd-badge {
    font-size: 11px; font-weight: 800; letter-spacing: 0.2px; padding: 6px 12px; border-radius: 20px;
    color: var(--badge-color, var(--heading-color)); background: var(--card-bg-color);
    box-shadow: 3px 3px 6px rgba(163,171,186,0.45), -3px -3px 6px rgba(255,255,255,0.85);
    white-space: nowrap; display: inline-flex; align-items: center; gap: 4px;
}
.pd-badge-delivery { color: var(--accent-color, #16a34a); margin-left: auto; }

/* Rating + category pills above the product title. */
.pd-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.pd-rating-pill {
    display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 20px;
    font-size: 0.8rem; font-weight: 800; color: var(--rating-color, var(--heading-color));
    background: linear-gradient(135deg, color-mix(in srgb, white 8%, var(--card-bg-color)), var(--card-bg-color));
    box-shadow: 3px 3px 6px rgba(163,171,186,0.4), -3px -3px 6px rgba(255,255,255,0.8);
}
.pd-rating-pill-star { color: #f0a527; font-size: 0.85em; }
.pd-category-pill {
    display: inline-flex; align-items: center; padding: 5px 14px; border-radius: 20px;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
    color: var(--muted-color); background: var(--card-bg-color);
    box-shadow: inset 3px 3px 6px rgba(163,171,186,0.35), inset -3px -3px 6px rgba(255,255,255,0.7);
}

.pd-title { font-family: var(--theme-heading-font); font-weight: var(--theme-heading-weight, 700); color: var(--heading-color); font-size: 1.9rem; margin: 0 0 6px; line-height: 1.3; letter-spacing: 0.2px; overflow-wrap: anywhere; }
.pd-subtitle { color: var(--muted-color); font-size: 0.92rem; margin: 0 0 18px; }
.pd-subtitle + .pd-subtitle { margin-top: -12px; }

/* Price card — inset well, same recipe as .sfp-well. */
.pd-price-card { padding: 18px 20px; margin-bottom: 18px; }
.pd-price-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted-color); margin: 0 0 8px; }
.pd-price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 6px; }
.pd-price { font-size: 1.75rem; font-weight: 800; color: var(--price-color, var(--primary-color)); }
.pd-mrp { font-size: 1rem; color: var(--muted-color); text-decoration: line-through; }
.pd-savings { font-size: 0.88rem; font-weight: 700; color: var(--accent-color, #16a34a); }
.pd-tax-note { font-size: 0.8rem; color: var(--muted-color); margin: 0; }

/* Delivery / Return / Safe Pack info cards. */
.pd-info-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.pd-info-card {
    display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
    padding: 14px 8px; border-radius: var(--theme-radius-card, 20px);
    background: var(--card-bg-color); box-shadow: 6px 6px 12px rgba(163,171,186,0.4), -6px -6px 12px rgba(255,255,255,0.8);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pd-info-card:hover { transform: translateY(-2px); box-shadow: 8px 8px 16px rgba(163,171,186,0.45), -8px -8px 16px rgba(255,255,255,0.85); }
.pd-info-card-icon {
    width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: var(--card-bg-color); box-shadow: inset 3px 3px 6px rgba(163,171,186,0.4), inset -3px -3px 6px rgba(255,255,255,0.75);
    color: var(--primary-color); font-size: 1.05rem;
}
.pd-info-card-label { font-size: 0.78rem; font-weight: 700; color: var(--heading-color); }

/* Compact site-wide offer indicator — the .ot-badge markup/state itself
   lives in storefront/partials/offer-tracker.php (renderOfferBadge()),
   this just adds the same bottom spacing every sibling block on this page
   already has. */
.pd-offer-indicator { margin-bottom: 18px; }

/* Return & Refund Support panel. */
.pd-refund-panel { padding: 16px 18px; margin-bottom: 18px; }
.pd-panel-heading { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; font-weight: 700; color: var(--heading-color); margin: 0 0 10px; }
.pd-refund-panel p { font-size: 0.86rem; color: var(--muted-color); line-height: 1.6; margin: 0; }

.pd-qty-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pd-qty-row label { font-size: 0.85rem; color: var(--muted-color); font-weight: 600; }
.pd-qty-row .sfp-input { width: 84px; text-align: center; }

/* Gallery — main image well + prev/next arrows + thumbnail strip.
   SCOPED to .pd-gallery-main (shop/show.php's Product Page main image
   only) — nothing here is a global `img` rule, and no other page's
   markup references this class.

   Box shape: the wrap's HEIGHT is a viewport-relative clamp() (scales
   with real screen size, never a pixel number tuned to one image)
   instead of being forced into a rigid square — a forced square would
   leave visible side gutters for this store's mostly-portrait photos,
   since object-fit: contain can never crop to fill a mismatched axis.

   Image fill — the actual fix: the <img> is forced to `width:100%;
   height:100%` (fills the box completely, regardless of the source
   photo's own pixel dimensions) and `object-fit: contain` does the
   real work of scaling the image's visual content — UP or DOWN — to
   the largest size that fits both axes without cropping or distorting.
   The previous version used `width:auto; height:auto` with only
   max-width/max-height cap — that only ever SHRINKS an image down to
   fit, it can never enlarge one, so any product photo whose native
   resolution was smaller than the box (common — not every upload is
   full-resolution) rendered at its tiny native pixel size, floating in
   a sea of empty padding, no matter how big the container was.
   object-fit: contain was never actually doing anything for those
   photos because the <img> box already matched the image's own
   intrinsic size — there was no size mismatch left for it to resolve.
   Forcing the box to 100%/100% is what makes object-fit: contain
   actually scale every photo — big or small, any aspect ratio — up or
   down to fill the maximum practical space, centered, undistorted,
   uncropped. */
.pd-gallery-main-wrap { position: relative; }
.pd-gallery-main { display: flex; align-items: center; justify-content: center; width: 100%; height: clamp(260px, 48vw, 640px); padding: 2rem; box-sizing: border-box; }
.pd-gallery-main img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; transition: opacity 0.15s ease; }
.pd-nav-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
    width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
    background: var(--card-bg-color); color: var(--heading-color);
    box-shadow: 4px 4px 8px rgba(163,171,186,0.45), -4px -4px 8px rgba(255,255,255,0.85);
}
.pd-nav-arrow:hover { color: var(--primary-color); }
.pd-nav-arrow:active { box-shadow: inset 3px 3px 6px rgba(163,171,186,0.5), inset -3px -3px 6px rgba(255,255,255,0.8); }
.pd-nav-prev { left: 8px; }
.pd-nav-next { right: 8px; }
.pd-thumbs { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.pd-thumb { padding: 4px; cursor: pointer; transition: box-shadow 0.15s ease; }
.pd-thumb img { width: 60px; height: 60px; object-fit: cover; border-radius: var(--theme-radius-image, 14px); display: block; }
.pd-thumb.pd-thumb-active { box-shadow: inset 3px 3px 6px rgba(163,171,186,0.5), inset -3px -3px 6px rgba(255,255,255,0.8), 0 0 0 2px color-mix(in srgb, var(--primary-color) 55%, transparent); }

/* Product Description section below the main grid. */
.pd-section { margin-top: 2.5rem; }

/* Description card — icon heading, sanitized rich-text body (see
   sf_safe_html() in public/index.php — raw admin/CSV-authored HTML is
   parsed and whitelist-filtered there, never shown as literal <p> text
   and never rendered unsanitized), metadata chips, tag chips. */
.pd-description-card { padding: 1.75rem 2rem; }
.pd-description-heading { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; margin: 0 0 1rem; }

.pd-description-text { color: var(--text-color); line-height: 1.7; font-size: 0.95rem; overflow-wrap: anywhere; }
.pd-description-text + .pd-description-text { margin-top: 4px; }
.pd-description-text p { margin: 0 0 0.85em; }
.pd-description-text p:last-child { margin-bottom: 0; }
.pd-description-text strong, .pd-description-text b { color: var(--heading-color); font-weight: 700; }
.pd-description-text h2, .pd-description-text h3, .pd-description-text h4 { color: var(--heading-color); font-family: var(--theme-heading-font); margin: 1.1em 0 0.5em; line-height: 1.3; }
.pd-description-text h2 { font-size: 1.2rem; }
.pd-description-text h3 { font-size: 1.08rem; }
.pd-description-text h4 { font-size: 1rem; }
.pd-description-text ul, .pd-description-text ol { margin: 0 0 0.85em; padding-left: 1.4em; }
.pd-description-text li { margin-bottom: 0.35em; }
.pd-description-text table { width: 100%; border-collapse: collapse; margin: 0 0 0.85em; font-size: 0.9rem; }
.pd-description-text td, .pd-description-text th { padding: 8px 10px; border-bottom: 1px solid color-mix(in srgb, var(--muted-color) 20%, transparent); text-align: left; }

.pd-meta-chip-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 1.5rem; }
.pd-meta-chip {
    display: flex; flex-direction: column; gap: 4px; padding: 12px 14px;
    border-radius: var(--theme-radius-card, 16px); background: var(--card-bg-color);
    box-shadow: inset 3px 3px 6px rgba(163,171,186,0.35), inset -3px -3px 6px rgba(255,255,255,0.7);
}
.pd-meta-chip-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.5px; color: var(--muted-color); }
.pd-meta-chip-value { font-size: 0.9rem; font-weight: 700; color: var(--heading-color); overflow-wrap: anywhere; }

.pd-tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.25rem; }
.pd-tag-chip {
    font-size: 0.8rem; font-weight: 600; padding: 6px 12px; border-radius: 20px;
    color: var(--primary-color); background: var(--card-bg-color);
    box-shadow: 3px 3px 6px rgba(163,171,186,0.4), -3px -3px 6px rgba(255,255,255,0.8);
    white-space: nowrap;
}

/* ===========================================================
   Add to Cart — animated "electricity" border. Same technique already
   shipped on the Home Page product card (product-card/neo.php's
   .pc-neo::before/::after "Electric animated border") — a soft blurred
   ambient glow plus a rotating conic-gradient ring, masked to a hollow
   outline so it reads as energy traveling the perimeter rather than a
   filled shape. Recolored from that component's decorative rainbow to
   the Add to Cart button's OWN colors (--add-to-cart-bg/-hover-bg) so it
   reads as "this button's energy", not an unrelated color scheme, and
   still updates live if the admin changes those colors in Theme
   Customizer. Pure CSS (no JS, no spawned elements) — cheap enough to run
   on every Product Detail page load, smooth because it only animates a
   custom-property angle + opacity (GPU-friendly), and stays entirely
   outside the button's own box (a separate wrapping element, absolutely
   positioned pseudo-elements, pointer-events:none) so it can never affect
   the button's text, size, layout, or click area.
   =========================================================== */
.pd-atc-electric { position: relative; isolation: isolate; display: block; width: 100%; border-radius: var(--add-to-cart-radius, 999px); }

.pd-atc-electric::before {
    content: ""; position: absolute; inset: -7px; z-index: -1; pointer-events: none;
    border-radius: inherit;
    background:
        radial-gradient(ellipse at 25% 20%, color-mix(in srgb, var(--add-to-cart-bg, #6655F5) 55%, transparent), transparent 62%),
        radial-gradient(ellipse at 78% 75%, color-mix(in srgb, var(--add-to-cart-hover-bg, #5646d6) 50%, transparent), transparent 62%);
    filter: blur(9px);
    opacity: 0.4;
    transition: opacity 0.35s ease;
}
.pd-atc-electric::after {
    content: ""; position: absolute; inset: -2px; z-index: 1; pointer-events: none;
    border-radius: inherit; padding: 1.5px;
    background: conic-gradient(from var(--pd-atc-angle, 0deg),
        var(--add-to-cart-bg, #6655F5) 0%, transparent 12%, transparent 22%,
        #ffffff 30%, transparent 40%, transparent 55%,
        var(--add-to-cart-hover-bg, #5646d6) 63%, transparent 76%, transparent 90%,
        var(--add-to-cart-bg, #6655F5) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: 0.65;
    animation: pd-atc-electric-spin 3.4s linear infinite;
}
@property --pd-atc-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes pd-atc-electric-spin { to { --pd-atc-angle: 360deg; } }

.pd-atc-electric:hover::before { opacity: 0.6; }
.pd-atc-electric:hover::after { opacity: 1; }

/* Click pulse — cart-ajax.js already adds .sf-bird-launch to the button
   itself for ~750ms after a successful Add to Cart (used elsewhere for the
   "bird flies to cart" launch glow); reusing that same hook here via
   :has() means the click-triggered intensify needs no JS changes at all,
   and can never fire out of sync with the real add-to-cart result since
   it's driven by the same successful-response signal. */
.pd-atc-electric:has(.sf-bird-launch)::before { opacity: 0.95; }
.pd-atc-electric:has(.sf-bird-launch)::after { opacity: 1; animation-duration: 0.9s; }

@media (prefers-reduced-motion: reduce) {
    .pd-atc-electric::after { animation: none !important; opacity: 0.55; }
    .pd-atc-electric::before { opacity: 0.3; }
}

@media (max-width: 640px) {
    .pd-title { font-size: 1.4rem; }
    .pd-info-cards { gap: 8px; }
    .pd-info-card { padding: 12px 6px; }
    .pd-gallery-main { padding: 1rem; }
    .pd-description-card { padding: 1.25rem 1.4rem; }
    .pd-meta-chip-row { grid-template-columns: repeat(2, 1fr); }
}

/* Related Products carousel — reuses the SAME shared carousel utility as
   the Home Page's Featured Products / Best Sellers / New Arrivals rows
   (.sf-carousel-wrap/.sf-carousel-track.product-grid, wired up by
   public/assets/js/carousel.js's initCarousel(); auto-slide is opt-in via
   data-autoslide on the wrap, see that file — the homepage carousels don't
   set it, so they're unaffected). Only the per-card WIDTH is overridden
   here (scoped to .pd-related-carousel, not the shared selector) to hit
   this section's own requested card-count-per-breakpoint, without changing
   how many cards the untouched homepage carousels show. */
.pd-related-heading { margin-bottom: 4px; }
.pd-related-subtitle { color: var(--muted-color); font-size: 0.92rem; margin: 0 0 1.25rem; }
.pd-related-carousel .sf-carousel-track.product-grid { margin-top: 0; }
/* Card WIDTH — restored to the exact pre-orbit cqw formulas (this section's
   own higher density than the homepage default: 5.5 "cards" of viewport
   width above 1440px, 4.5 between 1024-1440px). --orbit-card-w is the same
   custom property the shared .sf-carousel-track rule-set in storefront.css
   reads for both card size AND stage height, so overriding it here is the
   direct equivalent of the old per-breakpoint width override; --orbit-gap
   (fan spacing, not card size) recomputes automatically since it's derived
   from --orbit-card-w by the shared rule, not set separately. */
.pd-related-carousel .sf-carousel-track.product-grid {
    --orbit-card-w: calc((100cqw - 4 * var(--theme-grid-gap, 24px)) / 5.5);
}
@media (max-width: 1440px) {
    .pd-related-carousel .sf-carousel-track.product-grid { --orbit-card-w: calc((100cqw - 3 * var(--theme-grid-gap, 24px)) / 4.5); }
}
/* At and below 1024px this section deliberately gives up its own density
   and mirrors the shared .sf-carousel-track.product-grid values in
   storefront.css exactly (tablet ~2 cards, mobile one-main-card-plus-peek)
   — repeated here rather than left to fall through, because the higher
   selector specificity of ".pd-related-carousel …" would otherwise keep
   winning over the shared rule at every width, not just >1024px. */
@media (max-width: 1024px) {
    .pd-related-carousel .sf-carousel-track.product-grid { --orbit-card-w: calc((100cqw - 2 * 15px) / 2.6); }
}
@media (max-width: 640px) {
    .pd-related-carousel .sf-carousel-track.product-grid { --orbit-card-w: 58cqw; }
}

/* ===========================================================
   Ratings & Reviews — pulls only from the existing reviews table via
   Review::forProductPaged()/ratingSummaryForProduct()/
   ratingDistributionForProduct() (see ShopController::show()); nothing
   here is a separate review store. Same Neomorphism recipe as the rest of
   this page family.
   =========================================================== */
.pd-reviews-card { padding: 1.75rem 2rem; }
.pd-reviews-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.pd-reviews-title { font-family: var(--theme-heading-font); color: var(--heading-color); font-size: 1.15rem; margin: 0; }
.pd-reviews-subtitle { color: var(--muted-color); font-size: 0.88rem; margin: 4px 0 0; }
.pd-reviews-avg-badge {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px;
    font-size: 1.1rem; font-weight: 800; color: var(--heading-color);
    padding: 8px 16px; border-radius: 20px; background: var(--card-bg-color);
    box-shadow: 3px 3px 6px rgba(163,171,186,0.4), -3px -3px 6px rgba(255,255,255,0.8);
}
.pd-reviews-avg-star { color: #f0a527; font-size: 0.85em; }

.pd-reviews-summary { display: grid; grid-template-columns: auto 1fr; gap: 2.5rem; align-items: center; padding: 1.25rem 0; margin-bottom: 1.5rem; border-top: 1px solid color-mix(in srgb, var(--muted-color) 18%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--muted-color) 18%, transparent); }
.pd-reviews-summary-left { text-align: center; min-width: 140px; }
.pd-reviews-big-avg { font-size: 2.75rem; font-weight: 800; color: var(--heading-color); line-height: 1; }
.pd-reviews-overall-label { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 0.85rem; font-weight: 600; color: var(--text-color); margin: 8px 0 4px; }
.pd-reviews-based-on { font-size: 0.78rem; color: var(--muted-color); margin: 0; }

.pd-reviews-summary-right { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pd-rating-bar-row { display: grid; grid-template-columns: 42px 1fr 28px; align-items: center; gap: 10px; }
.pd-rating-bar-label { font-size: 0.8rem; font-weight: 600; color: var(--text-color); white-space: nowrap; }
.pd-rating-bar-track { height: 8px; border-radius: 999px; background: var(--card-bg-color); box-shadow: inset 2px 2px 4px rgba(163,171,186,0.4), inset -2px -2px 4px rgba(255,255,255,0.7); overflow: hidden; }
.pd-rating-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 70%, #f0a527)); transition: width 0.5s ease; }
.pd-rating-bar-count { font-size: 0.78rem; color: var(--muted-color); text-align: right; }

.pd-review-list { display: flex; flex-direction: column; }
.pd-review-item { padding: 1.1rem 0; border-bottom: 1px solid color-mix(in srgb, var(--muted-color) 15%, transparent); }
.pd-review-item:last-child { border-bottom: none; padding-bottom: 0; }
.pd-review-item:first-child { padding-top: 0; }
.pd-review-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.pd-review-rating-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 0.8rem; font-weight: 800; color: var(--heading-color); background: var(--card-bg-color); padding: 3px 10px; border-radius: 20px; box-shadow: 2px 2px 5px rgba(163,171,186,0.4), -2px -2px 5px rgba(255,255,255,0.8); }
.pd-review-rating-star { color: #f0a527; font-size: 0.85em; }
.pd-review-item-title { font-weight: 700; color: var(--heading-color); font-size: 0.98rem; overflow-wrap: anywhere; }
.pd-review-item-text { color: var(--text-color); line-height: 1.6; margin: 0 0 8px; overflow-wrap: anywhere; word-break: break-word; font-size: 0.92rem; }
.pd-review-meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.8rem; color: var(--muted-color); }
.pd-review-avatar-dot { color: var(--muted-color); font-size: 0.5rem; }
.pd-review-name { font-weight: 600; color: var(--text-color); }
.pd-review-verified-badge { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.3px; color: var(--accent-color, #16a34a); background: color-mix(in srgb, var(--accent-color, #16a34a) 12%, transparent); padding: 2px 8px; border-radius: 10px; }
.pd-review-date { color: var(--muted-color); }

.pd-view-all-reviews-btn { display: block; margin: 1.5rem auto 0; }

.pd-reviews-empty { text-align: center; padding: 2rem 1rem 0.5rem; }
.pd-reviews-empty-title { font-weight: 700; color: var(--heading-color); font-size: 1.05rem; margin: 0 0 4px; }
.pd-reviews-empty-text { color: var(--muted-color); font-size: 0.9rem; margin: 0; }

@media (max-width: 640px) {
    .pd-reviews-card { padding: 1.25rem 1.4rem; }
    .pd-reviews-summary { grid-template-columns: 1fr; gap: 1.25rem; text-align: center; }
    .pd-reviews-summary-left { min-width: 0; }
    .pd-rating-bar-row { grid-template-columns: 36px 1fr 24px; gap: 8px; }
    .pd-view-all-reviews-btn { width: 100%; }
}

/* ===========================================================
   Checkout Electric Border — decorative "live electricity" current
   traveling the perimeter of the checkout form panel. Structure is built
   by public/assets/js/checkout-electric.js (an SVG overlay, ResizeObserver-
   driven so it auto-follows the panel's actual size/shape); everything
   below is purely visual. Colors/speed/brightness/etc. come from Theme
   Customizer -> Checkout Electric Border via the --checkout-electric-*
   custom properties set in layouts/frontend.php's :root block.
   =========================================================== */
.checkout-electric-frame { position: relative; }
.ce-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; overflow: visible; }

/* Layer 1 — very soft ambient halo: thick, heavily blurred, static (no
   dash animation of its own) so it just reads as a faint aura around the
   whole panel, not a moving shape. */
.ce-glow-soft {
    stroke: var(--checkout-electric-glow, #93c5fd);
    stroke-width: calc(var(--checkout-electric-border-width, 2px) * 6);
    opacity: calc(var(--checkout-electric-opacity, 0.8) * 0.28);
    filter: blur(calc(var(--checkout-electric-blur, 7px) * 1.6));
}

/* Layer 2 — medium glow: the blurred halo of the moving current itself,
   same dash pattern + animation as the core so it visibly trails it. */
.ce-glow-med {
    stroke: var(--checkout-electric-secondary, #60a5fa);
    stroke-width: calc(var(--checkout-electric-border-width, 2px) * 3);
    stroke-linecap: round;
    opacity: calc(var(--checkout-electric-opacity, 0.8) * 0.55);
    filter: blur(var(--checkout-electric-blur, 7px));
    animation: ce-current-flow var(--checkout-electric-cycle-ms, 6500ms) linear infinite;
}

/* Layer 3 — bright core: crisp (no blur), irregular dasharray so it reads
   as segmented current rather than a smooth ring, plus a subtle flicker
   layered on as a second, independent animation. */
.ce-core {
    stroke: var(--checkout-electric-bright, #eff6ff);
    stroke-width: var(--checkout-electric-border-width, 2px);
    stroke-linecap: round;
    opacity: var(--checkout-electric-opacity, 0.8);
    animation:
        ce-current-flow var(--checkout-electric-cycle-ms, 6500ms) linear infinite,
        ce-flicker 2.6s ease-in-out infinite;
}
@keyframes ce-current-flow { to { stroke-dashoffset: var(--ce-perimeter, -400); } }
@keyframes ce-flicker {
    0%, 100% { opacity: var(--checkout-electric-opacity, 0.8); }
    46% { opacity: var(--checkout-electric-opacity, 0.8); }
    48% { opacity: calc(var(--checkout-electric-opacity, 0.8) * 0.55); }
    50% { opacity: var(--checkout-electric-opacity, 0.8); }
    74% { opacity: calc(var(--checkout-electric-opacity, 0.8) * 0.7); }
    76% { opacity: var(--checkout-electric-opacity, 0.8); }
}

/* Layer — occasional pulse: one distinct bright blob (short dash, huge
   gap so only one is ever visible) traveling the full perimeter once per
   cycle, independent of and slower than the continuous current above. */
.ce-pulse {
    stroke: var(--checkout-electric-bright, #eff6ff);
    stroke-width: calc(var(--checkout-electric-border-width, 2px) * 2.2);
    stroke-linecap: round;
    stroke-dasharray: 34 3000;
    opacity: calc(var(--checkout-electric-opacity, 0.8) * 0.9);
    filter: blur(calc(var(--checkout-electric-blur, 7px) * 0.5));
    animation: ce-pulse-flow 3.2s linear infinite;
}
@keyframes ce-pulse-flow { to { stroke-dashoffset: -3034; } }

.ce-spark {
    fill: var(--checkout-electric-bright, #eff6ff);
    filter: drop-shadow(0 0 3px var(--checkout-electric-glow, #93c5fd));
}
.ce-branch {
    stroke: var(--checkout-electric-secondary, #60a5fa);
    stroke-width: 1.2px;
    stroke-linecap: round;
    filter: drop-shadow(0 0 2px var(--checkout-electric-glow, #93c5fd));
}

/* Hover / focus-within — more active current, per spec (brighter, no
   aggressive flashing). Pure CSS, no JS involved. */
.checkout-electric-frame:hover .ce-core,
.checkout-electric-frame:focus-within .ce-core {
    opacity: calc(var(--checkout-electric-opacity, 0.8) * 1.15);
}
.checkout-electric-frame:hover .ce-glow-med,
.checkout-electric-frame:focus-within .ce-glow-med {
    opacity: calc(var(--checkout-electric-opacity, 0.8) * 0.7);
}
.checkout-electric-frame:hover .ce-core,
.checkout-electric-frame:focus-within .ce-core {
    animation-duration: calc(var(--checkout-electric-cycle-ms, 6500ms) * 0.75), 2.6s;
}
.checkout-electric-frame:hover .ce-glow-med,
.checkout-electric-frame:focus-within .ce-glow-med {
    animation-duration: calc(var(--checkout-electric-cycle-ms, 6500ms) * 0.75);
}

/* Submit / validation reactions (see checkout-electric.js's passive
   submit/invalid listeners) — brief, then automatically removed. */
.checkout-electric-frame.ce-intensify .ce-core { opacity: 1; }
.checkout-electric-frame.ce-intensify .ce-glow-med { opacity: calc(var(--checkout-electric-opacity, 0.8) * 0.9); }
.checkout-electric-frame.ce-error-react .ce-core { animation-duration: calc(var(--checkout-electric-cycle-ms, 6500ms) * 0.5), 0.35s; }

/* Reduced motion — static soft border/glow only, no travelling current,
   no spawned sparks/branches (checkout-electric.js skips creating those
   entirely in this state, this is just the visual fallback). */
.checkout-electric-frame.ce-reduced .ce-core,
.checkout-electric-frame.ce-reduced .ce-glow-med { animation: none; stroke-dasharray: none; opacity: var(--checkout-electric-opacity, 0.8); }
.checkout-electric-frame.ce-reduced .ce-pulse { display: none; }

@media (prefers-reduced-motion: reduce) {
    .ce-core, .ce-glow-med, .ce-pulse { animation: none !important; }
    .ce-pulse { display: none; }
}
