/* ===================================
   Order Page Styles
   Old Sanaa Restaurant
   =================================== */

/* Order Page Base */
.order-page {
    background-color: var(--color-light);
    min-height: 100vh;
    padding-bottom: 120px;
    /* Space for sticky cart footer */
}

/* 
   =================================== 
   1. UNIFIED COMPACT HEADER 
   =================================== 
*/
.order-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, #8e7226 100%);
    color: var(--color-white);
    padding: 100px 20px 30px;
    /* Top padding for fixed nav */
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 10;
}

.header-text-content {
    margin-bottom: 20px;
}

.order-header h1 {
    font-size: 2rem;
    margin-bottom: 5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: white;
}

.order-header p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

/* Header Search */
.header-search {
    max-width: 600px;
    margin: 0 auto 25px;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border-radius: 50px;
    border: none;
    background: white;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    color: var(--color-text);
}

.search-input:focus {
    outline: none;
    transform: scale(1.01);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-primary);
    font-size: 1.1rem;
}

/* Header Categories */
.header-categories {
    margin-top: 15px;
}

.categories-list {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 12px;
    padding: 5px 20px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.categories-list::-webkit-scrollbar {
    display: none;
}

.category-item {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    color: white !important;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.category-item:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
}

.category-item.active {
    background: white !important;
    color: var(--color-primary) !important;
    border-color: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transform: scale(1.08);
}

/* 
   =================================== 
   2. MAIN CONTENT & GRID 
   =================================== 
*/
.order-container {
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.menu-section {
    width: 100%;
}

/* Menu Grid - Responsive for Desktop */
.menu-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 30px;
    margin-top: 20px;
}

/* Menu Card Styles */
.menu-item-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
}

.menu-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.menu-item-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.menu-item-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.menu-item-name {
    font-size: 1.25rem;
    color: var(--color-primary);
    margin-bottom: 8px;
    font-weight: 700;
}

.menu-item-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.menu-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
    margin-top: auto;
}

.menu-item-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--color-accent);
}

.btn-add-to-cart {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.2);
}

.btn-add-to-cart:hover {
    background: #0284c7;
    transform: translateY(-2px);
}

/* 
   =================================== 
   3. RESPONSIVE MEDIA QUERIES 
   =================================== 
*/

/* Tablet Layout */
@media (max-width: 992px) {
    .menu-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px;
    }
}

/* Mobile App Optimization */
@media (max-width: 768px) {
    .order-header {
        padding: 90px 15px 25px;
    }

    .order-header h1 {
        font-size: 1.6rem;
    }

    .categories-list {
        justify-content: flex-start;
        /* Scroll from left */
    }

    .order-container {
        padding: 0 15px;
        margin-top: 25px;
    }
}

/* Compact Mobile View (Talabat Style) */
@media (max-width: 600px) {
    .menu-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .menu-item-image {
        height: 130px;
    }

    .menu-item-content {
        padding: 10px;
    }

    .menu-item-name {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .menu-item-description {
        display: none;
    }

    .menu-item-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding-top: 8px;
    }

    .menu-item-footer>div {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .btn-add-to-cart {
        width: 100%;
        padding: 6px;
        font-size: 0.85rem;
    }
}

/* 
   =================================== 
   4. MODALS & UI COMPONENTS 
   =================================== 
*/

/* Modal Overrides - Premium Look */
.modal-content {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    background: #fff;
}

.modal-header {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 20px 25px;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--color-secondary);
    font-weight: 800;
}

/* Modifiers Container */
.modifiers-container {
    padding: 20px 25px;
}

.modifiers-container h3 {
    margin-bottom: 5px;
    color: var(--color-secondary);
    font-size: 1.3rem;
    font-weight: 700;
}

.modifiers-container p {
    color: #888;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.modifier-group {
    margin-bottom: 30px;
    border-bottom: 1px dashed #e0e0e0;
    padding-bottom: 20px;
}

.modifier-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.modifier-group h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--color-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}

.modifier-group h4 small {
    color: var(--color-accent);
    font-size: 0.75rem;
    background: rgba(226, 88, 34, 0.08);
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.modifier-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Premium Option Cards */
.modifier-option {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    position: relative;
    user-select: none;
}

.modifier-option:hover {
    background-color: #fafafa;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

/* Custom Checkbox/Radio Styling */
.modifier-option input[type="radio"],
.modifier-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    margin-right: 15px;
    outline: none;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.modifier-option input[type="checkbox"] {
    border-radius: 6px;
}

.modifier-option input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(204, 164, 59, 0.1);
}

/* Checkmark/Dot */
.modifier-option input:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.modifier-option input[type="checkbox"]:checked::after {
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    background: transparent;
    transform: translate(-50%, -60%) rotate(45deg);
    border-radius: 0;
}

/* Highlight card when checked */
.modifier-option:has(input:checked) {
    border-color: var(--color-primary);
    background-color: rgba(204, 164, 59, 0.03);
}

.opt-name {
    font-weight: 600;
    color: var(--color-text);
    flex-grow: 1;
    font-size: 1rem;
}

.opt-price {
    font-weight: 700;
    color: var(--color-text);
    font-size: 0.95rem;
}

/* Specific Size List Styling */
#size-options-list .modifier-option {
    padding: 20px;
    margin-bottom: 12px;
}

#size-options-list .modifier-option b {
    font-size: 1.1rem;
    color: var(--color-secondary);
}

/* Modal Footer Action */
.modal-footer {
    padding: 20px 25px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.modal-footer .btn-checkout {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--color-primary);
    box-shadow: 0 4px 15px rgba(204, 164, 59, 0.3);
    transition: all 0.3s ease;
}

.modal-footer .btn-checkout:hover {
    box-shadow: 0 6px 20px rgba(204, 164, 59, 0.4);
    transform: translateY(-2px);
}

.cart-item-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item-thumb {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
}

/* Sticky Cart Footer */
.cart-footer {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 500px;
    background: rgba(204, 164, 59, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 12px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    display: none;
    /* Controlled by JS */
}

.cart-footer.active {
    display: flex;
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.btn-view-cart {
    background: #e25822;
    /* Terracotta */
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(226, 88, 34, 0.3);
}

.total-amount {
    font-size: 1.4rem;
    font-weight: 900;
    color: white;
}