/* restaurant/static/restaurant/css/stepper/restaurant-checkout-state.css
   Minimum-order notice, processing state and order-confirmed card.
   Same language as the booking stepper (booking-l10n.css §6-7).
   Linked from restaurant-stepper2.html, so every card theme gets it. */

:root {
    --rs-accent: var(--menu-primary-color, var(--primary-color, #dc2626));
    --rs-success: #198754;
}

/* ---------- Minimum order: ONE alert at the top of the cart summary ----- */
.restaurant-min-order-notice.alert {
    display: block;
    margin: 0 0 0.85rem;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    font-size: 0.88rem;
    line-height: 1.6;
    text-align: start;
}

.rmo-head {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.rmo-head i {
    margin-top: 0.25rem;
    flex: 0 0 auto;
}

.rmo-bar {
    height: 6px;
    margin-top: 0.55rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.rmo-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #d39e00;
    transition: width 0.3s ease;
}

/* ---------- Processing state ------------------------------------------ */
#restaurantCheckoutLoading {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    padding: 2.5rem 1rem 2rem;
}

.rs-spinner {
    position: relative;
    width: 72px;
    height: 72px;
    color: var(--rs-accent);
}

.rs-spinner svg {
    width: 100%;
    height: 100%;
    animation: rs-rotate 1.4s linear infinite;
}

.rs-spinner circle {
    fill: none;
    stroke-width: 4;
}

.rs-track {
    stroke: color-mix(in srgb, currentColor 15%, transparent);
}

.rs-arc {
    stroke: currentColor;
    stroke-linecap: round;
    stroke-dasharray: 90 150;
    animation: rs-dash 1.4s ease-in-out infinite;
}

.rs-spinner i {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
}

.rs-title {
    margin: 0.25rem 0 0;
    font-weight: 700;
    font-size: 1.05rem;
    color: #212529;
}

.rs-steps {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
    text-align: start;
    font-size: 0.9rem;
    color: #8a9099;
}

.rs-step {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: color 0.3s ease;
}

.rs-dot {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border-radius: 50%;
    border: 2px solid #d0d5dc;
    transition: all 0.3s ease;
}

.rs-step.is-active {
    color: #212529;
    font-weight: 600;
}

.rs-step.is-active .rs-dot {
    border-color: var(--rs-accent);
    border-top-color: transparent;
    animation: rs-rotate 0.8s linear infinite;
}

.rs-step.is-done {
    color: var(--rs-success);
}

.rs-step.is-done .rs-dot {
    border-color: var(--rs-success);
    background: var(--rs-success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='white' stroke-width='2.5' d='M4 8.5l2.5 2.5L12 5.5'/%3E%3C/svg%3E") center/12px no-repeat;
}

.rs-hint {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: #8a9099;
}

@keyframes rs-rotate {
    to { transform: rotate(360deg); }
}

@keyframes rs-dash {
    0% { stroke-dasharray: 1 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90 150; stroke-dashoffset: -124; }
}

/* ---------- Order confirmed ------------------------------------------- */
#restaurantCheckoutSuccess {
    margin: 0;
    padding: 0.5rem 0 0;
    text-align: center;
}

#restaurantCheckoutSuccess .restaurant-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 0.75rem;
    font-size: 0;
}

.restaurant-success-icon svg {
    width: 100%;
    height: 100%;
}

.restaurant-success-icon circle {
    fill: #e8f6ee;
    stroke: var(--rs-success);
    stroke-width: 2;
}

.restaurant-success-icon path {
    fill: none;
    stroke: var(--rs-success);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: rs-check 0.5s 0.15s ease-out forwards;
}

@keyframes rs-check {
    to { stroke-dashoffset: 0; }
}

#restaurantCheckoutSuccess .restaurant-success-title {
    margin: 0 0 0.25rem;
    font-size: 1.2rem;
    font-weight: 700;
}

#restaurantCheckoutSuccess .restaurant-success-message {
    margin: 0 0 1rem;
    color: #6c757d;
    font-size: 0.92rem;
}

#restaurantOrderDetailsFinal {
    margin: 0;
    text-align: start;
}

.rs-card {
    border: 1px solid #e9ecef;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.rs-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem;
    font-weight: 600;
    color: #495057;
    background: color-mix(in srgb, var(--rs-accent) 7%, #fff);
    border-bottom: 1px solid #eef0f2;
}

.rs-order-no {
    font-weight: 700;
    color: #212529;
    letter-spacing: 0.3px;
}

.rs-items {
    list-style: none;
    margin: 0;
    padding: 0.4rem 1rem;
    border-bottom: 1px dashed #eef0f2;
}

.rs-items li {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-size: 0.92rem;
}

.rs-qty {
    flex: 0 0 auto;
    min-width: 1.8rem;
    font-weight: 700;
    color: var(--rs-accent);
}

.rs-name {
    flex: 1 1 auto;
    min-width: 0;
    color: #212529;
}

.rs-line {
    flex: 0 0 auto;
    color: #495057;
    white-space: nowrap;
}

.rs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
}

.rs-row + .rs-row {
    border-top: 1px dashed #eef0f2;
}

.rs-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    white-space: nowrap;
}

.rs-label i {
    width: 1rem;
    text-align: center;
    color: var(--rs-accent);
}

.rs-value {
    font-weight: 600;
    color: #212529;
    text-align: end;
}

.rs-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-top: 1px solid #eef0f2;
    font-size: 1rem;
}

.rs-total strong {
    color: var(--rs-success);
    font-size: 1.1rem;
}

.rs-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.85rem 0 0;
    font-size: 0.85rem;
    color: #6c757d;
}

#restaurantCheckoutSuccess .restaurant-success-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 1.1rem 0 0;
}

#restaurantCheckoutSuccess .restaurant-success-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin: 0;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
    .rs-spinner svg, .rs-arc, .rs-step.is-active .rs-dot { animation-duration: 3s; }
}

/* ordering paused / closed and "ordering for table 5" (restaurant-stepper.html, restaurant/kitchen.py) */
.restaurant-ordering-closed {
    display: flex; gap: .75rem; align-items: flex-start; margin: 0 0 1rem; padding: .85rem 1rem; border-radius: .75rem;
    background: #fff4e5; color: #7a4100; border: 1px solid #ffd8a8;
}
.restaurant-ordering-closed > i { font-size: 1.25rem; margin-top: .15rem; }
.restaurant-ordering-closed strong { display: block; }
.restaurant-table-banner {
    display: flex; gap: .5rem; align-items: center; margin: 0 0 1rem; padding: .6rem .9rem; border-radius: .75rem;
    background: #ebfbee; color: #1b5e20; border: 1px solid #b2f2bb; font-weight: 600;
}
[data-bs-theme="dark"] .restaurant-ordering-closed { background: #3b2a12; color: #ffd8a8; border-color: #5c3d12; }
[data-bs-theme="dark"] .restaurant-table-banner { background: #12301a; color: #b2f2bb; border-color: #1f4d2b; }

/* recent addresses on this device (restaurant-stepper.js restoreCustomer) */
.restaurant-saved-addresses { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.restaurant-saved-addresses[hidden] { display: none; }
.restaurant-saved-address {
    border: 1px dashed var(--bs-border-color, #ced4da); background: transparent; border-radius: .5rem;
    padding: .25rem .6rem; font-size: .8rem; max-width: 100%; text-align: start; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; color: inherit;
}
.restaurant-saved-address:hover { border-style: solid; }
.restaurant-table-banner.is-warning { background: #fff4e5; color: #7a4100; border-color: #ffd8a8; }
