/* assets/css/cart.css */
/* UniDash Checkout Page Styles */
/* Uses colors from base.css:
   --ud-primary: #B81B84 (Magenta)
   --ud-primary-dark: #4A0032
   --ud-primary-soft: #FFC5E8
   --ud-surface-soft: #fff3fd
*/

/* ===== CHECKOUT PAGE LAYOUT ===== */
.checkout-page {
    min-height: calc(100vh - 60px); 
    padding: 0;
}

.checkout-breadcrumb {
    padding: 12px 24px;
    font-size: 13px;
    color: var(--ud-text-muted, #6b7280);
    border-bottom: 1px solid var(--ud-border-subtle, #e5e7eb);
    background: var(--ud-surface, #fff);
}

.checkout-breadcrumb a {
    color: var(--ud-text-muted, #6b7280);
    text-decoration: none;
}

.checkout-breadcrumb a:hover {
    color: var(--ud-primary, #B81B84);
}

.checkout-breadcrumb span {
    color: var(--ud-text-strong, #111827);
    font-weight: 500;
}

.checkout-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
    align-items: start;
}

/* ===== LEFT COLUMN - STEPS ===== */
.checkout-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.checkout-step {
    background: var(--ud-surface, #fff);
    border-radius: 12px;
    box-shadow: var(--ud-shadow-soft, 0 6px 18px rgba(0, 0, 0, 0.06));
    overflow: hidden;
}

.checkout-step-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    cursor: pointer;
    transition: background 0.2s;
}

.checkout-step-header:hover {
    background: var(--ud-surface-soft, #fff3fd);
}

.checkout-step-icon {
    width: 40px;
    height: 40px;
    background: var(--ud-border-subtle, #e5e7eb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.checkout-step-icon svg {
    width: 20px;
    height: 20px;
    color: var(--ud-text-muted, #6b7280);
}

.checkout-step.active .checkout-step-icon {
    background: var(--ud-primary, #B81B84);
}

.checkout-step.active .checkout-step-icon svg {
    color: #fff;
}

.checkout-step.completed .checkout-step-icon {
    background: var(--ud-accent-green, #1B68AE);
}

.checkout-step.completed .checkout-step-icon svg {
    color: #fff;
}

.checkout-step-info {
    flex: 1;
}

.checkout-step-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--ud-text-strong, #111827);
    margin: 0;
}

.checkout-step-subtitle {
    font-size: 13px;
    color: var(--ud-text-muted, #6b7280);
    margin: 4px 0 0;
}

.checkout-step-content {
    padding: 0 24px 24px;
    display: none;
}

.checkout-step.active .checkout-step-content {
    display: block;
}

/* ===== LOGIN STEP (NON-COLLAPSIBLE WHEN NOT LOGGED IN) ===== */
.checkout-step.login-required .checkout-step-content {
    display: block;
}

.checkout-step.login-required .checkout-step-header {
    cursor: default;
}

.checkout-step.login-required .checkout-step-header:hover {
    background: transparent;
}

/* Logged in user info display */
.logged-in-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--ud-surface-soft, #fff3fd);
    border-radius: 10px;
    border: 1px solid var(--ud-primary-soft, #FFC5E8);
}

.logged-in-avatar {
    width: 48px;
    height: 48px;
    background: var(--ud-primary, #B81B84);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.logged-in-details {
    flex: 1;
}

.logged-in-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--ud-text-strong, #111827);
    margin: 0 0 4px;
}

.logged-in-phone {
    font-size: 13px;
    color: var(--ud-text-muted, #6b7280);
    margin: 0;
}

.logged-in-change {
    background: none;
    border: none;
    color: var(--ud-primary, #B81B84);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
}

.logged-in-change:hover {
    text-decoration: underline;
}

/* Login form inside step */
.login-form-inline {
    padding-top: 8px;
}

.login-welcome-text {
    margin-bottom: 20px;
}

.login-welcome-text h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--ud-text-strong, #111827);
    margin: 0 0 6px;
}

.login-welcome-text p {
    font-size: 14px;
    color: var(--ud-text-muted, #6b7280);
    margin: 0;
}

.login-phone-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-bottom: 16px;
}

.login-country-code {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--ud-surface-soft, #fff3fd);
    border: 2px solid var(--ud-border-input, #e0e0e0);
    border-right: none;
    border-radius: 10px 0 0 10px;
}

.login-country-flag {
    width: 24px;
    height: 16px;
    border-radius: 2px;
    overflow: hidden;
}

.login-country-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-country-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--ud-text-strong, #111827);
}

.login-phone-input {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid var(--ud-border-input, #e0e0e0);
    border-left: none;
    border-radius: 0 10px 10px 0;
    font-size: 15px;
    outline: none;
    min-width: 0;
    transition: border-color 0.2s;
}

.login-phone-input:focus {
    border-color: var(--ud-primary, #B81B84);
}

.login-phone-row:focus-within .login-country-code {
    border-color: var(--ud-primary, #B81B84);
}

.login-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--ud-primary, #B81B84);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.login-btn:hover:not(:disabled) {
    background: var(--ud-primary-dark, #4A0032);
}

.login-btn:disabled {
    background: var(--ud-border-subtle, #e5e7eb);
    color: var(--ud-text-muted, #6b7280);
    cursor: not-allowed;
}

.login-btn-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--ud-accent-danger, #EF4444);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
}

.login-error.active {
    display: block;
}

/* OTP Section */
.otp-section {
    display: none;
}

.otp-section.active {
    display: block;
}

.otp-back-btn {
    background: none;
    border: none;
    color: var(--ud-text-muted, #6b7280);
    font-size: 13px;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.otp-back-btn:hover {
    color: var(--ud-primary, #B81B84);
}

.otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 16px;
}

.otp-input {
    width: 48px;
    height: 56px;
    border: 2px solid var(--ud-border-input, #e0e0e0);
    border-radius: 10px;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

.otp-input:focus {
    border-color: var(--ud-primary, #B81B84);
}

.otp-resend-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ud-text-muted, #6b7280);
    margin-bottom: 20px;
}

.otp-resend-btn {
    background: none;
    border: none;
    color: var(--ud-primary, #B81B84);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.otp-resend-btn:disabled {
    color: var(--ud-text-muted, #6b7280);
    cursor: not-allowed;
}

/* ===== ADDRESS STEP ===== */
.address-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.address-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 2px solid var(--ud-border-subtle, #e5e7eb);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.address-card:hover {
    border-color: var(--ud-primary-soft, #FFC5E8);
    background: var(--ud-surface-soft, #fff3fd);
}

.address-card.selected {
    border-color: var(--ud-primary, #B81B84);
    background: var(--ud-surface-soft, #fff3fd);
}

.address-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--ud-border-input, #e0e0e0);
    border-radius: 50%;
    margin-top: 2px;
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.2s;
}

.address-card.selected .address-radio {
    border-color: var(--ud-primary, #B81B84);
}

.address-card.selected .address-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--ud-primary, #B81B84);
    border-radius: 50%;
}

.address-info {
    flex: 1;
}

.address-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--ud-text-strong, #111827);
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.address-tag {
    font-size: 10px;
    padding: 2px 8px;
    background: var(--ud-primary-soft, #FFC5E8);
    color: var(--ud-primary-dark, #4A0032);
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.address-text {
    font-size: 13px;
    color: var(--ud-text-muted, #6b7280);
    margin: 0;
    line-height: 1.5;
}

.no-address-msg {
    text-align: center;
    padding: 32px;
    color: var(--ud-text-muted, #6b7280);
}

.no-address-msg p {
    margin: 0 0 8px;
}

/* ===== PAYMENT STEP ===== */
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px solid var(--ud-border-subtle, #e5e7eb);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.payment-option:hover {
    border-color: var(--ud-primary-soft, #FFC5E8);
    background: var(--ud-surface-soft, #fff3fd);
}

.payment-option.selected {
    border-color: var(--ud-primary, #B81B84);
    background: var(--ud-surface-soft, #fff3fd);
}

.payment-option.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #f5f5f5;
}

.payment-option.disabled:hover {
    border-color: var(--ud-border-subtle, #e5e7eb);
    background: #f5f5f5;
}

.payment-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--ud-border-input, #e0e0e0);
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.2s;
}

.payment-option.selected .payment-radio {
    border-color: var(--ud-primary, #B81B84);
}

.payment-option.selected .payment-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--ud-primary, #B81B84);
    border-radius: 50%;
}

.payment-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.payment-label {
    font-weight: 500;
    font-size: 14px;
    color: var(--ud-text-strong, #111827);
}

/* ===== RIGHT COLUMN - CART SUMMARY ===== */
.checkout-right {
    position: sticky;
    top: 24px;
}

.cart-summary {
    background: var(--ud-surface, #fff);
    border-radius: 18px;
    box-shadow: var(--ud-shadow-soft, 0 6px 18px rgba(0, 0, 0, 0.06));
    overflow: hidden;
}

.cart-summary-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--ud-border-subtle, #e5e7eb);
}

.cart-summary-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--ud-text-strong, #111827);
    margin: 0;
}

.cart-summary-items {
    padding: 16px 24px;
    max-height: 400px;
    overflow-y: auto;
}

.cart-business {
    margin-bottom: 16px;
}

.cart-business:last-child {
    margin-bottom: 0;
}

.cart-business-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--ud-text-strong, #111827);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--ud-border-subtle, #e5e7eb);
}

.cart-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--ud-border-subtle, #e5e7eb);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--ud-text-strong, #111827);
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cart-item-addons {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ud-text-muted, #6b7280);
    margin: 2px 0 0;
    font-weight: 400;
}

.cart-item-badge {
    font-size: 9px;
    padding: 2px 6px;
    background: var(--ud-primary-soft, #FFC5E8);
    color: var(--ud-primary-dark, #4A0032);
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

.cart-item-badge.bogo {
    background: var(--ud-amber-soft, #FFB88C);
    color: var(--ud-warning-deep, #9A3412);
}

.cart-item-customization {
    font-size: 12px;
    color: var(--ud-primary, #B81B84);
    margin: 0 0 4px;
    cursor: pointer;
}

.cart-item-addon-text {
    font-size: 11px;
    color: var(--ud-text-muted, #6b7280);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.cart-addon-edit-btn {
    background: none;
    border: none;
    color: var(--ud-primary, #B81B84);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
}

.cart-addon-edit-btn:hover {
    text-decoration: underline;
}

.cart-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.cart-item-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--ud-text-strong, #111827);
}

.cart-item-price-original {
    font-size: 12px;
    color: #EF4444;
    text-decoration: line-through;
    text-decoration-color: #EF4444;
    text-decoration-thickness: 2px;
    margin-right: 4px;
}

/* Offer price: regular price shown struck-through in red */
.cart-item-price-offer-original {
    font-size: 12px;
    color: #EF4444;
    text-decoration: line-through;
    text-decoration-color: #EF4444;
    text-decoration-thickness: 2px;
    margin-right: 4px;
}

/* Order Total: regular total shown struck-through in red when an offer applies */
.cart-total-original {
    color: #EF4444;
    text-decoration: line-through;
    text-decoration-color: #EF4444;
    text-decoration-thickness: 2px;
    margin-right: 6px;
}

.cart-item-price-free {
    color: var(--ud-accent-green, #1B68AE);
    font-weight: 700;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    border: 1px solid var(--ud-primary, #B81B84);
    border-radius: 6px;
    overflow: hidden;
}

.cart-qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--ud-surface, #fff);
    color: var(--ud-primary, #B81B84);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.cart-qty-btn:hover {
    background: var(--ud-surface-soft, #fff3fd);
}

.cart-qty-value {
    width: 28px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--ud-primary, #B81B84);
}

/* Cart Summary Footer */
.cart-summary-footer {
    padding: 16px 24px; 
    border-top: 1px solid var(--ud-border-subtle, #e5e7eb);
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    gap: 16px;
}

.cart-total-label {
    font-size: 13px;
    color: #4B5563;
    font-weight: 500;
}

.cart-total-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--ud-text-strong, #111827);
    white-space: nowrap;
}

.cart-total-row.discount .cart-total-value {
    color: var(--ud-accent-green, #1B68AE);
}

.cart-total-row.grand-total {
    padding-top: 12px;
    margin-top: 10px;
    border-top: 1px solid var(--ud-border-subtle, #e5e7eb);
}

.cart-total-row.grand-total .cart-total-label {
    font-size: 15px;
    font-weight: 800;
    color: #111827;
}

.cart-total-row.grand-total .cart-total-value {
    font-size: 20px;
    font-weight: 900;
    color: #000;
}

.cart-savings-note {
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #DCFCE7;
    color: #14532D;
    font-size: 12px;
    font-weight: 600;
}

.cart-savings-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #15803D;
    flex: 0 0 16px;
}

/* Special Requests */
/* ===== Dining Mode ===== */
.dining-mode-section {
    padding: 16px 24px;
    border-top: 1px solid var(--ud-border-subtle, #e5e7eb);
}

.dining-mode-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ud-text-strong, #111827);
    display: block;
    margin-bottom: 10px;
}

.dining-mode-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.checkout-policy-consent { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; font-size: 13px; line-height: 1.6; }
.checkout-policy-consent input { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 3px; accent-color: var(--ud-primary); }
.checkout-policy-consent a { color: var(--ud-primary); text-decoration: underline; }
#deliveryFeeRow[hidden] { display: none; }

.dining-mode-option {
    flex: 1 1 105px;
    background: transparent;
    font: inherit;
    display: flex;
    flex-direction: column;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 4px 8px;
    border: 2px solid var(--ud-border-subtle, #e5e7eb);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.dining-mode-option:hover {
    border-color: var(--ud-primary-soft, #FFC5E8);
    background: var(--ud-surface-soft, #fff3fd);
}

.dining-mode-option.selected {
    border-color: var(--ud-primary, #B81B84);
    background: var(--ud-surface-soft, #fff3fd);
}

.dining-mode-radio {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    border: 2px solid var(--ud-border-input, #e0e0e0);
    border-radius: 50%;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.dining-mode-option.selected .dining-mode-radio {
    border-color: var(--ud-primary, #B81B84);
}

.dining-mode-option.selected .dining-mode-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: var(--ud-primary, #B81B84);
    border-radius: 50%;
}

.dining-mode-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.dining-mode-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ud-text-strong, #111827);
}

.dining-mode-option.selected .dining-mode-label {
    color: var(--ud-primary, #B81B84);
}

.dining-mode-icon .ud-ui-icon { width: 18px; height: 18px; }
.address-change-status { font-size: 13px; line-height: 1.6; margin-top: 12px; color: var(--ud-text-muted); }
.address-change-status.is-error { color: #b42318; }
.address-change-status:empty { display: none; }
.address-card[aria-disabled="true"] { opacity: .6; cursor: wait; }
.address-card:focus-visible { outline: 2px solid var(--ud-primary); outline-offset: 2px; }

.dining-mode-hint {
    margin: 10px 0 0;
    font-size: 11px;
    color: var(--ud-text-muted, #6b7280);
}

.special-requests {
    padding: 16px 24px;
    border-top: 1px solid var(--ud-border-subtle, #e5e7eb);
}

.special-requests label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ud-text-strong, #111827);
    display: block;
    margin-bottom: 8px;
}

.special-requests textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ud-border-input, #e0e0e0);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
}

.special-requests textarea:focus {
    border-color: var(--ud-primary, #B81B84);
}


/* Coupons */
.coupon-section {
    padding: 16px 24px;
    border-top: 1px solid var(--ud-border-subtle, #e5e7eb);
}

.coupon-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.coupon-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ud-text-strong, #111827);
}

.coupon-icon {
    width: 18px;
    height: 18px;
    color: var(--ud-primary, #B81B84);
    flex-shrink: 0;
}

.coupon-seeall {
    background: none;
    border: none;
    padding: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--ud-primary, #B81B84);
    cursor: pointer;
    display: none; /* Hidden by default, shown by JS when coupons exist */
}

.coupon-seeall:hover {
    text-decoration: underline;
}

/* Coupon Input Row */
.coupon-apply-btn {
    padding: 10px 18px;
    background: var(--ud-primary, #B81B84);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.coupon-apply-btn:hover:not(:disabled) {
    background: var(--ud-primary-dark, #4A0032);
}

.coupon-apply-btn:disabled {
    background: var(--ud-border-subtle, #e5e7eb);
    color: var(--ud-text-muted, #6b7280);
    cursor: not-allowed;
}

.coupon-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    font-size: 11px;
    color: var(--ud-text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coupon-divider::before,
.coupon-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ud-border-subtle, #e5e7eb);
}

.coupon-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.coupon-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 10px;
    border: 2px solid var(--ud-border-subtle, #e5e7eb);
    background: var(--ud-surface, #fff);
    cursor: pointer;
    transition: all 0.2s;
}

.coupon-card:hover:not(.disabled) {
    border-color: var(--ud-primary-soft, #FFC5E8);
    background: var(--ud-surface-soft, #fff3fd);
}

.coupon-card.selected {
    border-color: var(--ud-primary, #B81B84);
    background: var(--ud-surface-soft, #fff3fd);
}

.coupon-card.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.coupon-card.disabled:hover {
    border-color: var(--ud-border-subtle, #e5e7eb);
    background: var(--ud-surface, #fff);
}

.coupon-radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--ud-border-input, #e0e0e0);
    flex-shrink: 0;
    margin-top: 2px;
    position: relative;
    transition: border-color 0.2s;
}

.coupon-card.selected .coupon-radio {
    border-color: var(--ud-primary, #B81B84);
}

.coupon-card.selected .coupon-radio::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ud-primary, #B81B84);
}

.coupon-info {
    flex: 1;
    min-width: 0;
}

.coupon-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ud-text-strong, #111827);
    margin: 0 0 6px;
}

.coupon-code-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--ud-primary-soft, #FFC5E8);
    color: var(--ud-primary-dark, #4A0032);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.6px;
}

.coupon-text {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--ud-text-muted, #6b7280);
    line-height: 1.4;
}

.coupon-hint {
    margin: 6px 0 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--ud-warning-deep, #9A3412);
}

.coupon-applied-note {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--ud-border-subtle, #e5e7eb);
}

.coupon-success {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    font-size: 13px;
    color: #065f46;
}

.coupon-success svg {
    width: 18px;
    height: 18px;
    color: #10b981;
    flex-shrink: 0;
}

.coupon-success span {
    flex: 1;
}

.coupon-remove-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    color: var(--ud-primary, #B81B84);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.coupon-remove-btn:hover {
    background: rgba(184, 27, 132, 0.1);
}


/* ===== Apply Card (Loyalty) =====
   Mirrors the Flutter app's _applyCardSection (cart_ui_sections.dart):
   same colors, sizes, weights and applied/normal states. AppColors.brand
   maps to var(--ud-primary), like the rest of this page. */
.applycard-section {
    padding: 16px 24px;
    border-top: 1px solid var(--ud-border-subtle, #e5e7eb);
}

.applycard-header {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
}

.applycard-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #F3F2FF;
    color: var(--ud-primary, #B81B84);
    flex-shrink: 0;
}

.applycard-icon-wrap svg {
    width: 16px;
    height: 16px;
}

.applycard-section.applied .applycard-icon-wrap {
    background: #E7F7EB;
    color: #15803D;
}

.applycard-title {
    margin-left: 10px;
    font-size: 16px;
    font-weight: 800;
    color: var(--ud-text-strong, #111827);
}

.applycard-badge {
    margin-left: 8px;
    padding: 3px 8px;
    background: #DCFCE7;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #15803D;
}

.applycard-input-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.applycard-input-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.applycard-input-prefix {
    position: absolute;
    left: 12px;
    width: 20px;
    height: 20px;
    color: #9E9E9E; /* Colors.grey.shade500 */
    pointer-events: none;
}

.applycard-section.applied .applycard-input-prefix {
    color: #15803D;
}

.applycard-input-suffix {
    position: absolute;
    right: 12px;
    width: 22px;
    height: 22px;
    color: #15803D;
    pointer-events: none;
}

.applycard-input {
    width: 100%;
    height: 50px;
    padding: 14px 42px 14px 40px;
    background: #F6F7FB;
    border: 1.5px solid #EEEEEE; /* Colors.grey.shade200 */
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--ud-text-strong, #111827);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.applycard-input::placeholder {
    color: #BDBDBD; /* Colors.grey.shade400 */
    font-weight: 400;
}

.applycard-input:focus {
    border-color: var(--ud-primary, #B81B84);
}

.applycard-section.applied .applycard-input {
    background: #F0FDF4;
    border-color: #86EFAC;
}

.applycard-input:disabled {
    cursor: default;
}

.applycard-btn {
    height: 50px;
    padding: 0 18px;
    background: var(--ud-primary, #B81B84);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.applycard-btn:hover:not(:disabled) {
    background: var(--ud-primary-dark, #4A0032);
}

.applycard-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.applycard-section.applied .applycard-btn {
    background: transparent;
    border: 1.5px solid #F44336; /* Colors.red */
    color: #F44336;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 700;
}

.applycard-section.applied .applycard-btn:hover:not(:disabled) {
    background: rgba(244, 67, 54, 0.06);
}

.applycard-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: applycard-spin 0.8s linear infinite;
}

@keyframes applycard-spin {
    to { transform: rotate(360deg); }
}

.applycard-hint {
    margin: 10px 0 0;
    font-size: 12px;
    color: #9E9E9E; /* Colors.grey.shade500 */
}

.applycard-savings {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #15803D;
}

.applycard-savings svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* Floating error snackbar — the app's _showCardError SnackBar
   (red.shade700, rounded 10, floating with 12px margin). */
.applycard-snackbar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 3000;
    padding: 14px 16px;
    background: #D32F2F; /* Colors.red.shade700 */
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}

.applycard-snackbar.show {
    opacity: 1;
    transform: translateY(0);
}


/* Place Order Button */
.place-order-section {
    padding: 16px 24px;
    border-top: 1px solid var(--ud-border-subtle, #e5e7eb);
}

.place-order-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--ud-primary, #B81B84);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.place-order-btn:hover:not(:disabled) {
    background: var(--ud-primary-dark, #4A0032);
}

.place-order-btn:disabled {
    background: var(--ud-border-subtle, #e5e7eb);
    color: var(--ud-text-muted, #6b7280);
    cursor: not-allowed;
}

/* ===== LOADING & EMPTY STATES ===== */
.checkout-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.checkout-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--ud-border-subtle, #e5e7eb);
    border-top-color: var(--ud-primary, #B81B84);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

.checkout-empty {
    text-align: center;
    padding: 60px 24px;
    background: var(--ud-surface, #fff);
    border-radius: 12px;
    margin: 24px;
}

.checkout-empty h2 {
    font-size: 20px;
    color: var(--ud-text-strong, #111827);
    margin: 0 0 8px;
}

.checkout-empty p {
    font-size: 14px;
    color: var(--ud-text-muted, #6b7280);
    margin: 0 0 24px;
}

.checkout-empty a {
    display: inline-block;
    padding: 12px 24px;
    background: var(--ud-primary, #B81B84);
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: background 0.2s;
}

.checkout-empty a:hover {
    background: var(--ud-primary-dark, #4A0032);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .checkout-container {
        grid-template-columns: 1fr;
        padding: 16px;
    }
    
    .checkout-right {
        position: static;
        order: -1;
    }
    
    .cart-summary-items {
        max-height: 250px;
    }
}

@media (max-width: 480px) {
    .checkout-step-header {
        padding: 16px;
    }

    .checkout-step-content {
        padding: 0 16px 16px;
    }

    .otp-input {
        width: 42px;
        height: 50px;
        font-size: 18px;
    }

    .cart-summary-header,
    .cart-summary-items,
    .cart-summary-footer,
    .special-requests,
    .place-order-section {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ===== RESPONSIVE: VERY SMALL MOBILE (400px) ===== */
@media (max-width: 400px) {
    .checkout-breadcrumb {
        padding: 10px 12px;
        font-size: 12px;
    }

    .checkout-container {
        padding: 12px;
    }

    .checkout-step-header {
        padding: 14px 12px;
        gap: 12px;
    }

    .checkout-step-icon {
        width: 36px;
        height: 36px;
    }

    .checkout-step-icon svg {
        width: 18px;
        height: 18px;
    }

    .checkout-step-title {
        font-size: 15px;
    }

    .checkout-step-subtitle {
        font-size: 12px;
    }

    .checkout-step-content {
        padding: 0 12px 12px;
    }

    .login-welcome-text h3 {
        font-size: 16px;
    }

    .login-welcome-text p {
        font-size: 13px;
    }

    .login-country-code {
        padding: 10px 10px;
    }

    .login-phone-input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .login-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .otp-inputs {
        gap: 8px;
    }

    .otp-input {
        width: 38px;
        height: 46px;
        font-size: 16px;
    }

    .address-card {
        padding: 12px;
        gap: 10px;
    }

    .address-radio {
        width: 18px;
        height: 18px;
    }

    .address-label {
        font-size: 13px;
    }

    .address-text {
        font-size: 12px;
    }

    .payment-option {
        padding: 12px;
        gap: 10px;
    }

    .payment-radio {
        width: 18px;
        height: 18px;
    }

    .payment-label {
        font-size: 13px;
    }

    .cart-summary-header {
        padding: 16px 12px;
    }

    .cart-summary-header h2 {
        font-size: 16px;
    }

    .cart-summary-items {
        padding: 12px;
        max-height: 200px;
    }

    .cart-business-name {
        font-size: 13px;
    }

    .cart-item {
        padding: 10px 0;
        gap: 10px;
    }

    .cart-item-name {
        font-size: 13px;
    }

    .cart-item-price {
        font-size: 13px;
    }

    .cart-qty-btn {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }

    .cart-qty-value {
        width: 24px;
        font-size: 12px;
    }

    .cart-summary-footer {
        padding: 12px;
    }

    .cart-total-label,
    .cart-total-value {
        font-size: 12px;
    }

    .cart-total-row.grand-total .cart-total-label {
        font-size: 14px;
    }

    .cart-total-row.grand-total .cart-total-value {
        font-size: 15px;
    }

    .special-requests {
        padding: 12px;
    }

    .special-requests label {
        font-size: 12px;
    }

    .special-requests textarea {
        font-size: 12px;
        padding: 8px 10px;
    }

    .coupon-section {
        padding: 12px;
    }

    .coupon-input {
        padding: 8px 12px;
        font-size: 12px;
    }

    .coupon-apply-btn {
        padding: 8px 14px;
        font-size: 12px;
    }

    .applycard-section {
        padding: 12px;
    }

    .coupon-card {
        padding: 10px;
    }

    .coupon-save {
        font-size: 12px;
    }

    .coupon-code {
        font-size: 10px;
        padding: 2px 8px;
    }

    .place-order-section {
        padding: 12px;
    }

    .place-order-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .checkout-empty {
        padding: 40px 16px;
        margin: 16px;
    }

    .checkout-empty h2 {
        font-size: 18px;
    }

    .checkout-empty p {
        font-size: 13px;
    }

    .checkout-empty a {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .checkout-container {
        grid-template-columns: 1fr 350px;
        gap: 16px;
    }

    .checkout-right {
        position: static;
    }

    .cart-summary-items {
        max-height: 180px;
    }
}
.table-talker-field { margin-top: 16px; padding-top: 16px; border-top: 1px solid #e5e7eb; }
.table-talker-field[hidden] { display: none; }
.table-talker-field label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.table-talker-field input { box-sizing: border-box; width: 100%; padding: 12px 14px; border: 1px solid #d1d5db; border-radius: 8px; font: inherit; background: #fff; }
.table-talker-field input:focus { outline: 2px solid var(--ud-primary); outline-offset: 2px; }
.table-talker-field input[aria-invalid="true"] { border-color: #b42318; }
.table-talker-field p { margin: 8px 0 0; font-size: 12px; color: #6b7280; line-height: 1.5; }
.table-talker-field .table-talker-error { color: #b42318; }
.table-talker-guide { display: flex; align-items: center; gap: 18px; margin: 0 0 20px; padding: 14px; border: 1px solid #e5e7eb; border-radius: 12px; background: #faf9ff; animation: ttGuideIn 0.4s ease-out; }
.table-talker-guide img { display: block; width: 150px; height: auto; flex-shrink: 0; border-radius: 8px; }
.table-talker-guide figcaption { min-width: 0; }
.table-talker-guide strong { font-size: 14px; }
.table-talker-image-wrap { position: relative; display: inline-block; flex-shrink: 0; }
.table-talker-highlight {
    position: absolute;
    top: 29%;
    left: 50%;
    width: 44%;
    height: 20%;
    transform: translate(-50%, -50%);
    border: 3px solid #ffce00;
    border-radius: 10px;
    box-shadow: 0 0 0 0 rgba(255, 206, 0, 0.6);
    animation: ttPulse 1.6s ease-in-out infinite;
    pointer-events: none;
}
@keyframes ttGuideIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes ttPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 206, 0, 0.55); transform: translate(-50%, -50%) scale(1); }
    50% { box-shadow: 0 0 0 6px rgba(255, 206, 0, 0); transform: translate(-50%, -50%) scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
    .table-talker-guide { animation: none; }
    .table-talker-highlight { animation: none; box-shadow: 0 0 0 3px rgba(255, 206, 0, 0.55); }
}
@media (max-width: 480px) {
    .table-talker-guide { flex-direction: column; align-items: flex-start; }
    .table-talker-guide img { width: 180px; max-width: 100%; align-self: center; }
}

/* Coupon selection follows the app: choose an offer, then apply it. */
.coupon-selection-apply {
    width: 100%;
    margin-top: 14px;
}
.coupon-selection-apply[hidden] { display: none; }
.coupon-list-help {
    margin: 0;
    font-size: 13px;
    color: var(--ud-text-muted, #6b7280);
}
.coupon-card:focus-visible {
    outline: 3px solid var(--ud-primary, #B81B84);
    outline-offset: 3px;
}
.coupon-code-badge { overflow-wrap: anywhere; }
