/**
 * Phase 15: Customer UX Polish
 * Public-facing UX improvements for mobile, accessibility, and visual consistency
 */

/* ===== Mobile Tap Targets ===== */
.tap-target {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ===== Empty States ===== */
.empty-cart,
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted, #B0B0B0);
}

.empty-cart i,
.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.6;
    color: var(--accent-green, #0E6B3B);
}

.empty-cart p:first-of-type,
.empty-state p:first-of-type {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary, #FFFFFF);
    margin-bottom: 0.5rem;
}

.empty-cart p:last-child,
.empty-state p:last-child {
    font-size: 0.9rem;
}

/* ===== Form Hint Text ===== */
.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-muted, #B0B0B0);
}

.section-hint {
    color: var(--text-muted, #B0B0B0);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    margin-top: -0.5rem;
}

/* ===== Slots Placeholder ===== */
.slots-placeholder {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted, #B0B0B0);
    background: var(--bg-surface-light, #1A1A1A);
    border-radius: 8px;
    border: 1px dashed var(--border-color, #333333);
    font-size: 0.95rem;
}

/* ===== Sold Out States ===== */
.sold-out-banner {
    background: linear-gradient(135deg, #C62828 0%, #8E0000 100%);
    color: white;
    text-align: center;
    padding: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.9rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.out-of-stock-badge {
    display: inline-block;
    background: var(--bg-surface-light, #1A1A1A);
    color: var(--text-muted, #B0B0B0);
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border: 1px solid var(--border-color, #333333);
}

/* ===== Button Loading State ===== */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.75s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}

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

/* ===== Responsive Improvements ===== */
@media (max-width: 768px) {
    /* Larger touch targets on mobile */
    .btn,
    .qty-btn,
    .add-to-cart,
    .btn-add-cart,
    .btn-add-special,
    .modal-close,
    .mobile-cart-toggle,
    .btn-remove-item {
        min-height: 44px;
        min-width: 44px;
    }

    /* Improved form spacing on mobile */
    .checkout-section .form-group {
        margin-bottom: 1.25rem;
    }

    /* Better mobile cart visibility */
    .mobile-checkout-bar {
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
    }

    /* Larger text for better readability */
    .item-name,
    .product-header h3,
    .bundle-header h3 {
        font-size: 1.1rem;
    }

    /* Improved mobile modal */
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ===== Selected Slot Display ===== */
.selected-slot-display {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(14, 107, 59, 0.1);
    border: 1px solid var(--accent-green, #0E6B3B);
    border-radius: 6px;
    color: var(--accent-green, #0E6B3B);
    font-weight: 500;
}

.selected-slot-display::before {
    content: '✓ ';
}

/* ===== No Availability State ===== */
.no-availability {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted, #B0B0B0);
    background: var(--bg-surface-light, #1A1A1A);
    border-radius: 8px;
    border: 1px dashed var(--border-color, #333333);
}

/* ===== Consistent Card Spacing ===== */
.menu-category-card,
.product-item,
.bundle-item {
    margin-bottom: 1.5rem;
}

/* ===== Better Focus States ===== */
input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: 2px solid var(--accent-green, #0E6B3B);
    outline-offset: 2px;
}

/* Ensure visible focus for links */
a:focus {
    outline: 2px solid var(--accent-green, #0E6B3B);
    outline-offset: 2px;
}

/* ===== Visually Hidden (Screen Reader Only) ===== */
.visually-hidden,
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== Skip Link ===== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-green, #0E6B3B);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* ===== Icon-only Button Accessibility ===== */
.btn-icon-only {
    position: relative;
}

/* ===== Reduced Motion Support ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== High Contrast Mode Support ===== */
@media (prefers-contrast: high) {
    .btn:focus,
    a:focus,
    input:focus,
    select:focus,
    textarea:focus,
    button:focus {
        outline: 3px solid currentColor;
        outline-offset: 2px;
    }
}

/* ===== Alert Improvements ===== */
.alert {
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.alert-danger {
    background: rgba(198, 40, 40, 0.1);
    border: 1px solid rgba(198, 40, 40, 0.3);
    color: #FFCDD2;
}

.alert-success {
    background: rgba(14, 107, 59, 0.1);
    border: 1px solid rgba(14, 107, 59, 0.3);
    color: #A5D6A7;
}

/* ===== Checkout Button States ===== */
.btn-checkout:disabled,
.btn-checkout-mobile:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Modal Header Consistency ===== */
.modal-header h2 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header h2 i {
    color: var(--accent-green, #0E6B3B);
}
