* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --page-background: url('menu-background.png');
    --page-overlay: rgba(24, 18, 14, 0.18);
    --text-main: #2c1810;
    --text-muted: #666;
    --price-color: #5d4435;
    --surface: rgba(255, 255, 255, 0.84);
    --border-soft: #d4c4a8;
    --nav-background: #3d2817;
    --button-background: #5d4435;
    --button-hover: #7d5f47;
}

:root[data-theme="dark"] {
    --page-overlay: rgba(7, 10, 8, 0.62);
    --text-main: #f4ead7;
    --text-muted: #f1e6d2;
    --price-color: #ffe08a;
    --surface: rgba(32, 38, 31, 0.94);
    --border-soft: #61543f;
    --nav-background: #182219;
    --button-background: #354637;
    --button-hover: #49604a;
}

body {
    font-family: 'Georgia', serif;
    background: linear-gradient(var(--page-overlay), var(--page-overlay)), var(--page-background);
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.header {
    background: linear-gradient(to bottom, rgba(45, 80, 22, 0.95), rgba(26, 61, 10, 0.98));
    color: #f4e4c1;
    padding: 1.5rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header h1 {
    font-size: 2rem;
    font-weight: normal;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.header p {
    font-size: 0.9rem;
    opacity: 0.9;
    font-style: italic;
    margin-top: 0.5rem;
}

.theme-toolbar {
    display: flex;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem 1rem;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.8rem;
    border: 1px solid rgba(244, 228, 193, 0.5);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.18);
    color: #f4e4c1;
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
    background: rgba(0, 0, 0, 0.35);
    transform: translateY(-1px);
}

.theme-icon {
    font-size: 1rem;
    line-height: 1;
}

.header-logo {
    height: 70px;
}

.platform-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 0.7rem 1rem;
    background: #c9a961;
    color: #2c1810;
    font-size: 0.9rem;
    text-align: center;
}

.platform-banner a {
    color: #2c1810;
    font-weight: bold;
    text-decoration: underline;
}

.nav-tabs {
    display: flex;
    overflow-x: auto;
    background: var(--nav-background);
    padding: 0.5rem;
    gap: 0.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 100px;
    z-index: 99;
}

.nav-tabs::-webkit-scrollbar {
    height: 4px;
}

.nav-tabs::-webkit-scrollbar-thumb {
    background: #8b7355;
    border-radius: 2px;
}

.nav-tab {
    padding: 0.7rem 1.2rem;
    background: var(--button-background);
    color: #f4e4c1;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.9rem;
    transition: all 0.3s;
    font-family: 'Georgia', serif;
}

.nav-tab:hover {
    background: var(--button-hover);
    transform: translateY(-2px);
}

.nav-tab.active {
    background: #c9a961;
    color: #2c1810;
    font-weight: bold;
}

.menu-tools {
    display: flex;
    align-items: end;
    gap: 0.6rem;
    max-width: 600px;
    margin: 1rem auto 0;
    padding: 0 1rem;
}

.search-box {
    flex: 1;
    color: #f4e4c1;
    font-size: 0.8rem;
    font-style: italic;
}

.search-box span {
    display: block;
    margin-bottom: 0.35rem;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 2px solid #c9a961;
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-main);
    font: inherit;
    font-style: normal;
}

.clear-search {
    padding: 0.75rem 0.9rem;
    border: 0;
    border-radius: 8px;
    background: var(--button-background);
    color: #f4e4c1;
    cursor: pointer;
    font: inherit;
}

.clear-search:hover {
    background: var(--button-hover);
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
}

.category {
    display: none;
    animation: fadeIn 0.5s;
    padding: 1rem;
    border-radius: 14px;
    background: linear-gradient(var(--page-overlay), var(--page-overlay)), var(--page-background);
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
}

.category.active {
    display: block;
}

.category.search-match {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.category-header {
    position: relative;
    height: 150px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.category-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
}

.category-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(44, 24, 16, 0.95), transparent);
    color: #f4e4c1;
    padding: 1.5rem 1rem 1rem;
    font-size: 1.8rem;
    font-weight: normal;
    letter-spacing: 1px;
}

.section {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 2px solid #c9a961;
}

.section-title {
    color: var(--text-main);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #c9a961;
}

.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px dashed var(--border-soft);
}

.menu-item:last-child {
    border-bottom: none;
}

.item-name {
    flex: 1;
    font-size: 1rem;
    color: var(--text-main);
}

.item-price {
    font-weight: bold;
    color: var(--price-color);
    font-size: 1.1rem;
    margin-left: 1rem;
}

.item-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.2rem;
}

:root[data-theme="dark"] .item-price {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: #f4e4c1;
    font-size: 0.9rem;
}

.footer a {
    display: inline-block;
    margin-top: 0.4rem;
    color: #f4e4c1;
    text-decoration: underline;
}

.footer a:hover {
    color: #c9a961;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 0.7rem;
    margin-top: 0.8rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #c9a961;
    color: #2c1810 !important;
    font-family: Arial, sans-serif;
    font-size: 1.25rem;
    font-weight: bold;
    text-decoration: none !important;
    transition: transform 0.2s ease, background 0.2s ease;
}

.social-link:hover {
    background: #e0c27b;
    color: #2c1810 !important;
    transform: translateY(-2px);
}

/* Images de catégories */
.cat-img-cafe { background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1509042239860-f550ce710b93?w=800'); background-size: cover; background-position: center; }
.cat-img-petit-dej { background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1533777324565-a040eb52facd?w=800'); background-size: cover; background-position: center; }
.cat-img-boissons { background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1546173159-315724a31696?w=800'); background-size: cover; background-position: center; }
.cat-img-snacks { background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1509440159596-0249088772ff?w=800'); background-size: cover; background-position: center; }
.cat-img-plats { background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1504674900247-0877df9cc836?w=800'); background-size: cover; background-position: center; }
.cat-img-pizza { background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1513104890138-7c749659a591?w=800'); background-size: cover; background-position: center; }
.cat-img-desserts { background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1551024506-0bccd828d307?w=800'); background-size: cover; background-position: center; }

@media (max-width: 480px) {
    body,
    .category {
        background-attachment: scroll;
        background-position: center top;
    }

    .platform-banner {
        flex-direction: column;
        gap: 0.15rem;
    }

    .menu-tools {
        align-items: stretch;
    }

    .clear-search {
        padding-inline: 0.7rem;
    }
}
