/*
 * BCL Product Card — bcl-product-card.css
 * Colour tokens are overridden by wp_add_inline_style() from BCL_PC_Assets
 * when the admin has customised colours in WooCommerce > BCL Product Card.
 */

/* ── Tokens (defaults, overridden inline when settings differ) ── */
:root {
    --bcl-espresso:  #2C1A1A;
    --bcl-cream:     #FAF7F2;
    --bcl-ivory:     #F2EDE4;
    --bcl-rose:      #C4826A;
    --bcl-burgundy:  #7A3B3B;
    --bcl-gold:      #B8934A;
    --bcl-muted:     #8C7B6E;
    --bcl-border:    rgba(44, 26, 26, 0.12);
    --bcl-white:     #FFFFFF;
    --bcl-green:     #4A7C59;
    --bcl-swatch-size: 28px;
}

/* ── Card wrapper ─────────────────────────────────────────────── */
.bcl-card {
    font-family: 'DM Sans', sans-serif;
    background: var(--bcl-white);
    border: 1px solid var(--bcl-border);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    position: relative;
}

.bcl-card:hover {
    box-shadow: 0 12px 48px rgba(44, 26, 26, 0.1);
    transform: translateY(-3px);
}

/* ── Image ────────────────────────────────────────────────────── */
.bcl-card__img-wrap {
    aspect-ratio: 1 / 1;
    background: var(--bcl-ivory);
    overflow: hidden;
    position: relative;
}

.bcl-card__img-link {
    display: block;
    width: 100%;
    height: 100%;
}

.bcl-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.bcl-card:hover .bcl-card__img {
    transform: scale(1.04);
}

/* ── Badge ────────────────────────────────────────────────────── */
.bcl-card__badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    background: var(--bcl-espresso);
    color: var(--bcl-cream);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 5px 12px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    line-height: 1;
    pointer-events: none;
}

.bcl-card__sold-out {
    position: absolute;
    inset: 0;
    background: rgba(250, 247, 242, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--bcl-muted);
    font-weight: 400;
}

/* ── Body ─────────────────────────────────────────────────────── */
.bcl-card__body {
    padding: 22px 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

/* ── Name ─────────────────────────────────────────────────────── */
.bcl-card__name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.15;
    color: var(--bcl-espresso);
    margin: 0;
}

.bcl-card__name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s;
}

.bcl-card__name a:hover {
    color: var(--bcl-rose);
}

/* ── Description ──────────────────────────────────────────────── */
.bcl-card__desc {
    font-size: 13px;
    color: var(--bcl-muted);
    line-height: 1.7;
    font-weight: 300;
    margin: 0;
}

