/* ==========================================================================
   MoniYes Storefront (catalog/view) & customer receipt (catalog/success)
   Builds on business-app.css tokens (body.biz-app). Layout: views/layouts/store.php
   ========================================================================== */

/* ---------- Helpers ---------- */
/* Initially hidden blocks that storefront.js reveals with jQuery show()/slideDown(). */
body.biz-store .biz-js-hidden { display: none; }

/* ---------- Brand bar ---------- */
.biz-store-bar {
    position: relative;
    z-index: 1020;
    padding: 0.75rem 0;
    color: #fff;
    background:
        radial-gradient(420px 120px at 0% 0%, rgba(11, 26, 233, 0.45), transparent 70%),
        linear-gradient(90deg, var(--biz-navy) 0%, var(--biz-navy-2) 100%);
    border-bottom: 1px solid var(--biz-border-dark);
}

.biz-store-bar__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: #fff;
    text-decoration: none;
}

.biz-store-bar__brand:hover { color: #fff; }

.biz-store-bar__logo {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    object-fit: cover;
    background: #fff;
    flex: 0 0 auto;
}

.biz-store-bar__name {
    font-family: var(--biz-display);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.biz-store-bar__powered {
    font-family: var(--biz-display);
    font-size: 0.72rem;
    color: var(--biz-muted-dark);
}

.biz-store-bar__powered strong { color: var(--biz-gold); font-weight: 700; }

.biz-store-main { min-height: 60vh; }

.biz-store-footer {
    padding: 1.25rem 0;
    border-top: 1px solid var(--biz-border);
    color: var(--biz-muted);
    font-size: 0.8rem;
}

body.biz-store .biz-toast-stack { top: 4.5rem; }

/* ---------- Hero ---------- */
.biz-store-page { padding-bottom: 240px !important; }

@media (min-width: 768px) {
    .biz-store-page { padding-bottom: 160px !important; }
}

.biz-store-hero {
    position: relative;
    padding: 1.5rem;
    border-radius: calc(var(--biz-radius) + 4px);
    color: #fff;
    background:
        radial-gradient(520px 220px at 100% 0%, rgba(74, 108, 247, 0.55), transparent 65%),
        radial-gradient(320px 200px at 0% 120%, rgba(245, 197, 66, 0.2), transparent 70%),
        linear-gradient(135deg, var(--biz-navy) 0%, var(--biz-navy-2) 100%);
    box-shadow: var(--biz-shadow-lg);
    overflow: hidden;
}

.biz-store-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 26px);
}

.biz-store-hero > * { position: relative; }
.biz-store-hero .biz-eyebrow { color: var(--biz-gold); }

.biz-store-hero__logo {
    width: 88px;
    height: 88px;
    flex: 0 0 auto;
    border-radius: 24px;
    object-fit: cover;
    background: #fff;
    border: 3px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 12px 24px -12px rgba(0, 0, 0, 0.45);
}

.biz-store-hero__logo--initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--biz-gold) 0%, var(--biz-gold-deep) 100%);
    color: var(--biz-navy);
    font-family: var(--biz-display);
    font-weight: 800;
    font-size: 1.9rem;
}

.biz-store-hero__title {
    color: #fff !important;
    font-size: clamp(1.5rem, 1.15rem + 1.4vw, 2.4rem);
    font-weight: 800;
    margin: 0.25rem 0 0.35rem;
}

.biz-store-hero__text { color: var(--biz-muted-dark); max-width: 60ch; }

.biz-store-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--biz-border-dark);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-family: var(--biz-display);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.biz-store-chip i { color: var(--biz-gold); }

@media (min-width: 768px) {
    .biz-store-hero { padding: 2rem 2.25rem; }
}

/* ---------- Sticky search ---------- */
.biz-store-search {
    position: sticky;
    top: 0.75rem;
    z-index: 1015;
}

.biz-store-search .input-group {
    border-radius: var(--biz-radius);
    box-shadow: var(--biz-shadow);
}

.biz-store-search .input-group-text {
    background: var(--biz-surface);
    color: var(--biz-blue);
    border-color: rgba(13, 18, 64, 0.14);
}

