/* ==========================================================================
   Public shop: cart, checkout, payment and confirmation pages.

   Loaded on public routes after the template sheets (App.razor). Uses logical properties throughout so the
   same rules serve LTR and RTL; the dark theme is declared at the bottom under html[data-theme="dark"].
   ========================================================================== */

.shop-page {
    min-height: 40vh;
}

/* ---- Progress stepper --------------------------------------------------------- */

.shop-steps {
    margin-block: 0 2rem;
}

.shop-steps-list {
    counter-reset: shop-step;
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.shop-step {
    align-items: center;
    color: #7b8794;
    display: flex;
    flex: 1;
    gap: 0.6rem;
    position: relative;
}

/* The connector runs from each dot to the next, in the reading direction. */
.shop-step:not(:last-child)::after {
    background: #d5dbe3;
    content: "";
    flex: 1;
    height: 2px;
    margin-inline: 0.6rem;
}

.shop-step.is-done:not(:last-child)::after {
    background: #fdb900;
}

.shop-step-dot {
    align-items: center;
    background: #fff;
    border: 2px solid #d5dbe3;
    border-radius: 50%;
    display: inline-flex;
    flex: none;
    font-weight: 700;
    height: 2.2rem;
    justify-content: center;
    width: 2.2rem;
}

.shop-step.is-done .shop-step-dot {
    background: #fdb900;
    border-color: #fdb900;
    color: #212529;
}

.shop-step.is-current .shop-step-dot {
    border-color: #fdb900;
    box-shadow: 0 0 0 4px rgba(253, 185, 0, 0.25);
    color: #212529;
}

.shop-step.is-failed .shop-step-dot {
    background: #dc3545;
    border-color: #dc3545;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.2);
    color: #fff;
}

.shop-step.is-current,
.shop-step.is-done {
    color: inherit;
}

.shop-step-label {
    font-weight: 600;
    white-space: nowrap;
}

.shop-steps-compact {
    display: none;
}

.shop-steps-bar {
    background: #e3e8ef;
    border-radius: 99px;
    height: 6px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.shop-steps-bar span {
    background: #fdb900;
    display: block;
    height: 100%;
}

@media (max-width: 767.98px) {
    .shop-steps-list { display: none; }
    .shop-steps-compact { display: block; }
}

/* ---- Cards ------------------------------------------------------------------------ */

.shop-card {
    background: #fff;
    border: 1px solid #e3e8ef;
    padding: 1.25rem 1.5rem;
}

.shop-card + .shop-card,
.shop-item + .shop-item {
    margin-top: 1rem;
}

/* ---- Cart line items ---------------------------------------------------------------- */

.shop-item {
    align-items: center;
    background: #fff;
    border: 1px solid #e3e8ef;
    display: grid;
    gap: 0.75rem 1.25rem;
    grid-template-areas: "icon info qty total";
    grid-template-columns: auto 1fr auto auto;
    padding: 1rem 1.25rem;
}

.shop-item-icon {
    align-items: center;
    background: rgba(253, 185, 0, 0.15);
    border-radius: 0.75rem;
    color: #f1a005;
    display: flex;
    font-size: 1.5rem;
    grid-area: icon;
    height: 3.5rem;
    justify-content: center;
    width: 3.5rem;
}

.shop-item-info { grid-area: info; min-width: 0; }
.shop-item-info h3 { font-size: 1.05rem; margin: 0 0 0.2rem; }
.shop-item-meta { color: #7b8794; font-size: 0.85rem; }
.shop-item-qty { grid-area: qty; }
.shop-item-total { font-size: 1.05rem; font-weight: 700; grid-area: total; min-width: 6rem; text-align: end; }

.shop-qty {
    align-items: center;
    border: 1px solid #d5dbe3;
    border-radius: 0.6rem;
    display: inline-flex;
    overflow: hidden;
}

.shop-qty button {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    font-size: 1.1rem;
    height: 2.6rem;
    width: 2.6rem;
}

.shop-qty button:hover:not(:disabled) { background: rgba(253, 185, 0, 0.2); }
.shop-qty button:disabled { cursor: not-allowed; opacity: 0.4; }
.shop-qty button:focus-visible { outline: 2px solid #fdb900; outline-offset: -2px; }

.shop-qty output {
    font-weight: 700;
    min-width: 2.4rem;
    text-align: center;
}

.shop-remove {
    background: transparent;
    border: 0;
    color: #dc3545;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem 0;
}

.shop-remove:hover { text-decoration: underline; }
.shop-remove:disabled { opacity: 0.5; }

.shop-confirm {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    font-size: 0.85rem;
    gap: 0.5rem;
}

@media (max-width: 767.98px) {
    .shop-item {
        grid-template-areas:
            "icon info"
            "qty total";
        grid-template-columns: auto 1fr;
    }

    .shop-item-total { text-align: start; }
}

/* ---- Order summary ---------------------------------------------------------------------- */

.shop-summary {
    background: #fff;
    border: 1px solid #e3e8ef;
    border-top: 4px solid #fdb900;
    padding: 1.25rem 1.5rem;
}

@media (min-width: 992px) {
    .shop-summary-col {
        align-self: flex-start;
        position: sticky;
        inset-block-start: 1rem;
    }
}

.shop-summary-lines li,
.shop-summary-row {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.shop-summary-total {
    border-top: 1px dashed #c8d4d9;
    display: flex;
    font-size: 1.2rem;
    font-weight: 700;
    justify-content: space-between;
    margin-block: 0.75rem;
    padding-top: 0.75rem;
}

.shop-summary-note {
    color: #7b8794;
    font-size: 0.82rem;
    margin: 0 0 0.4rem;
}

/* ---- Payment method radio cards ----------------------------------------------------------- */

.shop-gateways {
    border: 0;
    margin: 0;
    padding: 0;
}

.shop-gateways legend {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.shop-gateway {
    align-items: flex-start;
    background: #fff;
    border: 2px solid #e3e8ef;
    border-radius: 0.75rem;
    cursor: pointer;
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
    padding: 0.9rem 1rem;
    transition: border-color 0.15s;
}

.shop-gateway:hover { border-color: #fdb900; }
.shop-gateway.is-selected { background: rgba(253, 185, 0, 0.1); border-color: #fdb900; }
.shop-gateway:focus-within { box-shadow: 0 0 0 3px rgba(253, 185, 0, 0.35); }
.shop-gateway input { accent-color: #f1a005; margin-top: 0.3rem; }

/* ---- Empty state and messages ----------------------------------------------------------------- */

.shop-empty {
    padding-block: 3rem;
    text-align: center;
}

.shop-empty-icon {
    align-items: center;
    background: rgba(253, 185, 0, 0.15);
    border-radius: 50%;
    color: #f1a005;
    display: inline-flex;
    font-size: 2.5rem;
    height: 6rem;
    justify-content: center;
    margin-bottom: 1.25rem;
    width: 6rem;
}

/* ---- Payment and result pages ------------------------------------------------------------------- */

.shop-narrow {
    margin-inline: auto;
    max-width: 640px;
}

.shop-status-icon {
    align-items: center;
    border-radius: 50%;
    display: inline-flex;
    font-size: 2.5rem;
    height: 5.5rem;
    justify-content: center;
    margin-bottom: 1rem;
    width: 5.5rem;
}

.shop-status-icon.is-success { background: rgba(40, 167, 69, 0.15); color: #28a745; }
.shop-status-icon.is-failed { background: rgba(220, 53, 69, 0.15); color: #dc3545; }
.shop-status-icon.is-pending { background: rgba(253, 185, 0, 0.18); color: #f1a005; }
.shop-status-icon.is-neutral { background: rgba(108, 117, 125, 0.18); color: #6c757d; }

.shop-amount {
    font-size: 2rem;
    font-weight: 700;
}

.shop-order-number {
    align-items: center;
    background: rgba(253, 185, 0, 0.15);
    border-radius: 0.6rem;
    display: inline-flex;
    gap: 0.6rem;
    padding: 0.35rem 0.5rem 0.35rem 0.9rem;
}

.shop-order-number button {
    background: #fff;
    border: 1px solid #d5dbe3;
    border-radius: 0.4rem;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
}

.shop-lines li {
    border-bottom: 1px dashed #c8d4d9;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding-block: 0.5rem;
}

.shop-lines li:last-child { border-bottom: 0; }

.shop-next-links {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.shop-next-links a {
    align-items: center;
    background: #fff;
    border: 1px solid #e3e8ef;
    border-radius: 0.75rem;
    color: inherit;
    display: flex;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    text-decoration: none;
}

.shop-next-links a:hover { border-color: #fdb900; }
.shop-next-links i { color: #f1a005; font-size: 1.3rem; }

/* ---- Mobile bar: the total and the main action stay in reach on small screens ----------------------- */

.shop-mobile-bar {
    background: #fff;
    border-top: 1px solid #e3e8ef;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
    display: none;
    gap: 1rem;
    inset-inline: 0;
    inset-block-end: 0;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    position: fixed;
    z-index: 1030;
}

@media (max-width: 991.98px) {
    .shop-mobile-bar { display: flex; }
    .shop-page.has-mobile-bar { padding-bottom: 5rem; }
}

/* ---- Print: only the receipt ----------------------------------------------------------------------------- */

@media print {
    body * { visibility: hidden; }

    .shop-receipt,
    .shop-receipt * { visibility: visible; }

    .shop-receipt {
        inset-inline: 0;
        inset-block-start: 0;
        position: absolute;
    }

    .no-print { display: none !important; }
}

/* ---- Dark theme --------------------------------------------------------------------------------------- */

html[data-theme="dark"] .shop-card,
html[data-theme="dark"] .shop-item,
html[data-theme="dark"] .shop-summary,
html[data-theme="dark"] .shop-gateway,
html[data-theme="dark"] .shop-next-links a,
html[data-theme="dark"] .shop-mobile-bar {
    background: var(--sd-surface);
    border-color: var(--sd-border);
    color: var(--sd-text);
}

html[data-theme="dark"] .shop-summary { border-top-color: #fdb900; }
html[data-theme="dark"] .shop-gateway.is-selected { background: rgba(253, 185, 0, 0.12); border-color: #fdb900; }
html[data-theme="dark"] .shop-step-dot { background: var(--sd-surface); border-color: var(--sd-border); }
html[data-theme="dark"] .shop-step.is-done .shop-step-dot { background: #fdb900; border-color: #fdb900; }
html[data-theme="dark"] .shop-step.is-failed .shop-step-dot { background: #dc3545; border-color: #dc3545; }
html[data-theme="dark"] .shop-step:not(:last-child)::after { background: var(--sd-border); }
html[data-theme="dark"] .shop-step.is-done:not(:last-child)::after { background: #fdb900; }
html[data-theme="dark"] .shop-steps-bar { background: var(--sd-border); }
html[data-theme="dark"] .shop-qty { border-color: var(--sd-border); }
html[data-theme="dark"] .shop-qty button { color: var(--sd-text); }
html[data-theme="dark"] .shop-summary-total,
html[data-theme="dark"] .shop-lines li { border-color: var(--sd-border); }
html[data-theme="dark"] .shop-item-meta,
html[data-theme="dark"] .shop-summary-note,
html[data-theme="dark"] .shop-step { color: var(--sd-muted); }
html[data-theme="dark"] .shop-step.is-current,
html[data-theme="dark"] .shop-step.is-done { color: var(--sd-text); }
html[data-theme="dark"] .shop-order-number button { background: var(--sd-surface-2); border-color: var(--sd-border); color: var(--sd-text); }
html[data-theme="dark"] .shop-remove { color: #ff8793; }
