:root {
    --brand: #e11d48;
    --brand-dark: #be123c;
    --brand-light: #fff1f2;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --dark: #0f172a;
    --bg: #f8fafc;
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */
   *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100%;
}

a {
    color: var(--brand);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--brand-dark);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--dark);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5em;
}

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

/* ==========================================================================
   Components
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    user-select: none;
}

.btn-primary {
    background-color: var(--brand-primary, #e11d48);
    background-image: linear-gradient(135deg, var(--brand-primary, #e11d48) 0%, var(--brand-secondary, #f43f5e) 100%);
    color: #ffffff !important;
    border: none;
    box-shadow: 0 4px 14px rgba(225, 29, 72, 0.28);
}

.btn-primary:hover {
    background-color: #be123c;
    background-image: linear-gradient(135deg, #be123c 0%, #e11d48 100%);
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(225, 29, 72, 0.38);
    transform: translateY(-2px);
}

.btn-primary:focus,
.btn-primary:focus-visible {
    outline: 3px solid rgba(225, 29, 72, 0.4) !important;
    outline-offset: 2px !important;
    color: #ffffff !important;
}

.btn-primary:active {
    transform: translateY(0);
    background-color: #9f1239;
    background-image: none;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.25);
}

.btn-primary:disabled,
.btn-primary[disabled] {
    background-color: #94a3b8 !important;
    background-image: none !important;
    border-color: #94a3b8 !important;
    color: #ffffff !important;
    opacity: 0.7 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
    pointer-events: none;
}

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

.btn-secondary:hover {
    border-color: var(--text);
    background: var(--surface);
    color: var(--text);
}

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

.btn-outline-brand:hover {
    background: var(--brand);
    color: #ffffff !important;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    background-color: var(--brand-light);
    color: var(--brand);
}

.card {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 60px 0;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }

/* ==========================================================================
   Navbar
   ========================================================================== */
.announcement-banner {
    background-color: var(--accent);
    color: white;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.navbar {
    background-color: var(--surface);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: box-shadow 0.3s ease;
    padding: 1rem 0;
}

.navbar.shadow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text);
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--brand);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-btn {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    position: relative;
    color: var(--dark);
}

.cart-btn .badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background-color: var(--brand);
    color: white;
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
}

.hamburger {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    position: relative;
    padding: 100px 0;
    background: linear-gradient(rgba(26, 26, 46, 0.8), rgba(26, 26, 46, 0.8)), url('../img/hero-bg.jpg') center/cover;
    color: white;
    text-align: center;
}

.hero h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* ==========================================================================
   Menu Item Cards
   ========================================================================== */
.item-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    cursor: pointer;
}

.item-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.item-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
}

.item-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.item-name {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.item-desc {
    color: var(--muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.item-price {
    color: var(--brand);
    font-weight: 700;
    font-size: 1.25rem;
}

.btn-add {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.25rem;
}

.btn-add:hover {
    background: var(--brand);
    color: white;
}

.item-card.unavailable {
    opacity: 0.6;
    pointer-events: none;
    filter: grayscale(1);
}

/* ==========================================================================
   Item Modal / Popup
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: var(--surface);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(50px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-box {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 10;
}

.modal-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.modal-content {
    padding: 2rem;
}

.modal-header {
    margin-bottom: 1.5rem;
}

.modal-body {
    margin-bottom: 2rem;
}

.info-chips {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.chip {
    background: var(--bg);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    color: var(--muted);
    border: 1px solid var(--border);
}

.addon-section {
    margin-bottom: 1.5rem;
}

.addon-section h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.addon-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.addon-item label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg);
    padding: 0.5rem;
    border-radius: 8px;
    width: fit-content;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

/* ==========================================================================
   Cart Drawer
   ========================================================================== */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: -380px;
    width: 380px;
    height: 100%;
    background: var(--surface);
    box-shadow: -4px 0 15px rgba(0,0,0,0.1);
    z-index: 1001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-drawer.active {
    right: 0;
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.cart-item-img {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
}

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

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* ==========================================================================
   Checkout
   ========================================================================== */
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-light);
}

.zone-selector, .payment-methods {
    display: grid;
    gap: 1rem;
}

.radio-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}

.radio-card:hover {
    border-color: var(--brand);
}

.radio-card input[type="radio"] {
    accent-color: var(--brand);
    width: 1.2rem;
    height: 1.2rem;
}

/* ==========================================================================
   Tracking
   ========================================================================== */
.track-container {
    max-width: 800px;
    margin: 0 auto;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin: 3rem 0;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--border);
    z-index: 1;
}

.step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

.step-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--muted);
    transition: all 0.3s;
}

.step.active .step-icon {
    border-color: var(--brand);
    color: var(--brand);
}

.step.completed .step-icon {
    background: var(--brand);
    border-color: var(--brand);
    color: white;
}

.driver-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-top: 2rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    background: var(--dark);
    color: white;
    padding: 60px 0 0;
    margin-top: 60px;
}

.footer h4 {
    color: white;
    margin-bottom: 1.5rem;
}

.footer a {
    color: var(--muted);
}

.footer a:hover {
    color: white;
}

.footer-col ul li {
    margin-bottom: 0.75rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: white;
    margin-right: 0.5rem;
    transition: background 0.3s;
}

.social-links a:hover {
    background: var(--brand);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1.5rem 0;
    text-align: center;
    margin-top: 3rem;
    color: var(--muted);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .checkout-grid { grid-template-columns: 1fr; }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--surface);
        flex-direction: column;
        padding: 1.5rem;
        box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
        display: none;
    }
    
    .nav-links.active { display: flex; }
    .hamburger { display: block; }
    
    .cart-drawer {
        width: 100%;
        right: -100%;
    }
}

@media (max-width: 480px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2rem; }
    
    .modal-box {
        margin: 0;
        border-radius: 16px 16px 0 0;
        max-height: 95vh;
        align-self: flex-end;
        transform: translateY(100%);
    }
    
    .modal-overlay.active .modal-box {
        transform: translateY(0);
    }
}

@media (max-width: 375px) {
    .container { padding: 0 1rem; }
}

/* ==========================================================================
   Responsive Display & Flex Utilities
   ========================================================================== */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }

.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-column { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }

.w-100 { width: 100% !important; }
.text-center { text-align: center !important; }
.text-start { text-align: left !important; }
.text-end { text-align: right !important; }

@media (min-width: 576px) {
    .d-sm-none { display: none !important; }
    .d-sm-block { display: block !important; }
    .d-sm-inline { display: inline !important; }
    .d-sm-inline-block { display: inline-block !important; }
    .d-sm-flex { display: flex !important; }
    .d-sm-inline-flex { display: inline-flex !important; }
}

@media (min-width: 768px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-inline { display: inline !important; }
    .d-md-inline-block { display: inline-block !important; }
    .d-md-flex { display: flex !important; }
    .d-md-inline-flex { display: inline-flex !important; }
}

@media (min-width: 992px) {
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
    .d-lg-inline { display: inline !important; }
    .d-lg-inline-block { display: inline-block !important; }
    .d-lg-flex { display: flex !important; }
    .d-lg-inline-flex { display: inline-flex !important; }
}
