:root {
    --primary: #1F5F2B; /* Rider app dark green */
    --primary-light: #E8F5E9;
    --primary-hover: #174820;
    --bg-color: #FFFFFF;
    --surface: #FFFFFF;
    --text-primary: #333333;
    --text-secondary: #757575;
    --border-color: #EBEBEB;
    --header-height: 70px;
}

* { font-family: 'Outfit', sans-serif; -webkit-tap-highlight-color: transparent; box-sizing: border-box; }
body { 
    background: var(--bg-color); 
    color: var(--text-primary); 
    margin: 0; 
    padding: 0; 
    padding-top: var(--header-height); 
    overflow-y: scroll; 
    overflow-x: hidden; 
    overscroll-behavior-y: none; /* Prevents pull-to-refresh to feel like native app */
}
input, textarea {
    -webkit-user-select: auto;
    user-select: auto;
}

/* Top Navigation (Desktop & Mobile) */
.fp-header {
    background: var(--surface);
    position: fixed; top: 0; left: 0; width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 10px 0;
}

.fp-header-inner {
    width: 100%; max-width: 1200px; padding: 0 12px;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
    margin: 0 auto;
}

.fp-logo {
    display: flex; align-items: center; text-decoration: none; gap: 8px;
    order: 1;
}
.fp-logo img { height: 36px; border-radius: 8px; }
.fp-logo span { font-weight: 800; font-size: 1.4rem; color: var(--primary); font-family: 'Lobster Two', cursive; }

.fp-header-actions { display: flex; align-items: center; gap: 16px; order: 2; margin-left: auto; }
.fp-action-btn {
    background: none; border: none; font-size: 1.4rem; color: var(--text-primary);
    cursor: pointer; position: relative; padding: 8px;
    display: flex; align-items: center; justify-content: center; text-decoration: none;
}
.fp-action-btn:hover { color: var(--primary); }
.fp-cart-badge {
    position: absolute; top: 0; right: 0;
    background: var(--primary); color: white; font-size: 0.7rem; font-weight: bold;
    padding: 2px 6px; border-radius: 12px; border: 2px solid var(--surface);
}

.fp-search-bar { 
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: var(--surface); padding: 16px; z-index: 2000;
    flex-direction: column; align-items: flex-start; justify-content: flex-start;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.35s;
    display: flex; visibility: hidden;
}
.fp-search-bar.mobile-search-active {
    transform: translateX(0);
    visibility: visible;
}
.d-block { display: block !important; }
@media(min-width: 768px) {
    .fp-search-bar { 
        display: block !important; position: relative; top: auto; left: auto; 
        padding: 0; height: auto; width: auto; flex-grow: 1; max-width: 500px; 
        margin: 0 24px; order: 2; z-index: auto; background: transparent;
        transform: none; transition: none; visibility: visible;
    }
    .fp-header-actions { order: 3; margin-left: 0; }
    .fp-header { flex-direction: row; height: var(--header-height); padding: 0; }
    .fp-header-inner { align-items: center; flex-wrap: nowrap; padding: 0 24px; }
}

.search-submit-btn {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    background: none; border: none; padding: 0; color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center; z-index: 2; cursor: pointer;
}
.search-submit-btn:hover { color: var(--primary); }
.fp-search-bar input {
    width: 100%; padding: 12px 20px 12px 48px;
    border: 1px solid var(--border-color); border-radius: 12px;
    background: var(--bg-color); outline: none; transition: 0.2s;
}
.fp-search-bar input:focus { border-color: var(--primary); background: #fff; }

/* Mobile Bottom Navigation */
.fp-bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 65px;
    background: var(--surface); 
    box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
    display: flex; justify-content: space-around; align-items: center;
    z-index: 1000; padding-bottom: env(safe-area-inset-bottom);
    border-top-left-radius: 16px; border-top-right-radius: 16px;
}
@media(min-width: 768px) { .fp-bottom-nav { display: none; } } /* Hide on desktop */