.biz-store-search .form-control { border-left: 0; }

/* ---------- Product cards ---------- */
.biz-product-card {
    display: flex;
    flex-direction: column;
    background: var(--biz-surface);
    border: 1px solid var(--biz-border);
    border-radius: var(--biz-radius);
    box-shadow: var(--biz-shadow);
    overflow: hidden;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.biz-product-card:hover {
    transform: translateY(-2px);
    border-color: rgba(11, 26, 233, 0.22);
}

.product-row:has(.product-select:checked) .biz-product-card {
    border-color: var(--biz-blue);
    box-shadow: 0 0 0 2px rgba(11, 26, 233, 0.18), var(--biz-shadow);
}

.biz-product-card__media {
    position: relative;
    background: var(--biz-canvas);
}

.biz-product-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.biz-product-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        repeating-linear-gradient(45deg, rgba(11, 26, 233, 0.03) 0 10px, transparent 10px 20px),
        var(--biz-canvas);
    color: rgba(11, 26, 233, 0.35);
    font-size: 2.25rem;
}

.biz-product-card__view {
    position: absolute;
    right: 0.6rem;
    bottom: 0.6rem;
    --bs-btn-bg: rgba(7, 15, 63, 0.78);
    --bs-btn-color: #fff;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-bg: var(--biz-navy);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--biz-navy);
    --bs-btn-active-color: #fff;
    backdrop-filter: blur(4px);
}

.biz-product-card__flag {
    position: absolute;
    left: 0.6rem;
    top: 0.6rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--biz-red);
    color: #fff;
    font-family: var(--biz-display);
    font-size: 0.68rem;
    font-weight: 600;
}

.biz-product-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1 1 auto;
    padding: 0.9rem 1rem 1rem;
}

.biz-product-card__name {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.3;
    word-break: break-word;
}

.biz-product-card__price {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--biz-blue);
}

.biz-product-card__stock { color: var(--biz-muted); }
.biz-product-card__stock .fa-circle { font-size: 0.5rem; vertical-align: middle; }

.biz-product-card__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.biz-product-card.is-out { opacity: 0.6; }
.biz-product-card.is-out:hover { transform: none; border-color: var(--biz-border); }
.biz-product-card.is-out .biz-product-card__img { filter: grayscale(1); }

/* Quantity stepper */
.biz-stepper {
    width: auto;
    flex-wrap: nowrap;
    border: 1px solid rgba(13, 18, 64, 0.14);
    border-radius: var(--biz-radius-sm);
    overflow: hidden;
    background: var(--biz-surface);
}

.biz-stepper .btn {
    --bs-btn-color: var(--biz-heading);
    --bs-btn-hover-bg: var(--biz-canvas);
    --bs-btn-hover-color: var(--biz-blue);
    border: 0;
    border-radius: 0;
    width: 2rem;
}

body.biz-app .biz-stepper .form-control {
    width: 2.75rem;
    flex: 0 0 auto;
    border: 0;
    border-radius: 0;
    padding-left: 0;
    padding-right: 0;
    background: var(--biz-surface);
    -moz-appearance: textfield;
}

.biz-stepper .form-control::-webkit-outer-spin-button,
.biz-stepper .form-control::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Add / Added toggle (btn-check) */
.biz-select-toggle { white-space: nowrap; min-width: 5.5rem; }
.biz-select-toggle__on { display: none; }
.btn-check:checked + .biz-select-toggle .biz-select-toggle__on { display: inline; }
.btn-check:checked + .biz-select-toggle .biz-select-toggle__off { display: none; }

/* ---------- Checkout bar ---------- */
body.biz-app .biz-store-checkout {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    margin: 0;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
    border-radius: var(--biz-radius) var(--biz-radius) 0 0;
    box-shadow: 0 -18px 40px -18px rgba(7, 15, 63, 0.55);
}

@media (min-width: 992px) {
    body.biz-app .biz-store-checkout {
        left: 50%;
        right: auto;
        bottom: 1.25rem;
        width: calc(100% - 2rem);
        max-width: 960px;
        transform: translateX(-50%);
        border-radius: var(--biz-radius);
        padding: 1rem 1.25rem;
    }
}

