/* =============================================================
   Horizon Crafted — Cart Drawer
   flatsome-child/assets/css/hc-cart.css

   Mirrors BoxTray.jsx:
   - Dark slide-over from right (hc-ink-800)
   - Blurred overlay backdrop
   - 5-spot tracker
   - Line items: thumb, name, maker, personalised badge, remove
   - Ship date note, subtotal, gold CTA
   - Empty state
   ============================================================= */

/* ── overlay backdrop ──────────────────────────────────────── */
.hc-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(33, 31, 28, 0.42);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-base) var(--ease-craft);
    z-index: 60;
}
.hc-cart-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* ── drawer panel ───────────────────────────────────────────── */
.hc-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 90vw;
    background: var(--hc-ink-800);
    color: var(--hc-ivory);
    z-index: 70;
    transform: translateX(100%);
    transition: transform var(--dur-slow) var(--ease-craft);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}
.hc-cart-drawer[hidden] {
    display: flex; /* keep flex even when hidden so transition works */
    visibility: hidden;
}
.hc-cart-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
}

/* ── header ─────────────────────────────────────────────────── */
.hc-cart-header {
    padding: 24px 26px;
    border-bottom: 1px solid var(--hc-ink-600);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.hc-cart-header__title {
    display: flex;
    align-items: center;
    gap: 11px;
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--hc-ivory);
}

.hc-cart-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--hc-stone-300);
    display: flex;
    align-items: center;
    padding: 4px;
    transition: color var(--dur-fast);
}
.hc-cart-close:hover { color: var(--hc-ivory); }
.hc-cart-close .ph { font-size: 22px; }

/* ── spot tracker ───────────────────────────────────────────── */
.hc-cart-spots {
    padding: 18px 26px;
    border-bottom: 1px solid var(--hc-ink-600);
    flex-shrink: 0;
}
.hc-cart-spots__labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}
.hc-cart-spots__count {
    font-size: 10px;
    color: var(--hc-stone-300);
}
.hc-cart-spots__left {
    font-size: 10px;
}
.hc-cart-spots__track {
    display: flex;
    gap: 8px;
}
.hc-cart-spot {
    flex: 1;
    aspect-ratio: 1;
    border-radius: var(--r-sm);
    background: transparent;
    border: 1px dashed var(--hc-ink-600);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--dur-base), border var(--dur-base);
}
.hc-cart-spot.is-filled {
    background: var(--hc-ink-700);
    border: 1px solid var(--hc-ink-600);
}
.hc-cart-spot .ph,
.hc-cart-spot .ph-light {
    font-size: 18px;
    color: var(--hc-stone-400);
}
.hc-cart-spot.is-filled .ph,
.hc-cart-spot.is-filled .ph-light {
    color: var(--hc-gold-400);
}

/* ── items list ─────────────────────────────────────────────── */
.hc-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px 26px;
}
.hc-cart-items::-webkit-scrollbar { width: 4px; }
.hc-cart-items::-webkit-scrollbar-thumb {
    background: var(--hc-ink-600);
    border-radius: 999px;
}

/* empty state */
.hc-cart-empty {
    text-align: center;
    padding: 56px 20px;
    color: var(--hc-stone-400);
}
.hc-cart-empty .ph-light {
    font-size: 42px;
    color: var(--hc-stone-400);
}
.hc-cart-empty p {
    font-family: var(--font-serif);
    font-size: 18px;
    line-height: 1.55;
    margin-top: 14px;
    color: var(--hc-stone-300);
}
.hc-cart-empty em { font-style: italic; }

/* item row */
.hc-cart-item {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--hc-ink-700);
    align-items: flex-start;
}
.hc-cart-item:last-child { border-bottom: none; }

/* thumbnail */
.hc-cart-item__thumb {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    border-radius: var(--r-sm);
    background: var(--hc-ink-700);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.hc-cart-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hc-cart-item__thumb .ph-light {
    font-size: 26px;
    color: var(--hc-gold-400);
}

/* info */
.hc-cart-item__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.hc-cart-item__name {
    font-family: var(--font-display);
    font-size: 17px;
    color: var(--hc-ivory);
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hc-cart-item__name:hover { color: var(--hc-gold-400); }

.hc-cart-item__maker {
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--hc-stone-400);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.hc-cart-item__qty {
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--hc-stone-400);
}
.hc-cart-item__badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-sans);
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--hc-gold-400);
    margin-top: 2px;
}
.hc-cart-item__badge .ph { font-size: 13px; }

