/* HeySalad Checkout - Clean & Smooth */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #ed4c4c;
    --primary-dark: #d43d3d;
    --bg: #f8f9fa;
    --card: #ffffff;
    --text: #1a1a2e;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --success: #10b981;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

.checkout-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.checkout-header {
    text-align: center;
    padding: 16px 0;
}

.checkout-header .logo {
    height: 32px;
}

.checkout-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    flex: 1;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.step.active {
    opacity: 1;
}

.step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.step.active .step-dot {
    background: var(--primary);
    color: white;
}

.step.completed .step-dot {
    background: var(--success);
    color: white;
}

.step-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-light);
}

.step.active .step-label {
    color: var(--text);
}

/* Order Summary */
.order-summary {
    background: #fafafa;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 24px;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.store-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.store-logo {
    font-size: 20px;
}

.store-name {
    font-weight: 600;
    font-size: 15px;
}

.summary-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 13px;
}

.chevron {
    font-size: 10px;
    transition: transform 0.2s;
}

.items-list {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

.item-info {
    display: flex;
    gap: 8px;
}

.item-name {
    color: var(--text);
}

.item-qty {
    color: var(--text-light);
}

.item-price {
    font-weight: 500;
}

.summary-totals {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-light);
}

.total-row.grand-total {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
}

.salad-points {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 8px;
    font-size: 13px;
    color: #166534;
}

.points-icon {
    font-size: 18px;
}

/* Forms */
.delivery-form, .payment-form {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-row {
    margin-bottom: 12px;
}

.form-row.two-col {
    display: grid;
    grid-template-columns: 1fr 140px;
    gap: 12px;
}

input[type="text"],
input[type="tel"],
input[type="email"] {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: white;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(237, 76, 76, 0.1);
}

input::placeholder {
    color: #9ca3af;
}

.continue-btn, .pay-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.continue-btn:hover:not(:disabled), 
.pay-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.continue-btn:disabled, 
.pay-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.back-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 14px;
    cursor: pointer;
    margin-top: 12px;
    transition: color 0.2s;
}

.back-btn:hover {
    color: var(--text);
}

/* Delivery Slots */
.delivery-slots {
    animation: fadeIn 0.3s ease;
}

.slots-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}

.day-header {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 8px;
    position: sticky;
    top: 0;
    background: white;
    padding: 4px 0;
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.slot-btn {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.slot-btn:hover:not(:disabled) {
    border-color: var(--primary);
}

.slot-btn.selected {
    border-color: var(--primary);
    background: rgba(237, 76, 76, 0.05);
}

.slot-btn.unavailable {
    opacity: 0.4;
    cursor: not-allowed;
}

.slot-time {
    font-size: 13px;
    font-weight: 500;
}

.slot-price {
    font-size: 12px;
    color: var(--text-light);
}

.slot-btn.selected .slot-price {
    color: var(--primary);
}

/* Payment */
.card-element {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 16px;
    background: white;
}

.delivery-summary {
    background: #fafafa;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 14px;
}

.secure-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-light);
}

/* Success Screen */
.success-screen {
    text-align: center;
    padding: 20px 0;
    animation: fadeIn 0.4s ease;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 20px;
    animation: scaleIn 0.4s ease;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.success-screen h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.success-screen > p {
    color: var(--text-light);
    margin-bottom: 24px;
}

.confirmation-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.detail-card {
    background: #fafafa;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-label {
    font-size: 13px;
    color: var(--text-light);
}

.detail-value {
    font-weight: 600;
    font-size: 14px;
}

.points-earned {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 15px;
    color: #166534;
    margin-bottom: 20px;
}

.confirmation-note {
    font-size: 13px;
    color: var(--text-light);
}

/* Loading & Error States */
.loading-state, .error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner.large {
    width: 40px;
    height: 40px;
    border-color: rgba(237, 76, 76, 0.2);
    border-top-color: var(--primary);
    margin-bottom: 16px;
}

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

.error-icon {
    width: 48px;
    height: 48px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 16px;
}

.error-message {
    background: #fee2e2;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 16px;
    text-align: center;
}

/* Footer */
.checkout-footer {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: var(--text-light);
}

/* Scrollbar */
.slots-container::-webkit-scrollbar {
    width: 4px;
}

.slots-container::-webkit-scrollbar-track {
    background: transparent;
}

.slots-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* Store Selection View */
/* Requirements: 4.1, 4.3, 4.4, 5.1, 6.1, 6.3 */
.store-selection-view {
    animation: fadeIn 0.3s ease;
}

.store-selection-view h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.store-selection-subtitle {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 20px;
}

.store-options-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

/* Store Option Card */
.store-option-card {
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    position: relative;
    transition: all 0.2s ease;
}

.store-option-card:hover {
    border-color: #ccc;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.store-option-card.cheapest {
    border-color: var(--success);
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

.store-option-card.has-missing {
    opacity: 0.85;
}

.cheapest-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    background: var(--success);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.store-option-header {
    margin-bottom: 12px;
}

.store-option-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.store-option-logo {
    font-size: 28px;
}

.store-option-name {
    font-size: 18px;
    font-weight: 700;
}

/* Store Option Pricing */
.store-option-pricing {
    margin-bottom: 12px;
}

.store-option-pricing .price-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-light);
}

.store-option-pricing .price-row.total {
    border-top: 1px solid var(--border);
    margin-top: 8px;
    padding-top: 12px;
    font-weight: 600;
    color: var(--text);
}

.store-option-pricing .total-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

/* Missing Items Indicator */
/* Requirement 4.3 */
.missing-items-indicator {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #92400e;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.missing-icon {
    font-size: 14px;
}

.missing-items-list {
    width: 100%;
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.missing-item {
    background: rgba(245, 158, 11, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* Store Option Actions */
.store-option-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.heysalad-btn {
    width: 100%;
    padding: 14px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.heysalad-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.heysalad-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.heysalad-btn .btn-icon {
    font-size: 18px;
}

.heysalad-btn .service-fee-note {
    position: absolute;
    right: 12px;
    font-size: 11px;
    font-weight: 400;
    opacity: 0.9;
}

.store-direct-btn {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.store-direct-btn:hover {
    background: #f9fafb;
    border-color: #ccc;
}

.store-direct-btn .redirect-note {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 400;
}

/* Checkout Options Info */
.checkout-options-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 10px;
}

.option-info {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.option-info .info-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.option-info strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.option-info p {
    font-size: 12px;
    color: var(--text-light);
    margin: 0;
    line-height: 1.4;
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .checkout-container {
        padding: 12px;
    }
    
    .checkout-card {
        padding: 20px 16px;
        border-radius: 16px;
    }
    
    .step-indicator {
        gap: 20px;
    }
    
    .time-slots {
        grid-template-columns: 1fr;
    }
    
    .store-option-card {
        padding: 14px;
    }
    
    .heysalad-btn .service-fee-note {
        position: static;
        display: block;
        width: 100%;
        margin-top: 4px;
    }
    
    .heysalad-btn {
        flex-wrap: wrap;
    }
}
