/* ============================================================
   Product cards (storefront) — driven entirely by the CSS custom
   properties emitted per card by static/js/product-card-model.js.
   Loaded after /static/css/app.css. Logical properties only, so RTL
   comes for free from the document's dir="rtl".

   Breakpoints (match the storefront): mobile <768, tablet 768–1023,
   desktop >=1024. Hover styling is always guarded by
   (hover:hover) and (pointer:fine) so touch devices are never left
   with unreachable actions.
   ============================================================ */

/* ---------------- Grid ---------------- */
.pc-grid {
    display: grid;
    grid-template-columns: repeat(var(--pc-cols-mobile, 2), minmax(0, 1fr));
    gap: var(--pc-gap-mobile, 16px);
    align-items: stretch;
}
@media (min-width: 768px) and (max-width: 1023.98px) {
    .pc-grid {
        grid-template-columns: repeat(var(--pc-cols-tablet, 3), minmax(0, 1fr));
        gap: var(--pc-gap-tablet, 16px);
    }
}
@media (min-width: 1024px) {
    .pc-grid {
        grid-template-columns: repeat(var(--pc-cols-desktop, 4), minmax(0, 1fr));
        gap: var(--pc-gap-desktop, 24px);
    }
}
.pc-grid-auto {
    align-items: start;
}
.pc-grid-equal > .pc-card {
    height: 100%;
}

