/* ===== ORDER MENU PAGE STYLES ===== */

/* ===== LOADING STATES & SPINNERS ===== */

/* Submit Button Loading State */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: button-spinner 0.8s linear infinite;
}

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

/* Slots Loading State */
.slots-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted, #888);
    font-style: italic;
}

/* Processing Overlay */
.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.processing-content {
    background: var(--bg-surface, #1A1A1A);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    max-width: 320px;
    border: 1px solid var(--border-color, #333);
}

.processing-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(14, 107, 59, 0.3);
    border-top-color: #0E6B3B;
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
    margin: 0 auto 1rem;
}

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

.processing-message {
    color: var(--text-primary, #fff);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.processing-submessage {
    color: var(--text-muted, #888);
    font-size: 0.9rem;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 2rem;
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Apple Pay Button Container */
#apple-pay-button-container {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#apple-pay-button-container > * {
    width: 100% !important;
    max-width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
}

/* Remove outer container styling for order page */
main.page-shell {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Specials Card Styling */
.specials-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.special-card {
    background: linear-gradient(135deg, rgba(198, 40, 40, 0.2), rgba(198, 40, 40, 0.05));
    border: 1px solid rgba(198, 40, 40, 0.3);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.2s ease;
}

.special-card:hover {
    background: linear-gradient(135deg, rgba(198, 40, 40, 0.3), rgba(198, 40, 40, 0.1));
    border-color: rgba(198, 40, 40, 0.5);
}

.special-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.special-badge {
    background: #C62828;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.special-title {
    color: #FFFFFF;
    font-size: 14px;
}

.special-desc {
    color: #B0B0B0;
    font-size: 13px;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.special-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.special-prices {
    display: flex;
    align-items: center;
    gap: 8px;
}

.special-price {
    color: #0E6B3B;
    font-weight: 600;
    font-size: 16px;
}

.special-original-price {
    color: #B0B0B0;
    text-decoration: line-through;
    font-size: 13px;
}

.btn-add-special {
    padding: 6px 12px;
    font-size: 13px;
}

/* Form Group Styling (matching flash sales) */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    color: #B0B0B0;
    font-size: 13px;
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #FFFFFF;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0E6B3B;
    box-shadow: 0 0 0 3px rgba(14, 107, 59, 0.1);
}

/* Payment method dropdown green styling */
#payment_method {
    background: rgba(14, 107, 59, 0.15) !important;
    border-color: #0E6B3B !important;
    color: #FFFFFF;
    cursor: pointer;
}

#payment_method:focus {
    background: rgba(14, 107, 59, 0.25) !important;
    box-shadow: 0 0 0 3px rgba(14, 107, 59, 0.25);
}

#payment_method option {
    background: #0E2B1A;
    color: #FFFFFF;
}

/* Pickup Slots Grid */
.pickup-slots-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.slots-loading {
    grid-column: 1 / -1;
    text-align: center;
    color: #B0B0B0;
    padding: 20px;
}

.slot-item {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    position: relative;
}

.slot-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.slot-item.selected {
    background: rgba(14, 107, 59, 0.3);
    border-color: #0E6B3B;
}

.slot-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
}

.slot-time {
    font-weight: 600;
    color: #FFFFFF;
    font-size: 14px;
    margin-bottom: 4px;
}

.slot-availability {
    font-size: 11px;
    color: #0E6B3B;
}

.slot-item.disabled .slot-availability {
    color: #C62828;
}

.selected-slot-display {
    margin-top: 10px;
    padding: 10px;
    background: rgba(14, 107, 59, 0.2);
    border: 1px solid #0E6B3B;
    border-radius: 8px;
    color: #FFFFFF;
    font-size: 14px;
    display: none;
}

.selected-slot-display.show {
    display: block;
}

/* Toggle Switch Styling */
.switch-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: 0.3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #1A5D32;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Order Dashboard Layout */
.order-dashboard-container {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr) 310px;
    gap: 16px;
    padding: 24px 0;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

@media (max-width: 768px) {
    .order-dashboard-container {
        max-width: none !important;
        margin: 0 !important;
    }
}

