:root {
    --primary: #FF5722; /* Orange */
    --secondary: #4CAF50; /* Green */
    --bg: #f8f9fa;
    --surface: #ffffff;
    --text: #333333;
    --text-muted: #6c757d;
    --border-color: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.08);
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --border-radius: 8px;
    --font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

body {
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

header {
    background-color: var(--surface);
    padding: var(--spacing-sm) 0;
    box-shadow: 0 2px 4px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    margin-right: var(--spacing-md);
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

nav ul li {
    margin-left: var(--spacing-md);
}

nav ul li a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    padding: var(--spacing-xs) 0;
    transition: color 0.3s ease, border-bottom 0.3s ease;
}

nav ul li a:hover,
nav ul li a.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

.cart-icon {
    position: relative;
    margin-left: var(--spacing-md);
}

.cart-icon .badge {
    background-color: var(--secondary);
    color: white;
    border-radius: 50%;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    position: absolute;
    top: -10px;
    right: -10px;
    font-weight: 600;
}

main {
    padding: var(--spacing-lg) 0;
}

.page-section {
    display: none;
    padding: var(--spacing-lg) 0;
}

.page-section.active-page {
    display: block;
}

h1, h2, h3, h4 {
    color: var(--text);
    margin-top: 0;
    margin-bottom: var(--spacing-sm);
}

h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 2rem; font-weight: 600; }
h3 { font-size: 1.5rem; font-weight: 600; }

.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('https://placehold.co/1200x400/1a1a2e/ffffff?text=Delicious+Food&font=raleway') no-repeat center center/cover;
    color: white;
    text-align: center;
    padding: var(--spacing-xl) 0;
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-lg);
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: var(--spacing-sm);
    color: white;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-lg);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    background-color: var(--primary);
    color: white;
    padding: 0.8rem 1.8rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-block;
}

.btn:hover {
    background-color: #e64a19; /* Darker primary */
    transform: translateY(-2px);
}

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

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

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}

.category-grid, .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.category-card, .product-card {
    background-color: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 8px var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.category-card:hover, .product-card:hover {
    transform: translateY(-5px);
}

.category-card img, .product-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.category-card-content, .product-card-content {
    padding: var(--spacing-sm);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.category-card h3, .product-card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.product-card-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    flex-grow: 1;
}
.product-card .price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--spacing-sm);
}
.product-card .actions {
    margin-top: auto;
}

.form-group {
    margin-bottom: var(--spacing-sm);
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.2);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.alert {
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    border-radius: 5px;
    font-weight: 500;
    display: none;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.cart-items {
    margin-top: var(--spacing-md);
}

.cart-item {
    display: flex;
    align-items: center;
    background-color: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    box-shadow: 0 2px 4px var(--shadow);
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: var(--spacing-sm);
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-details h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.cart-item-details p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-item-controls button {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    width: 30px;
    height: 30px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cart-item-controls button:hover {
    background-color: #e64a19;
}

.cart-item-controls .quantity {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.cart-summary {
    background-color: var(--surface);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    box-shadow: 0 4px 8px var(--shadow);
    margin-top: var(--spacing-lg);
}

.cart-summary div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.cart-summary .total {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.cart-summary .checkout-btn {
    width: 100%;
    margin-top: var(--spacing-md);
}

.empty-state {
    text-align: center;
    padding: var(--spacing-xl) 0;
    background-color: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 8px var(--shadow);
}

.empty-state p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1001; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--surface);
    margin: auto;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    position: relative;
}

.modal-close {
    color: var(--text-muted);
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--primary);
    text-decoration: none;
}

.modal-content h3 {
    margin-bottom: var(--spacing-md);
    color: var(--primary);
}

.order-tracking-card {
    background-color: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 8px var(--shadow);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.order-status {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Align items to start to prevent icon overflow */
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm) 0;
    border-top: 1px dashed var(--border-color);
    position: relative; /* For the line */
}

.order-status::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 15%; /* Adjust based on icon size */
    right: 15%; /* Adjust based on icon size */
    height: 2px;
    background-color: var(--border-color);
    z-index: 0;
    transform: translateY(-50%);
}

.status-item {
    text-align: center;
    flex: 1;
    position: relative;
    z-index: 1; /* Ensure circles are above the line */
}

.status-item .icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.status-item.active .icon {
    color: var(--secondary);
}

.status-item .text {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.status-item.active .text {
    color: var(--text);
}

.status-circle {
    width: 20px;
    height: 20px;
    background-color: var(--border-color);
    border-radius: 50%;
    position: absolute;
    top: 50%; /* Center vertically with the line */
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    transition: background-color 0.3s ease;
    border: 3px solid var(--surface); /* To make it stand out from the line */
}

.status-item.active .status-circle {
    background-color: var(--secondary);
}

.menu-controls {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.menu-controls .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0; /* Override default form-group margin */
}

/* Skeleton Loading Styles */
.skeleton {
    background-color: #e0e0e0;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--border-radius);
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
    background-color: #e0e0e0;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

.category-card.skeleton, .product-card.skeleton {
    height: 250px; /* Approximate height of a card */
}

.category-card.skeleton .category-card-content,
.product-card.skeleton .product-card-content {
    padding: var(--spacing-sm);
}

.category-card.skeleton h3, .product-card.skeleton h3 {
    height: 1.2em;
    width: 70%;
    margin-bottom: 0.5em;
    background-color: #c0c0c0;
    border-radius: 4px;
}

.product-card.skeleton p {
    height: 0.9em;
    width: 90%;
    background-color: #c0c0c0;
    border-radius: 4px;
}

.product-card.skeleton .price {
    height: 1.3em;
    width: 50%;
    background-color: #c0c0c0;
    border-radius: 4px;
}

.product-card.skeleton .actions .btn {
    height: 40px;
    width: 100%;
    background-color: #c0c0c0;
    border-radius: 5px;
}

@keyframes loading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}


/* Responsive adjustments */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        align-items: flex-start;
    }
    nav ul {
        margin-top: var(--spacing-sm);
        width: 100%;
        justify-content: space-around;
    }
    nav ul li {
        margin-left: 0;
        margin-right: var(--spacing-sm);
    }
    .logo {
        margin-bottom: var(--spacing-sm);
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    .hero p {
        font-size: 1rem;
    }
    .category-grid, .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .cart-item img {
        margin-bottom: 0.8rem;
        margin-right: 0;
    }
    .order-status {
        flex-wrap: wrap;
        border-top: none; /* Remove line for wrapped status */
    }
    .order-status::before {
        display: none; /* Hide line */
    }
    .status-item {
        flex: 0 0 50%;
        margin-bottom: var(--spacing-md);
    }
    .status-circle {
        top: 0; /* Adjust position for wrapped items */
        left: 50%;
        transform: translateX(-50%);
    }
    .menu-controls {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    .menu-controls .form-group {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    .logo {
        font-size: 1.5rem;
    }
    nav ul li {
        margin-right: 0.5rem;
    }
    .hero {
        padding: var(--spacing-xl) 0;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    .category-grid, .product-grid {
        grid-template-columns: 1fr; /* Single column on very small screens */
    }
}
