:root {
    --bg-color: #ffffff;
    --primary-color: #f8f9fa;
    --secondary-color: #f1f3f4;
    --text-color: #212529;
    --accent-color: #20b2aa;
    --button-color: #17a2b8;
    --button-text-color: #ffffff;
    --border-color: #dee2e6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0 0 100px 0; /* Padding at the bottom for the footer */
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* --- Loader --- */
.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}
.loader {
    border: 4px solid var(--secondary-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Layout --- */
.sticky-header {
    position: sticky;
    top: 0;
    background-color: var(--primary-color);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.main-content {
    padding: 15px;
}

.sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--primary-color);
    padding: 10px 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

/* --- Header --- */
.brand {
    font-weight: bold;
    font-size: 1.4em;
}
.user-info {
    font-size: 1.1em;
}

.cart-header-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(32, 178, 170, 0.3);
}

.cart-header-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(32, 178, 170, 0.4);
}

.cart-icon {
    font-size: 1.1em;
}

.cart-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
}

/* --- User Card & Lang Selector --- */
.user-card-info {
    background-color: var(--secondary-color);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.lang-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 5px 10px;
    border-radius: 5px;
    margin-left: 5px;
    cursor: pointer;
}
.lang-btn.active {
    background-color: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
}

/* --- Sections --- */
h2 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* --- ADS Carousel --- */
.ads-section {
    margin-bottom: 20px;
}

.ads-carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: var(--secondary-color);
}

.ads-carousel {
    display: flex;
    transition: transform 0.5s ease;
    width: 100%;
}

.ads-banner {
    min-width: 100%;
    position: relative;
    aspect-ratio: 3/2; /* Horizontal 3:2 ratio as requested */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    border-radius: 12px;
}

.ads-banner-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 20px;
    border-radius: 0 0 12px 12px;
}

.ads-banner-title {
    font-size: 1.2em;
    font-weight: bold;
    margin: 0 0 5px 0;
}

.ads-banner-description {
    font-size: 0.9em;
    opacity: 0.9;
    margin: 0;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 15px;
    background: var(--primary-color);
    border-radius: 0 0 12px 12px;
}

.carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.carousel-indicator.active {
    background: var(--accent-color);
}

/* Touch/Swipe support for mobile */
.ads-carousel-container {
    touch-action: pan-y;
}

.ads-banner {
    user-select: none;
    -webkit-user-select: none;
}

/* --- Menu --- */
.category-tabs {
    display: flex;
    overflow-x: auto;
    margin-bottom: 15px;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}
.category-tabs::-webkit-scrollbar { display: none; } /* Chrome, Safari */

.category-tab {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: none;
    padding: 8px 15px;
    border-radius: 15px;
    margin-right: 10px;
    cursor: pointer;
    white-space: nowrap;
}
.category-tab.active {
    background-color: var(--accent-color);
    color: #ffffff;
}

.menu-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.menu-card {
    background-color: var(--secondary-color);
    padding: 15px;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 5px 15px;
}

.item-title { grid-area: 1 / 1 / 2 / 2; font-weight: bold; }
.item-details { grid-area: 2 / 1 / 3 / 2; color: #6c757d; font-size: 0.9em; }
.item-price { grid-area: 3 / 1 / 4 / 2; font-size: 1.1em; }
.item-actions { grid-area: 1 / 2 / 4 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; }

.item-info-btn {
    background: none; border: none; color: var(--text-color); font-size: 1.2em; cursor: pointer; margin-bottom: 5px;
}

.quantity-control {
    display: flex;
    align-items: center;
    background-color: var(--primary-color);
    border-radius: 5px;
}
.quantity-btn {
    background: none; border: none; color: var(--text-color); font-size: 1.5em; width: 30px; height: 30px; cursor: pointer;
}
.item-quantity {
    font-size: 1.1em; min-width: 20px; text-align: center;
}

/* --- Footer / Cart --- */
.cart-footer {
    padding: 12px 15px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-top: 2px solid var(--accent-color);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}

.quick-order-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--button-color) 0%, var(--accent-color) 100%);
    color: var(--button-text-color);
    border: none;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(32, 178, 170, 0.3);
}

.quick-order-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(32, 178, 170, 0.4);
}

.cart-container {
    display: flex;
    gap: 15px;
    align-items: stretch;
    max-width: 100%;
}

.cart-left {
    flex: 1;
    min-width: 0;
}

.cart-right {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
    min-width: 120px;
}