/* price + remove */
.hc-cart-item__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}
.hc-cart-item__price {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--hc-ivory);
}
.hc-cart-item__remove {
    display: flex;
    align-items: center;
    color: var(--hc-stone-400);
    text-decoration: none;
    transition: color var(--dur-fast);
    cursor: pointer;
}
.hc-cart-item__remove:hover { color: var(--hc-error); }
.hc-cart-item__remove .ph { font-size: 15px; }

/* ── footer ─────────────────────────────────────────────────── */
.hc-cart-footer {
    padding: 20px 26px;
    border-top: 1px solid var(--hc-ink-600);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ship date note — inherits hc-delivery-note from hc-product.css
   but overrides colours for the dark drawer */
.hc-cart-ship-note {
    color: var(--hc-stone-300);
}
.hc-cart-ship-note .ph-light { color: var(--hc-gold-400); }
.hc-cart-ship-note .hc-delivery-note__text strong { color: var(--hc-ivory); }

/* subtotal row */
.hc-cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.hc-cart-subtotal__label {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--hc-stone-300);
    text-transform: uppercase;
    letter-spacing: 0.14em;
}
.hc-cart-subtotal__value {
    font-family: var(--font-sans);
    font-size: 20px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--hc-ivory);
}
/* WC wraps the subtotal in a <span> with its own styles — override */
.hc-cart-subtotal__value .woocommerce-Price-amount,
.hc-cart-subtotal__value bdi {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

/* CTA button */
.hc-cart-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    text-decoration: none;
    width: 100%;
}
.hc-btn--lg {
    font-size: 13px;
    padding: 16px 30px;
}

/* continue shopping */
.hc-cart-continue {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--hc-stone-400);
    text-align: center;
    padding: 0;
    transition: color var(--dur-fast);
    letter-spacing: 0.04em;
}
.hc-cart-continue:hover { color: var(--hc-stone-300); }

/* ── responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
    .hc-cart-drawer { width: 100vw; max-width: 100vw; }
    .hc-cart-header { padding: 20px; }
    .hc-cart-spots  { padding: 14px 20px; }
    .hc-cart-items  { padding: 8px 20px; }
    .hc-cart-footer { padding: 16px 20px; }
}

/* ── hc-btn — gold CTA (self-contained, no dependency on hc-product.css) ── */
.hc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-family: var(--font-sans);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    border-radius: var(--r-md);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--dur-base) var(--ease-craft);
    white-space: nowrap;
    text-decoration: none;
}

.hc-btn--gold {
    background: var(--hc-gold-500);
    color: var(--hc-ink-900) !important;
    box-shadow: var(--shadow-xs);
    width: 100%;
}
.hc-btn--gold:hover {
    background: var(--hc-gold-600);
    box-shadow: var(--shadow-gold);
    color: var(--hc-ink-900) !important;
    text-decoration: none;
}

.hc-btn--lg {
    font-size: 13px;
    padding: 16px 30px;
}

/* ── price override — WC injects its own color ──────────────── */
.hc-cart-item__price,
.hc-cart-item__price .woocommerce-Price-amount,
.hc-cart-item__price bdi,
.hc-cart-item__price * {
    color: var(--hc-ivory) !important;
    font-family: var(--font-sans) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}

/* subtotal value override */
.hc-cart-subtotal__value,
.hc-cart-subtotal__value .woocommerce-Price-amount,
.hc-cart-subtotal__value bdi {
    color: var(--hc-ivory) !important;
    font-size: 20px !important;
    font-weight: 500 !important;
}

/* ── DRAWER TEMPORARILY DISABLED ───────────────────────────────
   Using Flatsome native cart on all devices until drawer is rebuilt.
   Re-enable by removing this block and restoring isMobile() in hc-cart.js
   ─────────────────────────────────────────────────────────────── */
.hc-cart-drawer,
.hc-cart-overlay {
    display: none !important;
}
