/* Premium mobile checkout layer for the public cart. Scoped to avoid changing admin/POS screens. */
body:has(.cart-page) {
    background: linear-gradient(145deg, rgba(236, 253, 245, 0.82), rgba(224, 242, 254, 0.78));
}

body:has(.cart-page) .app-shell {
    padding-bottom: 32px;
}

.cart-page {
    max-width: 980px;
    margin: 0 auto;
}

.cart-summary,
.cart-item,
.checkout-card {
    border-radius: 24px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.09);
}

.cart-summary {
    padding: clamp(20px, 5vw, 34px);
}

.cart-summary h1 {
    margin: 0;
    font-size: clamp(2rem, 9vw, 3.35rem);
    line-height: 0.95;
    letter-spacing: 0;
}

.cart-summary p {
    max-width: 560px;
    margin-top: 14px;
    font-size: clamp(1rem, 4vw, 1.2rem);
    line-height: 1.45;
}

.cart-list {
    gap: 16px;
}

.cart-item {
    padding: clamp(18px, 5vw, 28px);
}

.cart-item__head {
    align-items: flex-start;
    gap: 14px;
}

.cart-item__head h2 {
    margin: 0;
    font-size: clamp(1.22rem, 5vw, 1.8rem);
    line-height: 1.08;
}

.cart-item__head p,
.cart-item__quantity,
.selected-options,
.item-note {
    color: #64748b;
}

.cart-item__head strong {
    white-space: nowrap;
    font-size: clamp(1.05rem, 4.5vw, 1.45rem);
}

.cart-item__actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
    margin-top: 18px;
}

.cart-quantity-form {
    display: grid;
    grid-template-columns: minmax(86px, 118px) auto;
    gap: 12px;
    align-items: end;
}

.cart-quantity-form label {
    display: grid;
    gap: 6px;
}

.cart-quantity-form label span {
    color: #64748b;
    font-weight: 800;
}

.cart-quantity-form input[type="number"] {
    min-height: 52px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
    font-size: 1.12rem;
    font-weight: 700;
}

.cart-item__actions .button {
    min-height: 52px;
    border-radius: 999px;
    padding: 0 22px;
    font-weight: 900;
}

.cart-item__actions .button--ghost {
    background: #eef2f3;
    color: #22c55e;
    border-color: transparent;
}

.cart-item__actions .button--danger {
    background: #fee2e2;
    color: #b91c1c;
    border-color: transparent;
}

.checkout-card {
    padding: clamp(18px, 5vw, 30px);
}

.checkout-form {
    gap: 18px;
}

.checkout-form > div:first-of-type:not(.flash):not(.checkout-loading):not(.checkout-actions):not(.checkout-total) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    font-size: 1.05rem;
}

.checkout-form > div:first-of-type strong {
    font-size: 1.15rem;
}

.checkout-form label:not(.checkout-conditional):not(.checkout-choice) span,
.checkout-group legend,
.checkout-select-field > span {
    color: #111827;
    font-weight: 850;
    font-size: 1.05rem;
}

.checkout-form input,
.checkout-form textarea,
.checkout-form select {
    min-height: 58px;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.09);
    background: #fff;
    color: #111827;
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
}

.checkout-form input::placeholder,
.checkout-form textarea::placeholder {
    color: #a3aab7;
}

.checkout-choice-grid,
.checkout-payment-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.checkout-choice,
.checkout-payment-button {
    min-height: 72px;
    display: grid;
    place-items: center;
    padding: 12px 10px;
    border: 2px solid #111827;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    text-align: center;
    font: inherit;
    font-size: clamp(0.92rem, 3.6vw, 1.08rem);
    font-weight: 900;
    line-height: 1.12;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
    transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.checkout-choice:hover,
.checkout-payment-button:hover {
    transform: translateY(-1px);
}

.checkout-choice:has(input:checked),
.checkout-payment-button.is-selected {
    background: #111827;
    color: #fff;
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.22);
}

.checkout-choice span {
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

.checkout-choice span small {
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.72rem;
}

.checkout-choice:not(:has(input:checked)) span small {
    color: #64748b;
}

.checkout-select-field.is-enhanced select {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.checkout-total {
    padding: 10px 0 2px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    font-size: 1.08rem;
}

.checkout-total strong {
    font-size: clamp(1.6rem, 7vw, 2.35rem);
    line-height: 1;
}

.checkout-actions .button--whatsapp,
.checkout-actions .button--online-pay {
    min-height: 64px;
    border-radius: 999px;
    font-size: 1.08rem;
    font-weight: 900;
}

.checkout-actions .button--whatsapp {
    box-shadow: 0 16px 30px rgba(22, 163, 74, 0.26);
}

.checkout-actions .button--online-pay {
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.28);
}

.cart-premium-bottom-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    display: none;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 -14px 34px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(18px);
}

.cart-premium-bottom-bar__inner {
    max-width: 760px;
    margin: 0 auto;
    display: grid;
    gap: 8px;
}

.cart-premium-bottom-bar__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    color: #111827;
}

.cart-premium-bottom-bar__total span {
    font-weight: 900;
}

.cart-premium-bottom-bar__total small {
    font-size: 0.95rem;
    font-weight: 500;
    color: #334155;
}

.cart-premium-bottom-bar__amount {
    font-size: clamp(1.65rem, 7vw, 2.35rem);
    font-weight: 950;
    line-height: 1;
    white-space: nowrap;
}

.cart-premium-bottom-bar__button {
    width: 100%;
    min-height: 58px;
    border: 0;
    border-radius: 10px;
    background: var(--whatsapp, #16a34a);
    color: #fff;
    font: inherit;
    font-size: clamp(1rem, 4.5vw, 1.24rem);
    font-weight: 950;
    cursor: pointer;
    box-shadow: 0 14px 26px rgba(22, 163, 74, 0.28);
}

.cart-premium-bottom-bar__button.is-online-pay {
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.30);
}

.distance-delivery-card {
    background: #fff7cc;
    border-color: rgba(202, 138, 4, 0.22);
}

.distance-address-row {
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 0;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.checkout-form .distance-address-row input {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.distance-search-button {
    width: 92px;
    min-width: 92px;
    border: 0;
    border-left: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0;
    background: #fde68a;
    color: #92400e;
}

@media (max-width: 719px) {
    body:has(.cart-page) .app-shell {
        padding-bottom: calc(132px + env(safe-area-inset-bottom));
    }

    .cart-premium-bottom-bar {
        display: block;
    }

    .detail-topbar {
        gap: 14px;
    }

    .detail-topbar .back-link,
    .detail-topbar .cart-pill {
        min-height: 52px;
        border-radius: 999px;
        font-size: 1.05rem;
        font-weight: 800;
    }

    .cart-page {
        gap: 14px;
    }

    .cart-summary {
        display: none;
    }

    .checkout-card {
        padding: 18px;
    }

    .checkout-choice-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .checkout-payment-buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .checkout-choice,
    .checkout-payment-button {
        min-height: 68px;
        padding: 10px 8px;
    }

    .cart-item__actions {
        grid-template-columns: 1fr;
    }

    .cart-quantity-form {
        grid-template-columns: minmax(86px, 112px) minmax(0, 1fr);
    }

    .cart-item__actions form:last-child .button {
        width: 100%;
    }

    .checkout-actions {
        display: none;
    }
}

@media (max-width: 380px) {
    .checkout-choice-grid,
    .checkout-payment-buttons {
        grid-template-columns: 1fr;
    }

    .checkout-choice,
    .checkout-payment-button {
        min-height: 58px;
    }
}