.fp-nav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--text-secondary); text-decoration: none; font-size: 0.75rem;
    font-weight: 500; width: 25%; position: relative;
    transition: all 0.3s ease;
}
.fp-nav-item i { font-size: 1.4rem; margin-bottom: 2px; transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
.fp-nav-item:active i { transform: scale(0.9); }
.fp-nav-item.active { color: var(--primary); }
.fp-nav-item.active i { transform: translateY(-2px); font-size: 1.5rem; }
.fp-nav-item .fp-cart-badge {
    top: 0px; right: calc(50% - 22px); border-width: 1px; transform: scale(0.9);
}

/* Main Content */
.fp-container {
    max-width: 1200px; margin: 0 auto;
    padding: 20px 12px 30px 12px; /* Consistent left/right padding */
}
@media(min-width: 768px) {
    .fp-container { padding: 30px 24px 40px 24px; }
}

/* Hero / Banner */
.fp-banner { border-radius: 16px; overflow: hidden; margin-bottom: 32px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.fp-banner img { width: 100%; max-height: 300px; object-fit: cover; }

/* Section Titles */
.fp-section-title { font-weight: 800; font-size: 1.5rem; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.fp-section-title a { font-size: 0.9rem; color: var(--primary); text-decoration: none; font-weight: 600; }

/* Categories Grid */
.fp-cat-grid {
    display: flex; gap: 4px; margin-bottom: 12px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    justify-content: flex-start;
}
.fp-cat-grid::-webkit-scrollbar { display: none; } /* Safari and Chrome */

.fp-cat-card {
    flex: 0 0 auto; width: 66px;
    background: transparent; border: none; border-radius: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    padding: 4px; cursor: pointer; text-decoration: none; color: inherit;
    transition: 0.2s; text-align: center; box-shadow: none;
}
.fp-cat-card:hover { transform: translateY(-2px); }
.fp-cat-card img { width: 52px; height: 52px; object-fit: cover; margin-bottom: 6px; border-radius: 6px; box-shadow: 0 2px 4px rgba(0,0,0,0.08); }
.fp-cat-card span {
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}
@media(min-width: 768px) { 
    .fp-cat-grid { gap: 12px; }
    .fp-cat-card { width: 90px; }
    .fp-cat-card img { width: 64px; height: 64px; }
    .fp-cat-card span { font-size: 0.9rem; }
}

/* Foods Grid */
.fp-food-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 32px;
}
@media(min-width: 768px) { .fp-food-grid { gap: 20px; } }
@media(min-width: 992px) { .fp-food-grid { grid-template-columns: repeat(3, 1fr); } }
@media(min-width: 1200px) { .fp-food-grid { grid-template-columns: repeat(4, 1fr); } }

.fp-food-card {
    background: transparent; border-radius: 16px; overflow: hidden;
    border: none; text-decoration: none; color: inherit;
    display: flex; flex-direction: column;
}

.fp-food-img-wrapper { position: relative; width: 100%; padding-top: 75%; /* 4:3 Aspect Ratio for 2 grid */ border-radius: 16px; overflow: hidden; }
.fp-food-img-wrapper img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.fp-food-card:hover .fp-food-img-wrapper img { transform: scale(1.06); }

.fp-food-content { padding: 12px 4px 8px 4px; flex-grow: 1; display: flex; flex-direction: column; }
.fp-food-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-food-desc { display: none; }
.fp-food-footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.fp-food-price { font-weight: 800; color: var(--text-primary); font-size: 1.05rem; }
.fp-food-add { 
    background: var(--primary); color: white; padding: 4px 6px; height: auto; width: auto; 
    border-radius: 16px; display: inline-flex; justify-content: center; align-items: center; 
    border: none; cursor: pointer; font-size: 0.7rem; font-weight: 600; transition: background 0.2s;
    white-space: nowrap; flex-shrink: 0;
}
.fp-food-add:hover { background: var(--primary-hover); }

/* Hide Buy Now button on desktop */
@media(min-width: 768px) {
    .fp-food-add { display: none !important; }
}

/* Mobile Search input below header */
.fp-mobile-search {
    padding: 16px; background: var(--surface); border-bottom: 1px solid var(--border-color); position: relative;
}
@media(min-width: 768px) { .fp-mobile-search { display: none; } }
.fp-mobile-search input {
    width: 100%; padding: 12px 20px 12px 48px;
    border: 1px solid var(--border-color); border-radius: 24px;
    background: var(--bg-color); outline: none;
}
.fp-mobile-search i { position: absolute; left: 32px; top: 50%; transform: translateY(-50%); color: var(--text-secondary); }

/* Meal Details Page */
.fp-meal-hero {
    width: 100%; height: 300px; object-fit: cover; border-radius: 16px; margin-bottom: 24px;
}
@media(min-width: 768px) { .fp-meal-hero { height: 450px; } }
.fp-qty-control {
    display: flex; align-items: center; gap: 16px; background: var(--bg-color); padding: 8px 16px; border-radius: 24px; width: fit-content;
}
.fp-qty-btn { width: 32px; height: 32px; border-radius: 50%; background: #fbe6ee; color: var(--primary); border: none; font-weight: bold; font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.fp-qty-btn:hover { background: var(--primary); color: white; }
.fp-qty-val { font-weight: 700; font-size: 1.2rem; width: 30px; text-align: center; }

/* General Buttons */
.fp-btn-primary {
    background: var(--primary); color: white; border-radius: 12px; padding: 16px 24px;
    font-weight: 700; border: none; transition: 0.2s; font-size: 1.1rem; text-align: center; text-decoration: none; display: inline-block; cursor: pointer;
}
.fp-btn-primary:hover { background: var(--primary-hover); color: white; }
.fp-btn-block { width: 100%; }

/* Cart Page */
.fp-cart-item {
    display: flex; gap: 12px; padding: 12px; border: none; border-radius: 12px; margin-bottom: 12px; background: var(--surface); align-items: center; box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.fp-cart-img { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.fp-cart-info { flex-grow: 1; }
.fp-cart-price { font-weight: 800; color: var(--primary); font-size: 1.1rem; }
.fp-summary-card { background: var(--surface); border: none; box-shadow: 0 4px 16px rgba(0,0,0,0.04); border-radius: 12px; padding: 20px; }


/* Legal Content Formatting */
.legal-content h1, .legal-content h2, .legal-content h3, .legal-content h4 { margin-top: 1.5rem !important; margin-bottom: 1rem !important; font-weight: bold; font-family: inherit; }
.legal-content p { margin-bottom: 1rem; color: #6c757d; line-height: 1.6; }
