/* --- Variáveis Globais e Reset (Nova Paleta de Cores) --- */
:root {
    --primary-color: #DD8A38; /* Laranja extraído do logo */
    --dark-text: #FDFBF5;     /* Bege claro para texto principal */
    --light-text: #A9A9A9;    /* Cinza claro para texto secundário */
    --background-color: #2C2A2A; /* Fundo carvão/madeira escura */
    --surface-color: #3E3B3B;  /* Cor de superfície para cards */
    --border-color: #504D4D;   /* Cor da borda sutil */
    --font-family: 'Roboto', sans-serif;
    --box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--dark-text);
}

/* --- Splash Screen --- */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
    opacity: 1;
    visibility: visible;
}

#splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-logo {
    max-width: 250px;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* --- App Container --- */
#app-container {
    opacity: 1;
    transition: opacity 0.5s ease-in;
}

#app-container.hidden {
    opacity: 0;
}

main.container {
    padding: 0 16px 40px;
}

/* --- Header e Carrossel --- */
.main-header {
    background-color: transparent;
    padding-bottom: 20px;
}

.header-content {
    display: flex;
    justify-content: center;
    padding: 24px 0;
}

.restaurant-logo {
    max-width: 200px;
    height: auto;
}

.carousel-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    cursor: grab;
}

.carousel-wrapper {
    display: flex;
}

.carousel-wrapper img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    flex-shrink: 0;
    padding: 0 16px;
    border-radius: 24px;
}

/* --- Busca e Navegação de Categorias --- */
.search-container {
    display: flex;
    align-items: center;
    background-color: var(--surface-color);
    padding: 10px 16px;
    border-radius: 25px;
    margin: 20px 0;
    border: 1px solid var(--border-color);
}

.search-container svg {
    color: var(--light-text);
    margin-right: 10px;
}

#search-input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 1rem;
    background: transparent;
    color: var(--dark-text);
}
#search-input::placeholder {
    color: var(--light-text);
}

.category-nav {
    position: sticky;
    top: 0;
    background-color: var(--background-color);
    z-index: 10;
    padding: 10px 0;
    overflow-x: auto;
    white-space: nowrap;
    -ms-overflow-style: none;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border-color);
}
.category-nav::-webkit-scrollbar {
    display: none;
}

.category-nav a {
    display: inline-block;
    padding: 8px 20px;
    margin: 0 4px;
    color: var(--light-text);
    background-color: var(--surface-color);
    text-decoration: none;
    font-weight: 500;
    border-radius: 20px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.category-nav a.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    font-weight: 700;
}

/* --- Lista do Cardápio --- */
#menu-list {
    margin-top: 20px;
}

.category-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 32px 0 16px;
    scroll-margin-top: 80px; 
    color: var(--primary-color);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--surface-color);
}

.menu-items-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.menu-item-card {
    display: flex;
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
    border: 1px solid var(--border-color);
}
.menu-item-card:hover {
    transform: translateY(-4px);
}

@keyframes glowing-border {
    0% { box-shadow: 0 0 4px rgba(221, 138, 56, 0.4), var(--box-shadow); }
    50% { box-shadow: 0 0 16px rgba(221, 138, 56, 0.8), var(--box-shadow); }
    100% { box-shadow: 0 0 4px rgba(221, 138, 56, 0.4), var(--box-shadow); }
}

.menu-item-card.highlighted {
    animation: glowing-border 2.5s infinite ease-in-out;
}

.item-photo {
    width: 100px;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
}

.item-details {
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.item-name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--dark-text);
}

.item-description {
    font-size: 0.85rem;
    color: var(--light-text);
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 8px;
}

.highlight-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: var(--primary-color);
    color: #fff;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 2;
}

.unavailable-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(44, 42, 42, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-text);
    font-weight: 700;
    backdrop-filter: blur(2px);
}

/* --- BottomSheet Modal --- */
.bottom-sheet {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100;
    display: flex;
    align-items: flex-end;
    visibility: hidden;
}

.bottom-sheet.show {
    visibility: visible;
}

.bottom-sheet-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.bottom-sheet.show .bottom-sheet-overlay {
    opacity: 1;
}

.bottom-sheet-content {
    position: relative;
    width: 100%;
    background-color: var(--surface-color);
    border-radius: 20px 20px 0 0;
    padding: 16px;
    padding-top: 24px;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
    border-top: 1px solid var(--border-color);
}
.bottom-sheet.show .bottom-sheet-content {
    transform: translateY(0);
}

.bottom-sheet-handle {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background-color: var(--border-color);
    border-radius: 2px;
}

/* --- AJUSTE: Estilos para o Carrossel do Modal --- */
.sheet-carousel-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
}

.sheet-carousel-wrapper {
    display: flex;
    transition: transform 0.4s ease-in-out;
}

.sheet-item-photo {
    width: 100%;
    height: 200px;
    object-fit: cover;
    flex-shrink: 0;
}
.sheet-item-photo.single {
    border-radius: var(--border-radius);
}

.sheet-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.sheet-carousel-nav:hover {
    background-color: rgba(0, 0, 0, 0.7);
}
.sheet-carousel-nav.prev {
    left: 10px;
}
.sheet-carousel-nav.next {
    right: 10px;
}
/* --- Fim dos estilos do carrossel do modal --- */

.sheet-item-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.sheet-item-description {
    font-size: 1rem;
    color: var(--light-text);
    margin-bottom: 16px;
    line-height: 1.5;
}

.sheet-item-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: right;
}

/* --- Loader --- */
.loader-container {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}
.loader {
    width: 48px;
    height: 48px;
    border: 5px solid var(--surface-color);
    border-bottom-color: var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    animation: rotation 1s linear infinite;
}
@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Media Queries para Telas Maiores --- */
@media (min-width: 768px) {
    main.container {
        max-width: 800px;
        margin: 0 auto;
        padding: 0 0 40px;
    }
    .carousel-wrapper img {
        height: 350px;
    }
    .menu-items-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bottom-sheet-content {
        max-width: 600px;
        margin: 0 auto;
        border-radius: 20px;
    }
    .sheet-item-photo {
        height: 300px;
    }
}