.biz-store-checkout .form-label,
.biz-store-checkout .form-check-label { color: #fff; }

.biz-store-checkout .biz-eyebrow { color: var(--biz-muted-dark); }

.biz-store-checkout__track { margin-bottom: 0.75rem; font-family: var(--biz-display); font-weight: 600; }

.biz-store-checkout__summary {
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--biz-radius-sm);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--biz-border-dark);
}

.biz-store-summary .list-group-item {
    background: transparent;
    color: #fff;
    border-color: var(--biz-border-dark);
}

.biz-store-summary__qty { color: var(--biz-muted-dark) !important; }

.biz-store-checkout__pay {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--biz-border-dark);
}

.biz-store-checkout__total {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    column-gap: 0.6rem;
    row-gap: 0.15rem;
}

.biz-store-checkout__label {
    font-family: var(--biz-display);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--biz-muted-dark);
}

#cartTotal { font-size: 1.6rem; font-weight: 600; }

.biz-store-checkout__count { font-size: 0.8rem; color: var(--biz-muted-dark); }

.biz-store-checkout__review {
    --bs-btn-color: var(--biz-gold);
    --bs-btn-hover-color: #ffd463;
    --bs-btn-active-color: #ffd463;
    padding: 0;
    text-decoration: none;
}

@media (min-width: 576px) {
    .biz-store-checkout__pay {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .biz-store-checkout__total { justify-content: flex-start; }
}

/* ---------- Product modal ---------- */
.biz-store-modal__media {
    max-width: 480px;
    margin: 0 auto;
    border-radius: var(--biz-radius);
    overflow: hidden;
    background: var(--biz-canvas);
}

/* ---------- Receipt ---------- */
.biz-receipt__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 1rem;
    border-radius: 24px;
    font-size: 1.9rem;
}

.biz-receipt__icon--paid {
    background: rgba(15, 191, 114, 0.12);
    color: var(--biz-green-text);
    box-shadow: 0 0 0 8px rgba(15, 191, 114, 0.06);
}

.biz-receipt__icon--info {
    background: rgba(245, 197, 66, 0.18);
    color: var(--biz-gold-deep);
    box-shadow: 0 0 0 8px rgba(245, 197, 66, 0.08);
}

.biz-receipt__title { font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); font-weight: 800; margin-bottom: 0.35rem; }

.biz-receipt__notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--biz-radius-sm);
    border: 1px solid rgba(245, 197, 66, 0.45);
    background: rgba(245, 197, 66, 0.12);
    color: var(--biz-heading);
}

.biz-receipt__notice i { color: var(--biz-gold-deep); margin-top: 0.2rem; }

.biz-receipt__items {
    border: 1px solid var(--biz-border);
    border-radius: var(--biz-radius-sm);
}

.biz-receipt__totals {
    margin-top: 1rem;
    padding-top: 0.5rem;
}

.biz-receipt__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.35rem 0;
}

.biz-receipt__row dt { font-weight: 600; color: var(--biz-muted); }
.biz-receipt__row dd { margin: 0; color: var(--biz-heading); }

.biz-receipt__row--total {
    margin-top: 0.35rem;
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(13, 18, 64, 0.2);
}

.biz-receipt__row--total dt {
    font-family: var(--biz-display);
    font-size: 1rem;
    color: var(--biz-heading);
}

.biz-receipt__row--total dd {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--biz-blue);
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .biz-product-card,
    .biz-product-card:hover { transition: none; transform: none; }
}

/* ---------- Print (receipt) ---------- */
@media print {
    @page { margin: 1cm; }

    body.biz-store {
        background: #fff !important;
        color: #000 !important;
    }

    .biz-store-bar,
    .biz-store-footer,
    .biz-toast-stack,
    .biz-skip-link,
    .biz-receipt__actions,
    .biz-store-checkout,
    .js-copy {
        display: none !important;
    }

    .biz-store .card {
        box-shadow: none !important;
        border-color: #999 !important;
    }

    .biz-receipt__icon,
    .biz-receipt__notice {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
