/* ==========================================================================
   Hira Mini Cart v2.0
   Navy #14304f · Blue #2f6fed · Right drawer (desktop) · Bottom-sheet (mobile)
   ========================================================================== */

.hmc-launcher,
.hmc-drawer-root {
    --hmc-accent:      #2f6fed;
    --hmc-accent-dark: #1e5bc6;
    --hmc-accent-pale: #eff6ff;
    --hmc-navy:        #14304f;
    --hmc-bg:          #ffffff;
    --hmc-surface:     #f8fafc;
    --hmc-text:        #14304f;
    --hmc-muted:       #64748b;
    --hmc-border:      #e2e8f0;
    --hmc-danger:      #ef4444;
    --hmc-trans:       0.26s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: var(--hmc-text);
    box-sizing: border-box;
}
.hmc-launcher *,
.hmc-launcher *::before,
.hmc-launcher *::after,
.hmc-drawer-root *,
.hmc-drawer-root *::before,
.hmc-drawer-root *::after { box-sizing: border-box; }

body.hmc-locked { overflow: hidden; }

/* ==========================================================================
   TRIGGER
   ========================================================================== */

.hmc-launcher { display: inline-flex; position: relative; }

.hmc-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    border: none;
    font-family: inherit;
    line-height: 1;
    position: relative;
    transition: transform var(--hmc-trans), box-shadow var(--hmc-trans), background var(--hmc-trans);
}
.hmc-trigger:focus-visible {
    outline: 2px solid var(--hmc-accent);
    outline-offset: 3px;
}

/* Filled — Hira navy with rounded-square shape (distinct from round circle) */
.hmc-trigger--filled {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--hmc-navy);
    color: #ffffff;
}
.hmc-trigger--filled:hover {
    background: var(--hmc-accent);
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(47,111,237,0.35);
}

/* Outline */
.hmc-trigger--outline {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: transparent;
    border: 2px solid var(--hmc-navy) !important;
    color: var(--hmc-navy);
}
.hmc-trigger--outline:hover {
    background: var(--hmc-accent-pale);
    border-color: var(--hmc-accent) !important;
    color: var(--hmc-accent);
}

/* Pill */
.hmc-trigger--pill {
    background: var(--hmc-navy);
    border-radius: 999px;
    padding: 9px 16px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border: none !important;
}
.hmc-trigger--pill:hover { background: var(--hmc-accent); }

.hmc-trigger-count { font-size: 14px; font-weight: 700; }

/* Badge */
.hmc-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--hmc-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
    pointer-events: none;
    border: 2px solid #fff;
}
.hmc-badge--hidden { display: none; }

/* ==========================================================================
   DRAWER
   ========================================================================== */

.hmc-drawer-root {
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    visibility: hidden;
}
.hmc-drawer-root.is-open {
    pointer-events: auto;
    visibility: visible;
}

.hmc-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,0.55);
    opacity: 0;
    transition: opacity var(--hmc-trans);
    cursor: pointer;
    border: none;
    -webkit-tap-highlight-color: transparent;
}
.hmc-drawer-root.is-open .hmc-backdrop { opacity: 1; }

.hmc-sheet {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 420px;
    background: var(--hmc-bg);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--hmc-trans);
    box-shadow: -8px 0 40px rgba(15,23,42,0.15);
    overflow: hidden;
    border-left: 1px solid var(--hmc-border);
}
.hmc-drawer-root.is-open .hmc-sheet { transform: translateX(0); }

/* ==========================================================================
   SHEET HEADER — dark navy bar (Hira signature style)
   ========================================================================== */

.hmc-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px;
    background: #ffffff;
    border-bottom: 1px solid #e6ebf1;
    flex-shrink: 0;
}

.hmc-sheet-title {
    font-size: 19px;
    font-weight: 800;
    color: #14304f;
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 7px;
    letter-spacing: 0;
    text-transform: none;
}
.hmc-header-count {
    font-size: 15px;
    font-weight: 500;
    color: #8a97a6;
    text-transform: none;
    letter-spacing: 0;
}

.hmc-sheet-close {
    width: 34px;
    height: 34px;
    border: 1.5px solid #e6ebf1;
    background: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #14304f;
    flex-shrink: 0;
    transition: background var(--hmc-trans), border-color var(--hmc-trans);
}
.hmc-sheet-close:hover { background: #f1f5f9; border-color: #cbd5e1; }

/* ==========================================================================
   BODY
   ========================================================================== */

.hmc-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    position: relative;
}

.hmc-items { list-style: none; margin: 0; padding: 0; }

.hmc-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--hmc-border);
    position: relative;
    transition: background var(--hmc-trans);
}
.hmc-item:last-child { border-bottom: none; }
.hmc-item:hover { background: var(--hmc-surface); }