.order-main .menu-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.order-sidebar-left,
.order-sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.order-main {
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

/* Sidebar Cards */
.sidebar-card {
    background: var(--bg-surface-light, #1A1A1A);
    border: 2px solid var(--border-color, #333333);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    min-width: 0;
}

.sidebar-card:hover {
    border-color: var(--accent-green, #0E6B3B);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.sidebar-card h3 {
    margin: 0 0 1rem 0;
    color: var(--accent-green, #0E6B3B);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-card h3 i {
    font-size: 1rem;
}

/* Specials */
.special-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color, #333333);
}

.special-item:last-child {
    border-bottom: none;
}

.special-badge {
    display: inline-block;
    background: linear-gradient(135deg, #0E6B3B 0%, #117F47 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 0.5rem;
}

.special-desc {
    color: var(--text-muted, #B0B0B0);
    font-size: 0.85rem;
    margin: 0.25rem 0;
}

.special-price {
    color: var(--accent-green, #0E6B3B);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Category Navigation */
.category-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.category-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary, #FFFFFF);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: var(--bg-surface, #111111);
    border: 1px solid transparent;
}

.category-link:hover,
.category-link:focus-visible {
    background: rgba(14, 107, 59, 0.2);
    border-color: var(--accent-green, #0E6B3B);
    text-decoration: none;
    color: var(--text-primary, #FFFFFF);
}

/* Menu Item Grid */
.menu-item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    justify-content: center;
    min-width: 0;
}

@media (max-width: 1200px) {
    .menu-item-grid {
        grid-template-columns: 1fr !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        justify-content: center !important;
        min-width: 0 !important;
    }
}

/* Order Items */
.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color, #333333);
    gap: 0.5rem;
}

.order-item:last-child {
    border-bottom: none;
}

.order-item-name {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
}

.order-item-price {
    white-space: nowrap;
    color: var(--accent-green, #0E6B3B);
    font-weight: 700;
}

/* Responsive */
@media (max-width: 900px) {
    .order-dashboard-container {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    .order-sidebar-right {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .order-dashboard-container {
        grid-template-columns: 1fr !important;
        padding: 16px 0 !important;
        overflow: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        max-width: none !important;
    }

    .order-main {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        padding: 0 !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    .order-main .menu-grid {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .order-sidebar-left,
    .order-sidebar-right {
        display: flex;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .category-section {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        padding: 0 !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    .category-header {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    .category-title {
        width: auto !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin: 0 !important;
        padding: 0 !important;
        color: var(--accent-green, #0E6B3B) !important;
    }

    .item-count {
        width: auto !important;
        max-width: 100% !important;
        overflow: hidden !important;
        white-space: nowrap !important;
        margin: 0 !important;
        padding: 0 !important;
        color: var(--accent-green, #0E6B3B) !important;
    }

    .menu-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        justify-content: center !important;
        padding: 0 !important;
        margin: 0 !important;
        min-width: 0 !important;
    }

    .menu-item-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        justify-content: center;
        min-width: 0;
    }

    .category-nav {
        flex-direction: row;
        flex-wrap: wrap;
        max-height: none;
        overflow-x: auto;
        gap: 8px;
    }

    .category-link {
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .sidebar-card {
        padding: 1.25rem;
        width: 100%;
        max-width: 100%;
    }

    .sidebar-card h3 {
        font-size: 1rem;
    }

    .special-card {
        padding: 10px;
    }

    .special-title {
        font-size: 13px;
    }

    .special-desc {
        font-size: 12px;
    }

    .special-price {
        font-size: 15px;
    }

    .btn-add-special {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 36px;
    }
}

@media (max-width: 480px) {
    .order-dashboard-container {
        padding: 12px 0;
        gap: 12px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .order-main {
        padding: 0;
        width: 95%;
        max-width: 95%;
        overflow: hidden;
        margin: 0 auto;
    }

    .order-main .menu-grid {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .category-section {
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        margin: 0 !important;
    }

    .category-header {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    .category-title {
        width: auto !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin: 0 !important;
        padding: 0 !important;
        color: var(--accent-green, #0E6B3B) !important;
    }

    .item-count {
        width: auto !important;
        max-width: 100% !important;
        overflow: hidden !important;
        white-space: nowrap !important;
        margin: 0 !important;
        padding: 0 !important;
        color: var(--accent-green, #0E6B3B) !important;
    }

    .menu-grid {
        padding: 0;
        margin: 0;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .sidebar-card {
        padding: 1rem;
        border-radius: 10px;
        width: 100%;
        max-width: 100%;
    }

    .sidebar-card h3 {
        font-size: 0.95rem;
        gap: 6px;
    }

    .sidebar-card h3 i {
        font-size: 0.9rem;
    }

    .special-card {
        padding: 8px;
        border-radius: 6px;
    }

    .special-header {
        gap: 6px;
    }

    .special-badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    .special-title {
        font-size: 12px;
    }

    .special-desc {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .special-price {
        font-size: 14px;
    }

    .special-original-price {
        font-size: 11px;
    }

    .btn-add-special {
        padding: 6px 10px;
        font-size: 11px;
        min-height: 32px;
    }

    .category-nav {
        gap: 6px;
    }

    .category-link {
        padding: 6px 10px;
        font-size: 0.85rem;
        border-radius: 6px;
    }

    .category-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .category-dot {
        width: 8px;
        height: 8px;
    }

    .menu-item-grid {
        gap: 0.75rem;
    }
}

/* Menu item images — half width on wider order page layout */
@media (min-width: 1201px) {
    .menu-item-image-border {
        max-width: 50%;
    }
}
