/* Base mobile-first styles */
:root {
    --primary-color: #1A1A1A;
    --secondary-color: #D4AF37;
    --text-color: #333;
    --light-bg: #f5f5f5;
    --dark-text: #fff;
    --header-height: 70px;
    --footer-height: 60px;
}

* {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior-y: none; /* Prevents pull-to-refresh */
    background-color: var(--light-bg);
    color: var(--text-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Table Selection Screen */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--primary-color);
    background-image: url('/images/tango-bg.jpg');
    background-size: cover;
    background-position: center;
    background-blend-mode: overlay;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.table-selection-content {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.logo-container {
    text-align: center;
    margin-bottom: 20px;
}

.restaurant-logo {
    max-height: 80px;
    width: auto;
    object-fit: contain;
}

.table-input-container {
    margin-top: 20px;
}

#table-number-input {
    padding: 12px;
    font-size: 18px;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 10px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 100;
}

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

.restaurant-logo {
    height: 50px;
    width: auto;
}

.header-text {
    flex: 1;
}

.header-text h1 {
    margin: 0;
    font-size: 20px;
}

.header-text p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.table-info {
    font-weight: bold;
}

/* Menu Items */
.menu-content {
    margin-top: 80px;
    padding: 15px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.menu-item-image {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 15px;
}

.item-info {
    flex: 1;
}

.item-info h4 {
    margin: 0;
    font-size: 16px;
}

.item-info p {
    margin: 5px 0;
    color: #666;
    font-size: 14px;
}

.price {
    color: #D4AF37;
    font-weight: bold;
    margin-top: 5px;
}

/* Quantity Controls */
.item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.item-quantity button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #D4AF37;
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-quantity span {
    min-width: 24px;
    text-align: center;
    font-weight: bold;
}

/* Cart */
.cart-container {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%; /* Full width on mobile */
    background: white;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.cart-container:not(.hidden) {
    transform: translateX(0);
}

.cart-header {
    padding: 12px 15px;
    display: flex;
    align-items: center;
}

.cart-header h3 {
    font-size: 18px;
    margin: 0;
}

.cart-header button {
    padding: 8px;
    font-size: 24px;
}

#cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    -webkit-overflow-scrolling: touch;
}

.cart-footer {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

#checkout-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 8px;
    background: #D4AF37;
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-top: 10px;
}

/* Category Tabs */
.category-tabs {
    position: sticky;
    top: 70px;
    background: white;
    padding: 10px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    z-index: 99;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.category-tab {
    padding: 8px 16px;
    border: none;
    background: #f5f5f5;
    border-radius: 20px;
    white-space: nowrap;
}

.category-tab.active {
    background: #D4AF37;
    color: white;
}

/* Safe area handling for modern iPhones */
@supports (padding: max(0px)) {
    .cart-container {
        padding-top: max(20px, env(safe-area-inset-top));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
    
    header {
        padding-top: max(10px, env(safe-area-inset-top));
    }
    
    .cart-footer {
        padding-bottom: max(15px, env(safe-area-inset-bottom));
    }
}

/* Add viewport meta tag to your HTML */

/* Category styling */
.category {
    scroll-margin-top: 120px; /* Ensures the category title is visible when scrolled to */
}

.category-name {
    padding: 10px 0;
    margin-bottom: 15px;
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 10;
    border-bottom: 2px solid var(--secondary-color);
    color: var(--primary-color);
}

/* Menu item styling */
.item-name {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 16px;
    color: var(--primary-color);
}

.item-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.item-price {
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.item-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Button animation styles */
.quantity-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background-color: #f0f0f0;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background-color: #e0e0e0;
}

.quantity-btn.clicked {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    transform: scale(1.1);
}

/* Cart Styling */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: flex-end;
    z-index: 1000;
}

.cart-overlay.hidden {
    display: none;
}

.cart-panel {
    background-color: white;
    width: 100%;
    max-width: 400px;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.cart-item .item-info {
    flex: 1;
    padding: 0 10px;
}

.cart-item h4 {
    margin: 0;
    font-size: 15px;
    line-height: 1.3;
}

.cart-item .price {
    font-size: 14px;
    font-weight: 600;
}

.remove-item-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
}

.empty-cart-message {
    text-align: center;
    color: #999;
    padding: 20px 0;
}

#cart-total {
    margin-top: 20px;
    text-align: right;
    font-weight: bold;
    font-size: 18px;
    color: var(--secondary-color);
}

.btn {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border: none;
    border-radius: 5px;
    margin-top: 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.2s ease;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cart-btn {
    background: #D4AF37;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cart-btn:hover {
    background: #C19B26;
}

/* Checkout styling */
.checkout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.checkout-content {
    background-color: white;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 8px;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.checkout-header h2 {
    margin: 0;
    color: var(--primary-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.checkout-steps {
    display: flex;
    padding: 0 20px;
    border-bottom: 1px solid #eee;
}

.step {
    flex: 1;
    text-align: center;
    padding: 15px 0;
    position: relative;
    color: #999;
}

.step.active {
    color: var(--secondary-color);
    font-weight: bold;
}

.step::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: transparent;
}

.step.active::after {
    background-color: var(--secondary-color);
}

.checkout-step-content {
    padding: 20px;
    display: none;
}

.checkout-step-content.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--primary-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-group.half {
    flex: 1;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.btn-secondary {
    background-color: #eee;
    color: var(--primary-color);
}

.payment-methods {
    margin-bottom: 20px;
}

.payment-method {
    padding: 10px 0;
}

.order-summary {
    margin-top: 30px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.order-summary h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: var(--primary-color);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.summary-total {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    text-align: right;
    font-weight: bold;
    color: var(--secondary-color);
}

.confirmation-message {
    text-align: center;
    padding: 30px 0;
}

.success-icon {
    width: 60px;
    height: 60px;
    line-height: 60px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    font-size: 30px;
    margin: 0 auto 20px;
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .menu-item {
        flex-direction: row;
    }
    
    .item-image {
        width: 80px;
        height: 80px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .checkout-content {
        width: 95%;
        max-height: 95vh;
    }
}

.service-choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.service-choice-buttons .btn {
    padding: 15px 30px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.payment-choice {
    margin-top: 20px;
    text-align: center;
}

.payment-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.payment-btn {
    padding: 15px 30px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 150px;
}

.btn-secondary {
    background-color: #666;
    color: white;
}

.btn-secondary:hover {
    background-color: #555;
}

/* Add these styles if they're missing */
.menu-category {
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

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

.item-info h4 {
    margin: 0 0 5px 0;
    color: var(--primary-color);
}

.item-info p {
    margin: 0;
    color: #666;
    font-size: 0.9em;
}

.price {
    color: var(--secondary-color);
    font-weight: bold;
    margin-top: 5px;
}

.menu-category {
    scroll-margin-top: 60px; /* Accounts for sticky header */
}

.main-container {
    padding-bottom: 80px; /* Space for cart button */
}

/* Cart Button */
.cart-button-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99;
    width: 90%;
    max-width: 400px;
}

.cart-btn {
    width: 100%;
    padding: 15px;
    background: #D4AF37;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Cart header logo */
.cart-header img,
.cart-container .restaurant-logo {
    height: 30px; /* Much smaller logo in cart */
    width: auto;
    margin-right: 10px;
}

/* Checkout screen logo */
.checkout-header img,
.checkout-logo {
    height: 40px;
    width: auto;
    margin-bottom: 10px;
}

/* Checkout screen styles */
.checkout-header {
    text-align: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.checkout-header h2 {
    font-size: 20px;
    margin: 10px 0;
}

.restaurant-info {
    text-align: center;
    font-size: 14px;
    margin-bottom: 20px;
}

.restaurant-info p {
    margin: 5px 0;
}

/* Orders page styles */
.orders-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.orders-filters {
    margin: 20px 0;
    display: flex;
    gap: 10px;
}

.filter-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background: #f5f5f5;
    cursor: pointer;
}

.filter-btn.active {
    background: #D4AF37;
    color: white;
}

.order-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.order-table {
    font-size: 18px;
    font-weight: bold;
    color: #D4AF37;
}

.order-time {
    color: #666;
}

.order-items {
    margin-bottom: 15px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.order-total {
    text-align: right;
    font-weight: bold;
    font-size: 16px;
}

.order-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.order-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.complete-btn {
    background: #4CAF50;
    color: white;
}

.cancel-btn {
    background: #f44336;
    color: white;
}