﻿/* === Global Styles === */
* {
    box-sizing: border-box;
}

/* === Layout === */
.pos-layout {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow-x: hidden;
    background: linear-gradient(135deg, #f0f4f8 0%, #e6edf4 100%);
}

.column {
    flex: 1;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    background: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

    .column:first-child {
        border-radius: 0 12px 0 0;
    }

    .column:last-child {
        border-right: none;
    }

.categories {
    max-width: 260px;
    background: linear-gradient(135deg, #f8fafd 0%, #f1f5f9 100%);
}

.items {
    flex: 2;
    overflow-x: hidden;
    background: #ffffff;
}

.options {
    flex: 2;
    background: #fafcff;
}

/* Custom scrollbar for all columns */
.column::-webkit-scrollbar {
    width: 6px;
}

.column::-webkit-scrollbar-track {
    background: #eef2f6;
    border-radius: 10px;
}

.column::-webkit-scrollbar-thumb {
    background: #2c5f8a;
    border-radius: 10px;
}

    .column::-webkit-scrollbar-thumb:hover {
        background: #1e4a6e;
    }

/* === Category headers === */
.category {
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c5f8a;
    background: linear-gradient(135deg, #f0f6ff 0%, #e8f0fe 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    word-wrap: break-word;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(44, 95, 138, 0.1);
}

    .category:hover {
        background: linear-gradient(135deg, #2c5f8a 0%, #1e4a6e 100%);
        color: white;
        transform: translateX(4px);
        box-shadow: 0 4px 12px rgba(44, 95, 138, 0.3);
    }

/* === Subcategory container === */
.subcategory-container {
    margin: 12px 0;
    padding: 12px 16px;
    border-left: 4px solid #2c5f8a;
    background: linear-gradient(135deg, #fafdff 0%, #f5f9ff 100%);
    border-radius: 12px;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

    .subcategory-container:hover {
        transform: translateX(4px);
        box-shadow: 0 4px 12px rgba(44, 95, 138, 0.15);
        border-left-width: 6px;
    }

/* === Subcategory header === */
.subcategory {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #2c5f8a;
    padding-bottom: 6px;
    border-bottom: 2px solid rgba(44, 95, 138, 0.3);
    display: inline-block;
    word-wrap: break-word;
    letter-spacing: -0.2px;
}

/* === Menu items grid - DEFAULT (DESKTOP) === */
.menu-items-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    animation: fadeInUp 0.4s ease;
}

/* === Menu item card === */
.menu-item {
    padding: 14px;
    border: none;
    border-radius: 16px;
    background: white;
    min-height: 90px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: visible;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(44, 95, 138, 0.1);
}

    .menu-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, #2c5f8a, #1e4a6e, #3a7ca5);
        transform: scaleX(0);
        transition: transform 0.3s ease;
    }

    .menu-item:hover {
        transform: translateY(-4px) scale(1.02);
        box-shadow: 0 12px 24px rgba(44, 95, 138, 0.2);
        border-color: rgba(44, 95, 138, 0.2);
    }

        .menu-item:hover::before {
            transform: scaleX(1);
        }

    /* === Top row: name left, price+button right === */
    .menu-item .item-top {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
    }

    /* Name */
    .menu-item .item-name {
        font-weight: 700;
        font-size: 1rem;
        color: #1e2a3a;
        flex: 1;
        min-width: 0;
        letter-spacing: -0.2px;
        line-height: 1.4;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    /* Right side: price + button */
    .menu-item .item-right {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-shrink: 0;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .menu-item .item-price {
        font-size: 1rem;
        font-weight: 700;
        color: #2c5f8a;
        white-space: nowrap;
    }

    /* Add button */
    .menu-item .item-button {
        padding: 8px 14px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        background: linear-gradient(135deg, #2c5f8a 0%, #1e4a6e 100%);
        color: #fff;
        border: none;
        border-radius: 30px;
        min-width: 48px;
        text-align: center;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(44, 95, 138, 0.3);
        white-space: nowrap;
    }

        .menu-item .item-button:hover {
            transform: scale(1.05) rotate(2deg);
            background: linear-gradient(135deg, #3a7ca5 0%, #2c5f8a 100%);
            box-shadow: 0 4px 16px rgba(44, 95, 138, 0.5);
        }

        .menu-item .item-button:active {
            transform: scale(0.95);
        }

    /* === Description === */
    .menu-item .item-description {
        margin-top: 10px;
        font-size: 0.8rem;
        color: #5a6e7c;
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

/* === Category container === */
.category-container {
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    margin-bottom: 16px;
    animation: slideIn 0.5s ease;
}

/* === Option groups with navy theme === */
.option-group {
    margin-bottom: 20px;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(44, 95, 138, 0.1);
}

    .option-group:hover {
        box-shadow: 0 4px 12px rgba(44, 95, 138, 0.1);
        transform: translateY(-2px);
        border-color: rgba(44, 95, 138, 0.2);
    }

    .option-group h4 {
        color: #2c5f8a;
        font-weight: 700;
        margin-bottom: 12px;
        font-size: 0.95rem;
    }

    /* Radio and checkbox styling for options */
    .option-group input[type="radio"],
    .option-group input[type="checkbox"] {
        accent-color: #2c5f8a;
    }

/* === FLOATING CART BUTTON FOR MOBILE === */
.mobile-cart-button {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #2c5f8a 0%, #1e4a6e 100%);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(44, 95, 138, 0.4);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

    .mobile-cart-button:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(44, 95, 138, 0.5);
    }

    .mobile-cart-button:active {
        transform: scale(0.95);
    }

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff6b1a;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Mobile cart drawer/sidebar */
.mobile-cart-drawer {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background: white;
    z-index: 1001;
    transition: right 0.3s ease;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    flex-direction: column;
}

    .mobile-cart-drawer.open {
        right: 0;
    }

.cart-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

    .cart-overlay.open {
        display: block;
    }

.cart-header {
    padding: 20px;
    background: linear-gradient(135deg, #2c5f8a 0%, #1e4a6e 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .cart-header h3 {
        margin: 0;
        font-size: 1.2rem;
    }

.close-cart {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

    .close-cart:hover {
        background: rgba(255, 255, 255, 0.2);
    }

.cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: #f9f9f9;
}

.cart-total {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: right;
    color: #2c5f8a;
}

.checkout-button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #2c5f8a 0%, #1e4a6e 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .checkout-button:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(44, 95, 138, 0.3);
    }

/* Cart item styling */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    color: #1e2a3a;
    margin-bottom: 4px;
}

.cart-item-price {
    font-size: 0.85rem;
    color: #2c5f8a;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-btn {
    background: #f0f0f0;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.2s ease;
}

    .quantity-btn:hover {
        background: #2c5f8a;
        color: white;
    }

.cart-item-total {
    font-weight: 600;
    color: #2c5f8a;
    min-width: 60px;
    text-align: right;
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Add to cart animation */
.menu-item.added {
    animation: pulse 0.4s ease;
}

/* === RESPONSIVE DESIGN - IMPROVED FOR MEDIUM SCREENS === */

/* Large desktop (1200px and above) - 2 columns */
@media (min-width: 1200px) {
    .menu-items-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* Medium/Large tablets and small desktops (992px to 1199px) - 1 column */
@media (min-width: 992px) and (max-width: 1199px) {
    .menu-items-container {
        grid-template-columns: 1fr; /* Single column for medium screens */
        gap: 1rem;
    }

    .menu-item {
        max-width: 100%;
    }

    /* Adjust layout for better readability */
    .pos-layout {
        gap: 0;
    }

    .categories {
        max-width: 240px;
    }

    .items {
        flex: 3;
    }

    .options {
        flex: 2;
    }
}

/* Tablets and small laptops (768px to 991px) - 1 column */
@media (min-width: 768px) and (max-width: 991px) {
    .menu-items-container {
        grid-template-columns: 1fr; /* Single column */
        gap: 1rem;
    }

    .pos-layout {
        gap: 0;
    }

    .categories {
        max-width: 220px;
    }

    .items {
        flex: 2.5;
    }

    .options {
        flex: 2;
    }

    .category {
        font-size: 1rem;
        padding: 10px 14px;
    }

    .subcategory {
        font-size: 0.95rem;
    }

    .menu-item {
        padding: 12px;
    }
}

/* Mobile (below 768px) - 1 column with cart button */
@media (max-width: 767px) {
    .pos-layout {
        flex-direction: column;
        height: auto;
        padding-bottom: 80px;
    }

    .categories {
        max-width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }

    .column {
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        width: 100%;
        padding: 12px;
    }

    /* Hide options column on mobile */
    .options {
        display: none;
    }

    .menu-items-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .category {
        font-size: 1rem;
        padding: 12px;
        margin-bottom: 6px;
    }

    .subcategory {
        font-size: 0.9rem;
    }

    .menu-item {
        padding: 12px;
    }

        .menu-item .item-name {
            font-size: 0.95rem;
            white-space: normal;
        }

        .menu-item .item-price {
            font-size: 0.9rem;
        }

        .menu-item .item-button {
            padding: 6px 12px;
            min-width: 44px;
            font-size: 0.9rem;
        }

    /* Show floating cart button on mobile */
    .mobile-cart-button {
        display: flex;
    }

    .mobile-cart-drawer {
        display: flex;
    }
}

/* Small phones (480px and below) */
@media (max-width: 480px) {
    .column {
        padding: 8px;
    }

    .menu-items-container {
        gap: 10px;
    }

    .menu-item {
        padding: 10px;
    }

        .menu-item .item-top {
            flex-direction: column;
            align-items: stretch;
            gap: 8px;
        }

        .menu-item .item-name {
            font-size: 0.9rem;
            margin-bottom: 4px;
        }

        .menu-item .item-right {
            justify-content: space-between;
            width: 100%;
        }

    .category {
        font-size: 0.95rem;
        padding: 10px;
    }

    .subcategory-container {
        padding: 10px;
    }

    .mobile-cart-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
        bottom: 15px;
        right: 15px;
    }

    .cart-badge {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
}

/* Extra small devices (360px and below) */
@media (max-width: 360px) {
    .menu-item .item-right {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .menu-item .item-price {
        white-space: normal;
    }
}

/* === Loading states and empty states === */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: #2c5f8a;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #8a9bb0;
    font-size: 0.9rem;
}

/* === Badge for popular items === */
.menu-item.popular::after {
    content: "🔥 POPULAR";
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #2c5f8a 0%, #1e4a6e 100%);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

/* === Active/selected states === */
.menu-item.selected {
    border: 2px solid #2c5f8a;
    background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
}

/* === Search highlight === */
.search-highlight {
    background-color: rgba(44, 95, 138, 0.2);
    border-radius: 4px;
    padding: 0 2px;
}