/* ── Variations wrapper ───────────────────────────────────────── */
.bcl-card__variations {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bcl-card__var-label {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--bcl-muted);
    margin: 0;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bcl-card__var-selected {
    font-size: 12px;
    color: var(--bcl-espresso);
    letter-spacing: 0;
    text-transform: none;
    font-weight: 500;
}

/* ── Colour swatches ──────────────────────────────────────────── */
.bcl-card__swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bcl-swatch {
    width: var(--bcl-swatch-size);
    height: var(--bcl-swatch-size);
    border-radius: 50%;
    border: 2px solid transparent;
    padding: 0;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    flex-shrink: 0;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.bcl-swatch:hover:not(.is-sold-out) {
    transform: scale(1.15);
}

.bcl-swatch.is-active {
    border-color: var(--bcl-espresso);
    box-shadow: 0 0 0 2px var(--bcl-white), 0 0 0 4px var(--bcl-espresso);
}

/* Sold-out: diagonal strike through the circle */
.bcl-swatch.is-sold-out {
    opacity: 0.45;
    cursor: not-allowed;
}

.bcl-swatch.is-sold-out::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(
        to bottom right,
        transparent calc(50% - 0.5px),
        rgba(255, 255, 255, 0.75) calc(50% - 0.5px),
        rgba(255, 255, 255, 0.75) calc(50% + 0.5px),
        transparent calc(50% + 0.5px)
    );
}

.bcl-swatch:focus-visible {
    box-shadow: 0 0 0 2px var(--bcl-white), 0 0 0 4px var(--bcl-espresso);
}

/* ── Pill buttons ─────────────────────────────────────────────── */
.bcl-card__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.bcl-pill {
    padding: 6px 16px;
    border: 1px solid var(--bcl-border);
    border-radius: 0;
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
    color: var(--bcl-espresso);
    background: transparent;
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    letter-spacing: 0.04em;
    line-height: 1.4;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.bcl-pill:hover:not(.is-sold-out) {
    border-color: var(--bcl-rose);
    color: var(--bcl-rose);
}

.bcl-pill.is-active {
    background: var(--bcl-espresso);
    color: var(--bcl-cream);
    border-color: var(--bcl-espresso);
}

.bcl-pill.is-sold-out {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

.bcl-pill:focus-visible {
    outline: 2px solid var(--bcl-espresso);
    outline-offset: 2px;
}

/* ── Footer (price + CTA) ─────────────────────────────────────── */
.bcl-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--bcl-border);
    margin-top: auto;
}

/* WooCommerce price HTML */
.bcl-card__price {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    font-weight: 400;
    color: var(--bcl-espresso);
    line-height: 1;
}

.bcl-card__price .woocommerce-Price-currencySymbol {
    font-size: 16px;
}

.bcl-card__price del {
    font-size: 16px;
    color: var(--bcl-muted);
    margin-right: 6px;
    text-decoration: line-through;
}

.bcl-card__price ins {
    text-decoration: none;
    color: var(--bcl-burgundy);
}

/* ── Add to cart button ───────────────────────────────────────── */
.bcl-card__add-btn {
    display: inline-flex;
    align-items: center;
    background: var(--bcl-espresso);
    color: var(--bcl-cream);
    border: none;
    padding: 11px 20px;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    transition: background 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
    outline: none;
    border-radius: 0;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
}

.bcl-card__add-btn-inner {
    display: flex;
    align-items: center;
    gap: 7px;
}

.bcl-card__add-btn:hover:not(:disabled) {
    background: var(--bcl-burgundy);
}

.bcl-card__add-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.bcl-card__add-btn:disabled {
    background: var(--bcl-muted);
    cursor: not-allowed;
}

.bcl-card__add-btn:focus-visible {
    outline: 2px solid var(--bcl-espresso);
    outline-offset: 3px;
}

/* State: adding */
.bcl-card__add-btn.is-adding {
    background: var(--bcl-rose);
    pointer-events: none;
}

/* State: added */
.bcl-card__add-btn.is-added {
    background: var(--bcl-green);
}

/* State: error */
.bcl-card__add-btn.is-error {
    background: var(--bcl-burgundy);
    font-size: 10px;
    letter-spacing: 0.06em;
}

/* Spinner animation (applied to SVG when adding) */
@keyframes bcl-spin {
    to { transform: rotate(360deg); }
}
.bcl-icon--spin {
    animation: bcl-spin 0.7s linear infinite;
    transform-origin: center;
}

.bcl-icon {
    display: block;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   BCL CARD — pre-launch countdown state
   ══════════════════════════════════════════════════════════ */

/* Dim variation selectors while locked — interaction disabled via pointer-events */
.bcl-card.is-prelaunched .bcl-card__variations {
    opacity: 0.4;
    pointer-events: none;
    user-select: none;
}

/* ── Pre-launch block (replaces the Add to Cart button) ── */
.bcl-card__prelaunch {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
}

.bcl-card__prelaunch-label {
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--bcl-muted, #8C7B6E);
    font-weight: 400;
    white-space: nowrap;
}

/* ── Mini countdown bar DD : HH : MM : SS ── */
.bcl-card__mini-cd {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--bcl-espresso, #2C1A1A);
    padding: 10px 13px;
    color: var(--bcl-cream, #FAF7F2);
}

.bcl-mini-unit {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.bcl-mini-digits {
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    font-weight: 300;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    min-width: 22px;
    text-align: center;
    transition: opacity 0.11s ease;
    display: inline-block;
}

.bcl-mini-digits.is-ticking {
    opacity: 0.4;
}

.bcl-mini-label {
    font-size: 8px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(250, 247, 242, 0.45);
    font-weight: 400;
    font-family: 'DM Sans', sans-serif;
    align-self: flex-end;
    padding-bottom: 1px;
}

.bcl-mini-sep {
    font-size: 15px;
    color: var(--bcl-rose, #C4826A);
    font-family: 'Cormorant Garamond', serif;
    line-height: 1;
    align-self: center;
    padding: 0 1px;
    margin-bottom: 1px;
}

/* Spin animation for add-to-cart loading icon */
@keyframes bcl-spin {
    to { transform: rotate(360deg); }
}
.bcl-icon--spin {
    animation: bcl-spin 0.7s linear infinite;
    transform-origin: center;
}