.cart-row {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
    align-items: center;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.option-label {
    font-size: 0.8em;
    font-weight: 600;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.option-select {
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-color);
    font-size: 0.9em;
    color: var(--text-color);
    cursor: pointer;
}

.radio-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85em;
    color: var(--text-color);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.radio-option:hover {
    background-color: var(--accent-color);
    color: white;
}

.radio-option input[type="radio"] {
    margin: 0;
    width: 14px;
    height: 14px;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 10px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 6px;
    text-align: center;
    min-width: 60px;
}

.card-label {
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.card-number {
    font-size: 0.9em;
    font-weight: bold;
}

.cart-summary {
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    min-width: 120px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    margin-bottom: 4px;
}

.summary-row:last-child {
    margin-bottom: 0;
}

.summary-label {
    font-weight: 500;
    color: var(--text-color);
}

.summary-value {
    font-weight: bold;
    color: var(--accent-color);
}

.currency {
    font-size: 0.8em;
    color: var(--text-color);
    margin-left: 2px;
}

.stars-row {
    border-top: 1px solid var(--border-color);
    padding-top: 6px;
    margin-top: 6px;
}

.order-button {
    background: linear-gradient(135deg, var(--button-color) 0%, var(--accent-color) 100%);
    color: var(--button-text-color);
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(32, 178, 170, 0.3);
    min-width: 120px;
    text-align: center;
}

.order-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(32, 178, 170, 0.4);
}

.order-button:active {
    transform: translateY(0);
}

.order-text {
    display: block;
    font-size: 0.9em;
}

.item-count {
    display: block;
    font-size: 0.8em;
    opacity: 0.9;
    margin-top: 2px;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
    .cart-container {
        flex-direction: column;
        gap: 10px;
    }

    .cart-row {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .cart-right {
        align-items: stretch;
        width: 100%;
    }

    .cart-summary {
        min-width: unset;
    }

    .order-button {
        width: 100%;
        min-width: unset;
    }
}

/* --- Modal --- */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    background-color: var(--secondary-color);
    margin: 40% auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    width: 80%;
    max-width: 400px;
    border-radius: 8px;
    position: relative;
}

/* --- Cart Modal --- */
.cart-modal {
    background-color: rgba(0,0,0,0.8);
    z-index: 300;
}

.cart-modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    max-width: none;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-modal-header {
    background: var(--primary-color);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.cart-modal-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: var(--text-color);
    font-weight: 600;
}

.cart-modal-close {
    background: none;
    border: none;
    font-size: 2em;
    color: var(--text-color);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.cart-modal-close:hover {
    background-color: var(--secondary-color);
}

.cart-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cart-items-section h3 {
    margin: 0 0 15px 0;
    color: var(--text-color);
    font-size: 1.2em;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 8px;
}

.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-item {
    background: var(--secondary-color);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.cart-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    font-size: 1em;
    color: var(--text-color);
    margin-bottom: 4px;
}

.cart-item-price {
    font-size: 0.9em;
    color: var(--accent-color);
    font-weight: 500;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-qty-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cart-qty-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(32, 178, 170, 0.3);
}

.cart-item-quantity {
    font-size: 1.1em;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
    color: var(--text-color);
}

.cart-remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.cart-remove-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.empty-cart {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px 20px;
}

.cart-options-section {
    background: var(--secondary-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cart-summary-section {
    background: var(--primary-color);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.cart-modal-footer {
    background: var(--primary-color);
    padding: 20px;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.modal-order-button {
    width: 100%;
    background: linear-gradient(135deg, var(--button-color) 0%, var(--accent-color) 100%);
    color: var(--button-text-color);
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(32, 178, 170, 0.3);
}

.modal-order-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(32, 178, 170, 0.4);
}

/* Mobile responsive for cart modal */
@media (max-width: 480px) {
    .cart-modal-header {
        padding: 15px;
    }

    .cart-modal-header h2 {
        font-size: 1.3em;
    }

    .cart-modal-body {
        padding: 15px;
        gap: 15px;
    }

    .cart-item {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .cart-item-controls {
        width: 100%;
        justify-content: space-between;
    }

    .cart-options-section {
        padding: 15px;
    }

    .cart-summary-section {
        padding: 15px;
    }

    .cart-modal-footer {
        padding: 15px;
    }
}
.close-button {
    color: #6c757d;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

/* --- Order Success Modal --- */
.order-success-modal {
    background-color: rgba(0,0,0,0.8);
}

.success-modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: none;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
    padding: 40px 30px;
    margin: 20% auto;
    max-width: 400px;
    width: 90%;
}

.success-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: bounceIn 0.8s ease-out;
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

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

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

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.success-modal-content h2 {
    color: var(--accent-color);
    font-size: 2em;
    margin-bottom: 15px;
    border: none;
    padding: 0;
}

.success-modal-content p {
    color: var(--text-color);
    font-size: 1.1em;
    margin-bottom: 30px;
    line-height: 1.5;
}

.order-summary {
    background-color: var(--secondary-color);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.order-summary h3 {
    color: var(--accent-color);
    font-size: 1.2em;
    margin-bottom: 15px;
    text-align: center;
    border: none;
    padding: 0;
}

.order-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.order-items {
    background-color: var(--bg-color);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
}

.order-items h4 {
    color: var(--text-color);
    font-size: 1em;
    margin: 0 0 10px 0;
    border: none;
    padding: 0;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 0.9em;
    color: var(--text-color);
}

.order-total {
    border-top: 2px solid var(--accent-color);
    padding-top: 15px;
}

.order-total .order-row {
    border-bottom: none;
    padding: 5px 0;
}

.order-total .order-row:last-child {
    font-weight: bold;
    color: var(--accent-color);
}

.success-close-btn {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--button-color) 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(32, 178, 170, 0.3);
}

.success-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(32, 178, 170, 0.4);
}

.success-close-btn:active {
    transform: translateY(0);
}