/* ---------------- Card chrome ---------------- */
.pc-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--pc-card-bg, #FFFFFF);
    border: var(--pc-border-w, 1px) solid var(--pc-border-c, var(--theme-border, #D8CCB4));
    border-radius: var(--pc-card-radius, 16px);
    box-shadow: 0 1px 2px rgba(10, 9, 8, 0.05), 0 4px 14px rgba(10, 9, 8, 0.06);
    overflow: hidden;
    transition: transform var(--pc-dur, 300ms) var(--pc-ease, ease-out),
        box-shadow var(--pc-dur, 300ms) var(--pc-ease, ease-out);
}
.pc-shadow-none { box-shadow: none; }
.pc-shadow-soft { box-shadow: 0 1px 2px rgba(10, 9, 8, 0.05), 0 4px 14px rgba(10, 9, 8, 0.06); }
.pc-shadow-medium { box-shadow: 0 6px 18px rgba(10, 9, 8, 0.10), 0 2px 6px rgba(10, 9, 8, 0.06); }
.pc-shadow-strong { box-shadow: 0 14px 34px rgba(10, 9, 8, 0.18), 0 4px 10px rgba(10, 9, 8, 0.08); }

@media (hover: hover) and (pointer: fine) {
    .pc-cardhover-lift:hover {
        transform: translateY(calc(-1 * var(--pc-lift, 3px)));
        box-shadow: 0 10px 26px rgba(10, 9, 8, 0.12), 0 3px 8px rgba(10, 9, 8, 0.07);
    }
    .pc-cardhover-ring:hover {
        box-shadow: 0 0 0 2px var(--theme-accent, #49111C), 0 4px 14px rgba(10, 9, 8, 0.08);
    }
}

/* ---------------- Layouts ---------------- */

/* Minimal: transparent canvas, tight body — the media keeps its styling. */
.pc-layout-minimal {
    background: transparent;
    border: none;
    box-shadow: none;
}
.pc-layout-minimal.pc-cardhover-lift:hover { box-shadow: none; }

/* Overlay: the media fills the whole card, the body floats on a bottom
   gradient with light text. Card aspect comes from --pc-ratio-*. */
.pc-layout-overlay { aspect-ratio: var(--pc-ratio-mobile, 4 / 5); }
@media (min-width: 768px) and (max-width: 1023.98px) {
    .pc-layout-overlay { aspect-ratio: var(--pc-ratio-tablet, 4 / 5); }
}
@media (min-width: 1024px) {
    .pc-layout-overlay { aspect-ratio: var(--pc-ratio-desktop, 4 / 5); }
}
.pc-layout-overlay .pc-media {
    position: absolute;
    inset: 0;
    height: 100%;
    padding: 0;
}
.pc-layout-overlay .pc-media-img,
.pc-layout-overlay .pc-media-secondary {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
}
.pc-layout-overlay .pc-body {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(10, 9, 8, 0.82) 0%, rgba(10, 9, 8, 0.42) 55%, rgba(10, 9, 8, 0) 100%);
    color: #F2F4F3;
}
.pc-layout-overlay .pc-title { color: var(--pc-title-color, #FFFFFF); }
.pc-layout-overlay .pc-price { color: var(--pc-price-color, #FFFFFF); }
.pc-layout-overlay .pc-currency { color: rgba(255, 255, 255, 0.75); }
.pc-layout-overlay .pc-sku,
.pc-layout-overlay .pc-category,
.pc-layout-overlay .pc-description,
.pc-layout-overlay .pc-stock { color: rgba(255, 255, 255, 0.78); }
.pc-layout-overlay .pc-compare { color: rgba(255, 255, 255, 0.65); }
.pc-layout-overlay .pc-action-btn {
    background: rgba(255, 255, 255, 0.92);
}

/* Horizontal: row layout, media ~42%, body fills. pc-img-pos-end reverses
   the row (with logical properties this stays RTL-correct). */
.pc-layout-horizontal { flex-direction: row; align-items: stretch; }
.pc-layout-horizontal .pc-media { flex: 0 0 42%; width: 42%; align-self: stretch; }
.pc-layout-horizontal .pc-title { font-size: var(--pc-title-m, 14px); }
.pc-layout-horizontal.pc-img-pos-end { flex-direction: row-reverse; }
.pc-layout-horizontal .pc-media-img,
.pc-layout-horizontal .pc-media-secondary { height: 100%; aspect-ratio: auto; }

/* Compact: small row card with tight typography/gaps. */
.pc-layout-compact { flex-direction: row; align-items: stretch; }
.pc-layout-compact .pc-media { flex: 0 0 36%; width: 36%; }
.pc-layout-compact.pc-img-pos-end { flex-direction: row-reverse; }
.pc-layout-compact .pc-body {
    gap: 2px;
    padding: 8px;
}
.pc-layout-compact .pc-title { font-size: 12px; }
.pc-layout-compact .pc-media-img,
.pc-layout-compact .pc-media-secondary { height: 100%; aspect-ratio: auto; }

/* Showcase: editorial vertical card — a centered inset media and an
   elevated body panel overlapping it. */
.pc-layout-showcase { background: var(--pc-card-bg, #FFFFFF); }
.pc-layout-showcase .pc-media {
    margin-inline: 8px;
    margin-top: 10px;
}

/* Image position "background": the media becomes a full-bleed backdrop and
   the body floats above it with a legibility scrim. Scoped against the
   overlay variant (which already positions its media absolutely and paints
   its own stronger gradient) so the combination never regresses overlay. */
.pc-img-pos-background { position: relative; overflow: hidden; }
.pc-img-pos-background .pc-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
}
.pc-img-pos-background .pc-media-img,
.pc-img-pos-background .pc-media-secondary {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
}
.pc-img-pos-background:not(.pc-layout-overlay) .pc-body {
    position: relative;
    z-index: 1;
    background: linear-gradient(to top, rgba(10, 9, 8, 0.78) 0%, rgba(10, 9, 8, 0.35) 55%, rgba(10, 9, 8, 0) 100%);
}
/* Light text over the media for both background and overlay treatments. */
.pc-img-pos-background .pc-title { color: var(--pc-title-color, #FFFFFF); }
.pc-img-pos-background .pc-price { color: var(--pc-price-color, #FFFFFF); }
.pc-img-pos-background .pc-currency { color: rgba(255, 255, 255, 0.75); }
.pc-img-pos-background .pc-sku,
.pc-img-pos-background .pc-category,
.pc-img-pos-background .pc-description,
.pc-img-pos-background .pc-stock { color: rgba(255, 255, 255, 0.78); }
.pc-img-pos-background .pc-compare { color: rgba(255, 255, 255, 0.65); }
.pc-layout-showcase .pc-body {
    position: relative;
    z-index: 1;
    margin-top: -26px;
    margin-inline: 8px 8px;
    background: var(--pc-card-bg, #FFFFFF);
    border: var(--pc-border-w, 1px) solid var(--pc-border-c, var(--theme-border, #D8CCB4));
    border-radius: calc(var(--pc-card-radius, 16px) - 4px);
    box-shadow: 0 8px 20px rgba(10, 9, 8, 0.10);
}

/* ---------------- Media / image ---------------- */
.pc-media {
    position: relative;
    width: 100%;
    padding: var(--pc-img-pad, 0px);
    background: var(--pc-img-bg, transparent);
    border-radius: var(--pc-img-radius, 0px);
    overflow: hidden;
}
.pc-media-link {
    display: block;
    color: inherit;
    text-decoration: none;
}
.pc-media-img {
    display: block;
    width: 100%;
    aspect-ratio: var(--pc-ratio-mobile, 4 / 5);
    object-fit: cover;
}
.pc-imgfit-cover .pc-media-img,
.pc-imgfit-cover .pc-media-secondary { object-fit: cover; }
.pc-imgfit-contain .pc-media-img,
.pc-imgfit-contain .pc-media-secondary { object-fit: contain; }
.pc-imgfit-fill .pc-media-img,
.pc-imgfit-fill .pc-media-secondary { object-fit: fill; }

@media (min-width: 768px) and (max-width: 1023.98px) {
    .pc-media-img { aspect-ratio: var(--pc-ratio-tablet, 4 / 5); }
}
@media (min-width: 1024px) {
    .pc-media-img { aspect-ratio: var(--pc-ratio-desktop, 4 / 5); }
}

.pc-media-secondary {
    position: absolute;
    top: var(--pc-img-pad, 0px);
    inset-inline-start: var(--pc-img-pad, 0px);
    width: calc(100% - (var(--pc-img-pad, 0px) * 2));
    aspect-ratio: var(--pc-ratio-mobile, 4 / 5);
    object-fit: cover;
    opacity: 0;
    pointer-events: none;
}

/* Hover image effects: zoom on the primary, cross-fade to the secondary. */
.pc-imghover-zoom .pc-media-img {
    transform-origin: center;
    will-change: transform;
    transition: transform var(--pc-dur, 300ms) var(--pc-ease, ease-out);
}
.pc-imghover-none .pc-media-img { transform: none; }
.pc-imghover-swap .pc-media-secondary {
    transition: opacity var(--pc-dur, 300ms) var(--pc-ease, ease-out);
}
@media (hover: hover) and (pointer: fine) {
    .pc-imghover-zoom:hover .pc-media-img { transform: scale(var(--pc-zoom, 1.04)); }
    .pc-imghover-swap:hover .pc-media-secondary { opacity: 1; }
    .pc-imghover-swap:hover .pc-media-img:has(+ .pc-media-secondary) { opacity: 0; }
}
/* Rounded media: clip through the card on the affected edges */
.pc-media-rounded-top {
    border-start-start-radius: calc(var(--pc-card-radius, 16px) - var(--pc-border-w, 1px));
    border-start-end-radius: calc(var(--pc-card-radius, 16px) - var(--pc-border-w, 1px));
}

/* Image arrows */
.pc-arrows {
    position: absolute;
    inset-inline: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    z-index: 4;
    pointer-events: none;
}
.pc-arrow {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 34px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--theme-accent-soft, #5E503F);
    box-shadow: 0 2px 6px rgba(10, 9, 8, 0.15);
    cursor: pointer;
    font-size: 11px;
    transition: background var(--pc-dur, 300ms) var(--pc-ease, ease-out),
        color var(--pc-dur, 300ms) var(--pc-ease, ease-out);
}
@media (hover: hover) and (pointer: fine) {
    .pc-card:hover .pc-arrow:hover {
        background: var(--theme-accent, #49111C);
        color: #FFFFFF;
    }
}

/* ---------------- Body / content blocks ---------------- */
.pc-body {
    display: flex;
    flex-direction: column;
    gap: var(--pc-body-gap-m, 8px);
    padding: var(--pc-pad-m, 12px);
    flex-grow: 1;
    min-width: 0;
}
@media (min-width: 768px) and (max-width: 1023.98px) {
    .pc-body {
        gap: var(--pc-body-gap-t, 10px);
        padding: var(--pc-pad-t, 16px);
    }
}
@media (min-width: 1024px) {
    .pc-body {
        gap: var(--pc-body-gap-d, 10px);
        padding: var(--pc-pad-d, 16px);
    }
}
.pc-body > * { min-width: 0; }

/* Align variants.
   In column layouts they align blocks horizontally; in row layouts they
   act on the body's own inline-start alignment instead. */
.pc-align-start .pc-body { align-items: flex-start; text-align: start; }
.pc-align-center .pc-body { align-items: center; text-align: center; }
.pc-align-center .pc-body > * { text-align: center; }
.pc-align-end .pc-body { align-items: flex-end; text-align: end; }
.pc-layout-horizontal.pc-align-start .pc-body,
.pc-layout-horizontal.pc-align-center .pc-body,
.pc-layout-horizontal.pc-align-end .pc-body,
.pc-layout-compact.pc-align-start .pc-body,
.pc-layout-compact.pc-align-center .pc-body,
.pc-layout-compact.pc-align-end .pc-body { justify-content: center; }

.pc-category {
    order: 1;
    font-size: 11px;
    font-weight: 700;
    color: var(--pc-muted, var(--theme-accent-soft, #5E503F));
    letter-spacing: 0.02em;
}
.pc-title {
    order: 2;
    margin: 0;
    font-size: var(--pc-title-m, 14px);
    font-weight: 700;
    line-height: 1.55;
    color: var(--pc-title-color, #0A0908);
    display: -webkit-box;
    -webkit-line-clamp: var(--pc-title-lines, 1);
    line-clamp: var(--pc-title-lines, 1);
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}
.pc-title-normal { font-weight: 400; }
.pc-title-semibold { font-weight: 600; }
.pc-title-bold { font-weight: 700; }
.pc-title-black { font-weight: 900; }
@media (min-width: 768px) and (max-width: 1023.98px) {
    .pc-title { font-size: var(--pc-title-t, 15px); }
}
@media (min-width: 1024px) {
    .pc-title { font-size: var(--pc-title-d, 16px); }
}

.pc-sku {
    order: 3;
    font-size: 11px;
    font-weight: 600;
    color: var(--pc-muted, #9CA3AF);
    direction: ltr;
    unicode-bidi: isolate;
}

.pc-swatch-panel {
    order: 4;
    display: flex;
    flex-wrap: wrap;
}

.pc-description {
    order: 5;
    font-size: 12px;
    line-height: 1.7;
    color: var(--pc-muted, #9CA3AF);
    display: -webkit-box;
    -webkit-line-clamp: var(--pc-desc-lines, 2);
    line-clamp: var(--pc-desc-lines, 2);
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.pc-price-row {
    order: 6;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.pc-price {
    font-size: var(--pc-price-size, 18px);
    font-weight: 900;
    color: var(--pc-price-color, var(--theme-accent-soft, #49111C));
}
.pc-price-normal { font-weight: 400; }
.pc-price-semibold { font-weight: 600; }
.pc-price-bold { font-weight: 700; }
.pc-price-black { font-weight: 900; }
.pc-currency {
    font-size: 12px;
    font-weight: 600;
    color: var(--pc-muted, var(--theme-accent-soft, #49111C));
}
.pc-compare {
    font-size: 13px;
    text-decoration: line-through;
    color: var(--pc-muted, #9CA3AF);
}
.pc-discount {
    font-size: 11px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 6px;
    background: color-mix(in srgb, #DC2626 14%, #FFFFFF);
    color: #DC2626;
}

.pc-stock {
    order: 7;
    font-size: 11px;
    font-weight: 700;
    color: var(--pc-muted, #16A34A);
}
.pc-stock-out { color: #DC2626; }

/* ---------------- Badges ---------------- */
.pc-badges {
    position: absolute;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
    max-width: calc(100% - 16px);
}
.pc-bpos-top-start { top: 8px; inset-inline-start: 8px; align-items: flex-start; }
.pc-bpos-top-end { top: 8px; inset-inline-end: 8px; align-items: flex-end; }
.pc-bpos-bottom-start { bottom: 8px; inset-inline-start: 8px; align-items: flex-start; }
.pc-bpos-bottom-end { bottom: 8px; inset-inline-end: 8px; align-items: flex-end; }

.pc-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    font-size: var(--pc-badge-font, 11px);
    font-weight: 700;
    line-height: 1.5;
    border-radius: var(--pc-badge-radius, 8px);
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
}
/* Per-type tint variables (real badges only: sale/new/limited/out). */
.pc-badge-sale { --pc-badge-type-bg: #DC2626; --pc-badge-type-fg: #FFFFFF; }
.pc-badge-new { --pc-badge-type-bg: #16A34A; --pc-badge-type-fg: #FFFFFF; }
.pc-badge-limited { --pc-badge-type-bg: #D97706; --pc-badge-type-fg: #FFFFFF; }
.pc-badge-out { --pc-badge-type-bg: #6B7280; --pc-badge-type-fg: #FFFFFF; }

.pc-badge-style-soft .pc-badge {
    background: var(--pc-badge-bg, color-mix(in srgb, var(--pc-badge-type-bg, #49111C) 14%, #FFFFFF));
    color: var(--pc-badge-color, var(--pc-badge-type-fg, #0A0908));
}
.pc-badge-style-solid .pc-badge {
    background: var(--pc-badge-bg, var(--pc-badge-type-bg, var(--theme-accent, #49111C)));
    color: var(--pc-badge-color, var(--pc-badge-type-fg, #FFFFFF));
}
.pc-badge-style-outline .pc-badge {
    background: var(--pc-badge-bg, rgba(10, 9, 8, 0.35));
    color: var(--pc-badge-color, var(--pc-badge-type-fg, #FFFFFF));
    border: 1px solid currentColor;
}
/* Overlay canvas is dark: soft badges keep their read with a solid floor. */
.pc-layout-overlay.pc-badge-style-soft .pc-badge {
    background: var(--pc-badge-bg, var(--pc-badge-type-bg, var(--theme-accent, #49111C)));
}

/* ---------------- Actions ---------------- */
.pc-actions {
    order: 8;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    opacity: 1;
    transition: opacity var(--pc-dur, 300ms) var(--pc-ease, ease-out);
}
.pc-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: var(--pc-btn-size-mobile, 38px);
    height: var(--pc-btn-size-mobile, 38px);
    padding: 0;
    border: 1px solid var(--theme-border, #D8CCB4);
    border-radius: var(--pc-btn-radius, 12px);
    background: var(--pc-card-bg, #FFFFFF);
    color: var(--pc-icon-color, var(--theme-accent-soft, #5E503F));
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--pc-dur, 300ms) var(--pc-ease, ease-out),
        color var(--pc-dur, 300ms) var(--pc-ease, ease-out),
        border-color var(--pc-dur, 300ms) var(--pc-ease, ease-out);
}
.pc-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.pc-add-text { width: auto; padding-inline: 12px; }
.pc-add-both { width: auto; padding-inline: 12px; }
@media (min-width: 768px) and (max-width: 1023.98px) {
    .pc-action-btn {
        width: var(--pc-btn-size-tablet, 42px);
        height: var(--pc-btn-size-tablet, 42px);
    }
    .pc-add-text, .pc-add-both { height: var(--pc-btn-size-tablet, 42px); }
}
@media (min-width: 1024px) {
    .pc-action-btn {
        width: var(--pc-btn-size-desktop, 42px);
        height: var(--pc-btn-size-desktop, 42px);
    }
    .pc-add-text, .pc-add-both { height: var(--pc-btn-size-desktop, 42px); }
}
@media (hover: hover) and (pointer: fine) {
    .pc-action-btn:hover:not(:disabled) {
        background: var(--theme-accent, #49111C);
        border-color: var(--theme-accent, #49111C);
        color: var(--pc-icon-hover, #FFFFFF);
    }
}

/* Full-width cart variant */
.pc-cart-full {
    order: 8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: var(--pc-btn-radius, 12px);
    background: var(--theme-accent, #49111C);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: background var(--pc-dur, 300ms) var(--pc-ease, ease-out);
}
.pc-cart-full:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
@media (hover: hover) and (pointer: fine) {
    .pc-cart-full:hover:not(:disabled) { background: var(--theme-accent-hover, #6B1A28); }
}

/* Hover-only action visibility per device — BOTH the hiding rule and its
   reveal rule live inside the same (hover:hover) and (pointer:fine) query:
   on touch devices no query matches, so the actions row and full-width cart
   keep their default visibility (opacity:1) and stay reachable. */
@media (hover: hover) and (pointer: fine) and (max-width: 767.98px) {
    .pc-act-m-hover .pc-actions,
    .pc-act-m-hover .pc-cart-full { opacity: 0; pointer-events: none; }
    .pc-card.pc-act-m-hover:hover .pc-actions,
    .pc-card.pc-act-m-hover:hover .pc-cart-full,
    .pc-card.pc-act-m-hover:focus-within .pc-actions,
    .pc-card.pc-act-m-hover:focus-within .pc-cart-full {
        opacity: 1;
        pointer-events: auto;
    }
}
@media (hover: hover) and (pointer: fine) and (min-width: 768px) and (max-width: 1023.98px) {
    .pc-act-t-hover .pc-actions,
    .pc-act-t-hover .pc-cart-full { opacity: 0; pointer-events: none; }
    .pc-card.pc-act-t-hover:hover .pc-actions,
    .pc-card.pc-act-t-hover:hover .pc-cart-full,
    .pc-card.pc-act-t-hover:focus-within .pc-actions,
    .pc-card.pc-act-t-hover:focus-within .pc-cart-full {
        opacity: 1;
        pointer-events: auto;
    }
}
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
    .pc-act-d-hover .pc-actions,
    .pc-act-d-hover .pc-cart-full { opacity: 0; pointer-events: none; }
    .pc-card.pc-act-d-hover:hover .pc-actions,
    .pc-card.pc-act-d-hover:hover .pc-cart-full,
    .pc-card.pc-act-d-hover:focus-within .pc-actions,
    .pc-card.pc-act-d-hover:focus-within .pc-cart-full {
        opacity: 1;
        pointer-events: auto;
    }
}

/* ---------------- Swatches ---------------- */
.pc-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.pc-swatch {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--theme-border, #D8CCB4);
    background: var(--pc-card-bg, #FFFFFF);
    cursor: pointer;
    transition: box-shadow var(--pc-dur, 300ms) var(--pc-ease, ease-out),
        transform var(--pc-dur, 300ms) var(--pc-ease, ease-out);
}
.pc-swatch-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
}
.pc-swatch.is-selected {
    box-shadow: 0 0 0 2px var(--pc-card-bg, #FFFFFF), 0 0 0 4px var(--theme-accent, #49111C);
}
.pc-swatch.is-unavailable {
    opacity: 0.35;
    cursor: not-allowed;
}
.pc-swatch.is-unavailable::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: linear-gradient(
        to top left,
        transparent calc(50% - 0.75px),
        currentColor calc(50% - 0.75px),
        currentColor calc(50% + 0.75px),
        transparent calc(50% + 0.75px)
    );
    color: #6B7280;
}
@media (hover: hover) and (pointer: fine) {
    .pc-swatch:hover { transform: scale(1.08); }
}

.pc-title-link {
    color: inherit;
    text-decoration: none;
}
/* Reuse the shared card focus style for the title link — it is now the real
   keyboard-reachable link (the image link is the decorative duplicate with
   tabindex="-1"). */
.pc-title-link:focus-visible {
    outline: 2px solid var(--theme-accent, #49111C);
    outline-offset: 2px;
    border-radius: 4px;
}
.pc-action-btn.is-active {
    color: var(--theme-accent, #49111C);
    border-color: var(--theme-accent, #49111C);
}

/* ---------------- Focus visibility ---------------- */
.pc-card a:focus-visible,
.pc-card button:focus-visible {
    outline: 2px solid var(--theme-accent, #49111C);
    outline-offset: 2px;
}

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
    .pc-card,
    .pc-actions,
    .pc-media-img,
    .pc-media-secondary,
    .pc-arrow,
    .pc-action-btn,
    .pc-cart-full,
    .pc-swatch {
        transition: none !important;
    }
    .pc-imghover-zoom:hover .pc-media-img { transform: none !important; }
    .pc-cardhover-lift:hover { transform: none !important; }
}

/* ---------------- Phase 2: admin preview frame touch parity ----------------
 * The storefront media queries (max-width: ...) respond to the REAL browser
 * viewport, but inside the admin dashboard the preview frame only SIMULATES a
 * device by clamping its wrapper width and rewriting the config triads. This
 * override is therefore scoped to the admin frame node only
 * ([data-pc-preview]) — it keeps hover-revealed actions visible and tappable
 * for the touch devices the frame simulates; storefront markup is untouched. */
[data-pc-preview][data-pc-device="mobile"] .pc-actions,
[data-pc-preview][data-pc-device="mobile"] .pc-cart-full,
[data-pc-preview][data-pc-device="tablet"] .pc-actions,
[data-pc-preview][data-pc-device="tablet"] .pc-cart-full {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* ---------------- Phase 2: admin preview frame = simulated device viewport ----
 * The frame itself IS the simulated device viewport: mobile/tablet clamp the
 * frame's outer width (and center it) so the mode is obvious at large admin
 * viewports; desktop stays full width. */
[data-pc-preview][data-pc-device="mobile"] { max-width: 375px; margin-inline: auto; }
[data-pc-preview][data-pc-device="tablet"] { max-width: 768px; margin-inline: auto; }

/* ---------------- Seasonal / occasion campaigns ---------------- */
.pc-campaign-badges {
    position: absolute;
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: calc(100% - 16px);
    pointer-events: none;
}
.pc-cpos-top-start { top: 10px; inset-inline-start: 10px; align-items: flex-start; }
.pc-cpos-top-end { top: 10px; inset-inline-end: 10px; align-items: flex-end; }
.pc-cpos-bottom-start { bottom: 10px; inset-inline-start: 10px; align-items: flex-start; }
.pc-cpos-bottom-end { bottom: 10px; inset-inline-end: 10px; align-items: flex-end; }

.pc-campaign {
    --pc-campaign-ink: #1C1917;
    --pc-campaign-surface: #FFFFFF;
    --pc-campaign-accent: #D4AF37;
    --pc-campaign-mark: #E6A57D;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    min-height: 24px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 999px;
    background: var(--pc-campaign-surface);
    color: var(--pc-campaign-ink);
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: 0.015em;
    text-wrap: balance;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.16);
}
.pc-campaign-size-small { min-height: 20px; padding: 3px 8px; font-size: 10px; }
.pc-campaign-size-medium { min-height: 24px; font-size: 11px; }
.pc-campaign-size-large { min-height: 30px; padding: 6px 12px; font-size: 13px; }
.pc-campaign-mark { width: 11px; height: 11px; display: inline-block; border: 1px solid rgba(0,0,0,.2); background: var(--pc-campaign-mark); flex: 0 0 auto; clip-path: polygon(50% 0, 60% 34%, 96% 35%, 67% 56%, 78% 91%, 50% 70%, 22% 91%, 33% 56%, 4% 35%, 40% 34%); }
.pc-campaign-pattern-lattice .pc-campaign-mark { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.pc-campaign-pattern-crescent-stars .pc-campaign-mark { clip-path: circle(50% at 50% 50%); }
.pc-campaign-pattern-festoon .pc-campaign-mark { clip-path: polygon(0 20%, 100% 20%, 82% 100%, 18% 100%); }
.pc-campaign-pattern-confetti .pc-campaign-mark { clip-path: polygon(0 0, 100% 0, 88% 100%, 12% 100%); }
.pc-campaign-pattern-snow .pc-campaign-mark { clip-path: polygon(46% 0, 54% 0, 54% 35%, 89% 20%, 96% 27%, 62% 46%, 97% 66%, 88% 73%, 54% 58%, 54% 100%, 46% 100%, 46% 58%, 12% 73%, 3% 66%, 38% 46%, 4% 27%, 11% 20%, 46% 35%); }
.pc-campaign-pattern-fireworks .pc-campaign-mark { clip-path: polygon(50% 0, 62% 33%, 96% 25%, 70% 50%, 96% 75%, 62% 67%, 50% 100%, 38% 67%, 4% 75%, 30% 50%, 4% 25%, 38% 33%); }
.pc-campaign-pattern-sunburst .pc-campaign-mark { clip-path: polygon(50% 0, 65% 28%, 98% 18%, 75% 45%, 98% 72%, 65% 64%, 50% 100%, 35% 64%, 2% 72%, 25% 45%, 2% 18%, 35% 28%); }
.pc-campaign-pattern-leaf .pc-campaign-mark { border-radius: 0 100% 0 100%; transform: rotate(-28deg); }

.pc-campaign-style-capsule { border-radius: 999px; }
.pc-campaign-style-scallop { border-radius: 12px 4px 12px 4px; }
.pc-campaign-style-ribbon { position: relative; border-radius: 2px 6px 6px 2px; border: none; padding-inline: 10px; }
.pc-campaign-style-ribbon::before,
.pc-campaign-style-ribbon::after { content: ''; position: absolute; top: 50%; width: 8px; height: 8px; background: inherit; border: 1px solid rgba(0,0,0,.18); transform: translateY(-50%) rotate(45deg); }
.pc-campaign-style-ribbon::before { inset-inline-start: -4px; }
.pc-campaign-style-ribbon::after { inset-inline-end: -4px; }
.pc-campaign-style-banner { border-radius: 3px 3px 12px 12px; border-width: 0 0 2px; border-style: solid; box-shadow: none; }
.pc-campaign-style-florentine { border-radius: 28px 8px 28px 8px; }
.pc-campaign-style-outline { background: rgba(255, 255, 255, 0.84); border: 2px solid var(--pc-campaign-ink); box-shadow: none; }
.pc-campaign-style-tag { border-radius: 4px 10px 10px 4px; }
.pc-campaign-style-stack { border-radius: 8px; box-shadow: 0 0 0 1px rgba(0,0,0,.1), 0 5px 0 rgba(0,0,0,.09); align-items: flex-start; text-align: center; }

.pc-campaign-color-emerald-gold { --pc-campaign-surface: #0F4C3A; --pc-campaign-ink: #FFF8DF; --pc-campaign-accent: #D4AF37; --pc-campaign-mark: #D4AF37; }
.pc-campaign-color-ruby-gold { --pc-campaign-surface: #FFFFFF; --pc-campaign-ink: #A81227; --pc-campaign-accent: #D4AF37; --pc-campaign-mark: #D4AF37; }
.pc-campaign-color-saffron-ruby { --pc-campaign-surface: #F59E0B; --pc-campaign-ink: #7C2D12; --pc-campaign-accent: #E11D48; --pc-campaign-mark: #E11D48; }
.pc-campaign-color-ivory-forest { --pc-campaign-surface: #F8F5E9; --pc-campaign-ink: #173F2B; --pc-campaign-accent: #9BBF62; --pc-campaign-mark: #9BBF62; }
.pc-campaign-color-navy-gold { --pc-campaign-surface: #111827; --pc-campaign-ink: #FEF3C7; --pc-campaign-accent: #FDE68A; --pc-campaign-mark: #FDE68A; }
.pc-campaign-color-maroon-cream { --pc-campaign-surface: #6F1D2D; --pc-campaign-ink: #FFF7ED; --pc-campaign-accent: #FCE7F3; --pc-campaign-mark: #FCE7F3; }
.pc-campaign-color-noir-gold { --pc-campaign-surface: #0A0908; --pc-campaign-ink: #FDE68A; --pc-campaign-accent: #FDE68A; --pc-campaign-mark: #D4AF37; }
.pc-campaign-color-ember-claret { --pc-campaign-surface: #431D2A; --pc-campaign-ink: #FFEDD5; --pc-campaign-accent: #FB923C; --pc-campaign-mark: #FB923C; }

/* Full-card campaigns stay remote-theme neutral and retain readable text zones. */
.pc-card.pc-campaign-bg {
    --pc-pattern-ink: color-mix(in srgb, currentColor 10%, transparent);
}
.pc-card.pc-campaign-color-emerald-gold { --pc-card-bg: #0F4C3A; color: #FFF8DF; }
.pc-card.pc-campaign-color-ruby-gold { --pc-card-bg: #FFF7F0; color: #7F1D1D; }
.pc-card.pc-campaign-color-saffron-ruby { --pc-card-bg: #FFFBEB; color: #78350F; }
.pc-card.pc-campaign-color-ivory-forest { --pc-card-bg: #F8F5E9; color: #173F2B; }
.pc-card.pc-campaign-color-navy-gold { --pc-card-bg: #111827; color: #FEF3C7; }
.pc-card.pc-campaign-color-maroon-cream { --pc-card-bg: #6F1D2D; color: #FFF7ED; }
.pc-card.pc-campaign-color-noir-gold { --pc-card-bg: #0A0908; color: #FDE68A; }
.pc-card.pc-campaign-color-ember-claret { --pc-card-bg: #431D2A; color: #FFEDD5; }
.pc-card.pc-campaign-bg .pc-title,
.pc-card.pc-campaign-bg .pc-price { color: inherit; }
.pc-card.pc-campaign-bg .pc-currency { color: currentColor; opacity: .82; }
.pc-card.pc-campaign-pattern-lattice { background-image: radial-gradient(circle at 50% 50%, transparent 42%, var(--pc-pattern-ink) 43%, var(--pc-pattern-ink) 49%, transparent 50%), radial-gradient(circle at 0 0, transparent 42%, var(--pc-pattern-ink) 43%, var(--pc-pattern-ink) 49%, transparent 50%), radial-gradient(circle at 100% 0, transparent 42%, var(--pc-pattern-ink) 43%, var(--pc-pattern-ink) 49%, transparent 50%), radial-gradient(circle at 0 100%, transparent 42%, var(--pc-pattern-ink) 43%, var(--pc-pattern-ink) 49%, transparent 50%), radial-gradient(circle at 100% 100%, transparent 42%, var(--pc-pattern-ink) 43%, var(--pc-pattern-ink) 49%, transparent 50%); background-size: 40px 40px; }
.pc-card.pc-campaign-pattern-crescent-stars { background-image: radial-gradient(circle at 18% 22%, var(--pc-pattern-ink) 0 11%, transparent 12%), radial-gradient(circle at 78% 30%, var(--pc-pattern-ink) 0 9%, transparent 10%), radial-gradient(circle at 46% 85%, var(--pc-pattern-ink) 0 9%, transparent 10%), radial-gradient(ellipse at 62% 54%, transparent 43%, var(--pc-pattern-ink) 44%, var(--pc-pattern-ink) 54%, transparent 55%); background-size: 150px 150px; }
.pc-card.pc-campaign-pattern-festoon { background-image: repeating-linear-gradient(135deg, var(--pc-pattern-ink) 0 10px, transparent 10px 32px), radial-gradient(circle at 50% 0, transparent 58%, var(--pc-pattern-ink) 59%, var(--pc-pattern-ink) 68%, transparent 69%); background-size: 64px 28px; background-position: 0 0, 0 -14px; }
.pc-card.pc-campaign-pattern-confetti { background-image: repeating-linear-gradient(25deg, transparent 0 14px, var(--pc-pattern-ink) 14px 18px, transparent 18px 37px), repeating-linear-gradient(-28deg, transparent 0 22px, var(--pc-pattern-ink) 22px 26px, transparent 26px 57px), repeating-linear-gradient(85deg, transparent 0 17px, var(--pc-pattern-ink) 17px 19px, transparent 19px 44px); }
.pc-card.pc-campaign-pattern-snow { background-image: radial-gradient(circle, var(--pc-pattern-ink) 0 2px, transparent 2px), radial-gradient(circle, var(--pc-pattern-ink) 0 1px, transparent 1px); background-size: 32px 32px, 18px 18px; background-position: 0 0, 12px 15px; }
.pc-card.pc-campaign-pattern-fireworks { background-image: radial-gradient(circle at 20% 25%, transparent 5%, var(--pc-pattern-ink) 5.5%, var(--pc-pattern-ink) 10%, transparent 10.5%), radial-gradient(circle at 75% 35%, transparent 5%, var(--pc-pattern-ink) 5.5%, var(--pc-pattern-ink) 10%, transparent 10.5%), radial-gradient(circle at 45% 78%, transparent 4%, var(--pc-pattern-ink) 4.5%, var(--pc-pattern-ink) 8%, transparent 8.5%); background-size: 160px 160px; }
.pc-card.pc-campaign-pattern-sunburst { background-image: repeating-conic-gradient(from -24deg at 50% 0, var(--pc-pattern-ink) 0 5deg, transparent 5deg 20deg); }
.pc-card.pc-campaign-pattern-leaf { background-image: radial-gradient(ellipse at 50% 50%, var(--pc-pattern-ink) 0 14%, transparent 15%), radial-gradient(ellipse at 50% 50%, var(--pc-pattern-ink) 0 14%, transparent 15%); background-size: 52px 36px, 52px 36px; background-position: 0 0, 26px 18px; }
@media (hover: none), (pointer: coarse), (max-width: 480px) {
    .pc-campaign { max-width: 160px; }
    .pc-campaign-size-large { font-size: 12px; padding: 5px 10px; }
    .pc-campaign-badges { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
    .pc-campaign { scroll-behavior: auto; }
}

/* Admin preview helpers for the campaign composer */
[data-promotion-preview] .pc-cpreview-top-start { position: absolute; top: 10px; inset-inline-start: 10px; }
[data-promotion-preview] .pc-cpreview-top-end { position: absolute; top: 10px; inset-inline-end: 10px; }
[data-promotion-preview] .pc-cpreview-bottom-start { position: absolute; bottom: 10px; inset-inline-start: 10px; }
[data-promotion-preview] .pc-cpreview-bottom-end { position: absolute; bottom: 10px; inset-inline-end: 10px; }
[data-promotion-preview] .pc-campaign { margin: 0; }
[data-promotion-preview] .pc-card.pc-campaign-bg .pc-media-wrapper,
[data-promotion-preview] .pc-card.pc-campaign-bg > div { position: relative; z-index: 1; }

/* Admin promotion quick-placement controls */
.promo-quick-placement { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.promo-quick-placement button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    min-height: 66px;
    padding: 8px 6px;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    background: #FFFFFF;
    color: #374151;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, color .15s ease;
}
.promo-quick-placement button:hover { border-color: #9CA3AF; transform: translateY(-1px); }
.promo-quick-placement button:focus-visible { outline: 3px solid #F97316; outline-offset: 2px; }
.promo-quick-placement button[aria-pressed="true"] {
    border-color: #111827;
    background: #111827;
    color: #F9FAFB;
    box-shadow: 0 0 0 2px #111827;
}
.promo-placement-preview {
    position: relative;
    display: block;
    width: 46px;
    height: 30px;
    border: 2px solid currentColor;
    border-radius: 5px;
    background: #F3F4F6;
    opacity: .95;
}
.promo-placement-preview::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 2px;
    background: linear-gradient(145deg, #E5E7EB, #FFFFFF);
}
.promo-placement-dot {
    position: absolute;
    z-index: 1;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 3px currentColor;
}
.promo-quick-placement button[aria-pressed="true"] .promo-placement-preview,
.promo-quick-placement button[aria-pressed="true"] .promo-placement-preview::before { background: #1F2937; }
.promo-pos-top-start .promo-placement-dot { top: 1px; inset-inline-start: 2px; }
.promo-pos-top-end .promo-placement-dot { top: 1px; inset-inline-end: 2px; }
.promo-pos-bottom-start .promo-placement-dot { bottom: 1px; inset-inline-start: 2px; }
.promo-pos-bottom-end .promo-placement-dot { bottom: 1px; inset-inline-end: 2px; }
.promo-pos-card-background::before,
.promo-pos-card-background::after {
    content: '';
    position: absolute;
    z-index: 1;
    inset: 3px;
    border-radius: 2px;
    opacity: .55;
    background: repeating-linear-gradient(135deg, #F59E0B 0 4px, #111827 4px 8px);
}
.promo-pos-card-background::after { background: repeating-linear-gradient(45deg, #F59E0B 0 4px, #111827 4px 8px); }

/* A real sample card wrapper for the admin campaign preview */
.pc-campaign-stage { display: flex; justify-content: center; padding: 10px 4px 12px; }
.pc-campaign-sample { width: min(280px, 100%); }
.pc-campaign-sample .pc-media { background: #FFFFFF; }
.pc-campaign-sample .pc-campaign-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.pc-campaign-sample .pc-category { color: #5E503F; }
.pc-campaign-sample .pc-price { color: #49111C; }
.pc-campaign-sample .pc-compare { color: #9CA3AF; }
.pc-campaign-sample .pc-discount { color: #FFFFFF; background: #DC2626; }
.pc-campaign-sample .pc-campaign-mark { flex: 0 0 auto; }
.pc-campaign-sample .pc-cart-full { pointer-events: none; }
.pc-campaign-sample .pc-action-btn { pointer-events: none; }
.pc-campaign-bg .pc-body { background: transparent; }
.pc-campaign-bg .pc-compare { color: currentColor; opacity: .72; }
.pc-campaign-bg .pc-category { color: currentColor; opacity: .78; }
@media (min-width: 1280px) { .pc-campaign-sample { width: 300px; } }

/* Admin campaign preview: a self-contained generic phone render */
.promo-sample-photo {
    position: relative;
    aspect-ratio: 4 / 3;
    width: 100%;
    overflow: hidden;
    border-radius: var(--pc-img-radius, 0px);
    background:
        radial-gradient(circle at 50% 42%, rgba(212, 175, 55, 0.17) 0 23%, transparent 24%),
        radial-gradient(circle at 15% 90%, rgba(73, 17, 28, 0.10) 0 24%, transparent 25%),
        linear-gradient(145deg, #F7F4ED 0%, #ECE8DE 55%, #DDD8CC 100%);
}
.promo-sample-photo::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 51%;
    width: 88px;
    height: 132px;
    border: 5px solid #171310;
    border-radius: 18px;
    background: linear-gradient(155deg, #5C1E28 0 36%, #A9927D 37% 45%, #211D1A 46% 100%);
    box-shadow: 0 15px 22px rgba(10, 9, 8, 0.22), inset 0 0 0 2px rgba(255, 255, 255, 0.05);
    transform: translate(-50%, -50%) rotate(-4deg);
}
.promo-sample-photo::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 22%;
    width: 34px;
    height: 7px;
    border-radius: 0 0 9px 9px;
    background: #171310;
    transform: translateX(-50%);
}
.promo-sample-accessory {
    position: absolute;
    left: 50%;
    bottom: 14%;
    width: 112px;
    height: 40px;
    border: 7px solid #A9927D;
    border-top-color: #D7C9A3;
    border-radius: 22px 22px 10px 10px;
    background: #2A211D;
    transform: translateX(-50%);
}
.promo-sample-accessory::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 8px;
    width: 72px;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.17);
}

/* Background-campaign label (storefront card body) */
.pc-campaign-bg-label {
    order: 0;
    display: block;
    margin: 0 0 8px;
    padding: 4px 10px;
    border-radius: 10px;
    background: var(--pc-campaign-surface, #0F4C3A);
    color: var(--pc-campaign-ink, #FFF8DF);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.4;
    text-align: center;
}