/* Image — pale blue background (matches Hira shop cards) */
.hmc-item-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 10px;
    border: 1.5px solid var(--hmc-border);
    background: var(--hmc-accent-pale);
    padding: 6px;
    flex-shrink: 0;
}

.hmc-item-body { flex: 1; min-width: 0; }

.hmc-item-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--hmc-text);
    margin: 0 0 3px;
    padding-right: 26px;
    line-height: 1.4;
}
.hmc-item-variation {
    font-size: 12px;
    color: var(--hmc-muted);
    margin: 0 0 6px;
}

.hmc-bundle-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.hmc-bundle-label {
    font-size: 11px; font-weight: 700; color: var(--hmc-muted);
    background: var(--hmc-surface); border: 1px solid var(--hmc-border);
    border-radius: 4px; padding: 2px 6px; text-transform: uppercase; letter-spacing: 0.04em;
}
.hmc-discount-label {
    font-size: 11px; font-weight: 800; color: #15803d;
    background: #dcfce7; border-radius: 4px; padding: 2px 7px;
}

/* Qty + price wrapper row */
.hmc-qty-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    gap: 10px;
}

/* Qty stepper — connected style */
.hmc-qty-row {
    display: flex;
    align-items: center;
    background: var(--hmc-surface);
    border: 1.5px solid var(--hmc-border);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.hmc-qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: var(--hmc-text);
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--hmc-trans), color var(--hmc-trans);
    flex-shrink: 0;
}
.hmc-qty-btn:hover { background: var(--hmc-accent); color: #fff; }

.hmc-qty-num {
    min-width: 32px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--hmc-text);
    border-left: 1px solid var(--hmc-border);
    border-right: 1px solid var(--hmc-border);
    line-height: 30px;
}

.hmc-item-subtotal {
    font-size: 14px;
    font-weight: 800;
    color: var(--hmc-text);
    white-space: nowrap;
    flex-shrink: 0;
}

.hmc-remove-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 22px;
    height: 22px;
    border: none;
    background: none;
    color: #cbd5e1;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background var(--hmc-trans), color var(--hmc-trans);
    padding: 0;
}
.hmc-remove-btn:hover { background: #fee2e2; color: var(--hmc-danger); }

/* Empty state */
.hmc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 24px;
    text-align: center;
    gap: 16px;
}
.hmc-empty p { font-size: 15px; color: var(--hmc-muted); margin: 0; font-weight: 500; }
.hmc-browse-btn {
    display: inline-block;
    padding: 11px 28px;
    background: var(--hmc-navy);
    color: #fff !important;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    transition: background var(--hmc-trans);
}
.hmc-browse-btn:hover { background: var(--hmc-accent); }

/* ==========================================================================
   FOOTER
   ========================================================================== */

.hmc-sheet-footer {
    border-top: 1.5px solid var(--hmc-border);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--hmc-surface);
    flex-shrink: 0;
}

.hmc-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    padding: 12px 14px;
    border: 1.5px solid var(--hmc-border);
    border-radius: 10px;
    background: #fff;
    transition: border-color var(--hmc-trans), background var(--hmc-trans);
    position: relative;
}
.hmc-consent-label:has(.hmc-consent-check:checked) {
    border-color: var(--hmc-accent);
    background: var(--hmc-accent-pale);
}

.hmc-consent-check { position: absolute; opacity: 0; width: 0; height: 0; }

.hmc-consent-box {
    width: 20px;
    height: 20px;
    border: 2px solid var(--hmc-border);
    border-radius: 5px;
    flex-shrink: 0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    transition: border-color var(--hmc-trans), background var(--hmc-trans);
}
.hmc-consent-check:checked ~ .hmc-consent-box {
    background: var(--hmc-accent);
    border-color: var(--hmc-accent);
}
.hmc-consent-check:checked ~ .hmc-consent-box::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}

.hmc-consent-text { font-size: 12.5px; line-height: 1.5; color: var(--hmc-muted); }

/* Subtotal — card style */
.hmc-subtotal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border: 1.5px solid var(--hmc-border);
    border-radius: 10px;
    padding: 12px 14px;
}
.hmc-subtotal-label {
    font-weight: 600;
    color: var(--hmc-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.hmc-subtotal-val { font-weight: 800; color: var(--hmc-text); font-size: 18px; }

.hmc-shipping-note {
    font-size: 12px;
    color: #16a34a;
    font-weight: 600;
    margin: -4px 0 0;
    text-align: center;
}

/* Checkout button — navy → blue on hover, arrow icon */
.hmc-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 20px;
    background: var(--hmc-navy);
    color: #ffffff !important;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none !important;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: background var(--hmc-trans), transform var(--hmc-trans), box-shadow var(--hmc-trans), opacity var(--hmc-trans);
}
.hmc-checkout-btn:hover:not(:disabled):not(.hmc-checkout-btn--locked) {
    background: var(--hmc-accent);
    box-shadow: 0 6px 20px rgba(47,111,237,0.28);
    transform: translateY(-1px);
}
.hmc-checkout-btn--locked {
    opacity: .4;
    cursor: not-allowed;
    pointer-events: none;
}

.hmc-consent-hint {
    font-size: 12px;
    color: var(--hmc-muted);
    text-align: center;
    margin: -6px 0 0;
    transition: opacity var(--hmc-trans);
}
.hmc-consent-hint.is-hidden { opacity: 0; }

.hmc-view-cart-link {
    display: block;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--hmc-text) !important;
    text-decoration: none !important;
    padding: 10px;
    border: 1.5px solid var(--hmc-border);
    border-radius: 8px;
    background: #fff;
    transition: border-color var(--hmc-trans), background var(--hmc-trans), color var(--hmc-trans);
}
.hmc-view-cart-link:hover {
    border-color: var(--hmc-accent);
    color: var(--hmc-accent) !important;
    background: var(--hmc-accent-pale);
}

/* ==========================================================================
   LOADING OVERLAY
   ========================================================================== */

.hmc-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.75);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--hmc-trans);
    z-index: 10;
}
.hmc-loading-overlay.is-loading { opacity: 1; pointer-events: auto; }

.hmc-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--hmc-accent-pale);
    border-top-color: var(--hmc-accent);
    border-radius: 50%;
    animation: hmc-spin .65s linear infinite;
}
@keyframes hmc-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   MOBILE — bottom sheet
   ========================================================================== */

@media (max-width: 640px) {
    .hmc-sheet {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        max-width: 100%;
        height: 90dvh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        box-shadow: 0 -6px 40px rgba(15,23,42,.18);
        border-left: none;
        border-top: 1px solid var(--hmc-border);
    }
    .hmc-drawer-root.is-open .hmc-sheet { transform: translateY(0); }

    .hmc-sheet-header {
        position: relative;
        padding-top: 28px;
        border-radius: 20px 20px 0 0;
    }
    /* drag handle */
    .hmc-sheet-header::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        border-radius: 2px;
        background: rgba(255,255,255,0.3);
    }

    .hmc-item { padding: 14px 16px; gap: 12px; }
    .hmc-item-img { width: 62px; height: 62px; }
    .hmc-sheet-footer { padding: 14px 16px; gap: 10px; }
    .hmc-checkout-btn { font-size: 16px; padding: 16px; }
    .hmc-subtotal-val { font-size: 16px; }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .hmc-sheet, .hmc-backdrop, .hmc-trigger, .hmc-qty-btn, .hmc-checkout-btn {
        transition-duration: 0.01ms !important;
    }
    .hmc-spinner { animation-duration: 0.01ms !important; }
}

/* ============================================================
   HIRA ADDITIONS — Free-shipping progress bar, notice, buttons
   ============================================================ */

/* Free U.S. shipping progress bar */
.hmc-freeship{
    padding:12px 20px 14px;
    background:#eef4fb;
    border-bottom:1px solid #e0e9f4;
}
.hmc-freeship-row{
    display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:9px;
}
.hmc-freeship-text{font-size:13.5px;font-weight:600;color:#14304f;line-height:1.35;}
.hmc-freeship-text b{color:#2f6fed;}
.hmc-freeship-amount{font-size:13.5px;font-weight:700;color:#14304f;white-space:nowrap;}
.hmc-freeship-track{position:relative;height:6px;border-radius:99px;background:#d3e2f4;overflow:hidden;}
.hmc-freeship-fill{position:absolute;inset:0 auto 0 0;width:0;border-radius:99px;background:linear-gradient(90deg,#2f6fed,#1e5bc6);transition:width .4s ease;}
.hmc-freeship.is-unlocked .hmc-freeship-fill{background:linear-gradient(90deg,#1f9d57,#188a4b);}

/* Research-use notice (under subtotal) */
.hmc-notice{margin:6px 0 14px;font-size:12.5px;line-height:1.55;color:#8a97a6;}
.hmc-notice b{color:#7a5c22;font-weight:700;}

/* View Cart — full-width outline button (matches image) */
.hmc-drawer-root .hmc-view-cart-link{
    display:flex !important;align-items:center;justify-content:center;
    width:100%;margin-top:10px;padding:13px 20px;
    border:1.5px solid #14304f;border-radius:10px;
    background:#fff;color:#14304f !important;
    font-size:15px;font-weight:700;text-decoration:none;text-align:center;
    transition:background .2s ease,color .2s ease;
}
.hmc-drawer-root .hmc-view-cart-link:hover{background:#14304f;color:#fff !important;}
