/* /delivery/assets/css/style.css */

:root {
    --default-primary-color: #FF5722; /* Cor padrão caso a do restaurante não seja definida */
}

body {
    background-color: var(--cor-fundo-pagina, #F0F2F5);
    font-family: 'Poppins', sans-serif;
    color: var(--cor-texto-principal, #333);
}

#loading-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); display: flex; align-items: center;
    justify-content: center; z-index: 9999; display: none;
}

/* --- ESTRUTURAS OCULTAS POR PADRÃO (MOBILE-FIRST) --- */
.delivery-header, .ad-column, .header-user-actions, .highlight-section {
    display: none;
}

/* --- HEADER MOBILE --- */
.mobile-header {
    display: block;
    padding: 10px 15px;
    background-color: var(--cor-fundo-header, #FFF);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.mobile-header .search-container input {
    border-radius: 8px;
    background-color: #fff;
    border: 1px solid #ddd;
    padding-left: 40px;
    height: 44px;
}
.mobile-header .search-icon {
    position: absolute; left: 15px; top: 50%;
    transform: translateY(-50%); color: #999; z-index: 2;
}

/* --- CONTEÚDO PRINCIPAL (COMUM A AMBOS) --- */
.delivery-main-content {
    padding: 15px;
    background-color: transparent;
}
.products-section { margin-bottom: 20px; }
.section-title {
    font-size: 1.5rem; font-weight: 600; margin-bottom: 1rem;
    padding-top: 10px; color: var(--cor-texto-principal);
}
.product-grid { display: grid; grid-template-columns: 1fr; gap: 15px; }
/* Garante que o menu de sugestões do Autocomplete apareça sobre o Modal da Sacola */
.ui-autocomplete {
    z-index: 2147483647 !important; /* Valor máximo para sobrepor o modal do Bootstrap */
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: 1px solid #ddd;
    background: #fff;
}
.ui-menu-item-wrapper:hover {
    background-color: var(--cor-primaria) !important;
    color: #fff !important;
    border: none !important;
}
.product-card {
    background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    display: flex; padding: 15px; cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #eee;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.product-info { flex: 1; padding-right: 15px; }
.product-name { font-size: 1rem; font-weight: 600; margin-bottom: 5px; color: var(--cor-texto-principal); }
.product-description { 
    font-size: 0.85rem; color: #6c757d; margin-bottom: 10px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; text-overflow: ellipsis; min-height: 2.5em;
}
.product-price { font-size: 1rem; font-weight: 600; color: var(--cor-primaria, var(--default-primary-color)); }
.product-image {
    width: 90px; height: 90px; object-fit: cover; border-radius: 8px;
    align-self: center; background-color: #f8f9fa;
}

/* --- FOOTER MOBILE --- */
.bottom-nav-delivery {
    display: block; position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; padding: 15px; box-shadow: 0 -2px 10px rgba(0,0,0,0.1); z-index: 1030;
}
.bottom-nav-delivery #cart-count-mobile { min-width: 22px; }

/* ------------------------------------------- */
/* --- LAYOUT PARA TELAS GRANDES (>= 992px) --- */
/* ------------------------------------------- */
@media (min-width: 992px) {
    .mobile-header, .bottom-nav-delivery {
        display: none;
    }
    .delivery-header {
        display: block;
        background-color: var(--cor-fundo-header, #FFF);
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        position: sticky; top: 0; z-index: 1020;
    }
    .header-top-info { padding: 15px 0; color: white; }
    .logo-wrapper { display: flex; align-items: center; gap: 15px; }
    .main-logo { height: 60px; border-radius: 8px; }
    .restaurant-name { font-size: 1.8rem; margin: 0; font-weight: 700; }
    .restaurant-details p { margin: 0; font-size: 0.9rem; text-align: right; }
    
    .header-actions {
        padding: 15px 0;
        background-color: #fff;
    }
    .header-actions .search-container { position: relative; }
    .header-actions .search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #999; }
    .header-actions .form-control { padding-left: 40px; }
    .category-selector { flex-basis: 300px; flex-shrink: 0; }
    .header-user-actions { display: flex; align-items: center; gap: 10px; }
    #cart-count-desktop { font-size: .7em; line-height: 1; padding: .3em .5em; }
    .form-select, .form-control { height: 44px; }

    .content-wrapper {
        display: flex; justify-content: center; gap: 20px;
        width: 100%; max-width: 1600px; margin: 20px auto;
    }
    .ad-column { display: block; flex: 0 0 220px; }
    .ad-placeholder {
        background-color: #e9ecef; border: 2px dashed #ced4da;
        height: 500px; display: flex; align-items: center;
        justify-content: center; color: #6c757d; border-radius: 8px;
        position: sticky; top: 150px;
    }
    .delivery-main-content {
        flex: 1 1 800px; max-width: 850px;
        background-color: var(--cor-fundo-header, #FFF);
        border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.08);
        padding: 20px;
    }
    
    .highlight-section {
        display: block; /* Alterado para block, o grid virá via JS se necessário */
        margin-bottom: 30px;
    }
    .highlight-item {
        border-radius: 8px; overflow: hidden;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        position: relative; color: white;
        cursor: pointer;
        display: flex;
        align-items: center;
        min-height: 200px;
        background-color: #333;
    }
    .highlight-item-content {
        display: flex;
        width: 100%;
        align-items: center;
    }
    .highlight-item img {
        width: 50%;
        height: 220px; /* Altura fixa para a imagem */
        object-fit: cover;
    }
    .highlight-item:after {
        content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
        background: linear-gradient(to right, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 70%);
        z-index: 1;
    }
    .highlight-info { 
        position: relative;
        z-index: 2;
        padding: 30px;
        width: 50%;
    }
    .highlight-info .category-tag {
        background-color: var(--cor-primaria, var(--default-primary-color));
        color: white;
        padding: 4px 10px;
        border-radius: 20px;
        font-size: 0.8rem;
        display: inline-block;
        margin-bottom: 10px;
    }
    .highlight-info h3 { font-size: 1.8rem; font-weight: bold; }
    .highlight-info p { font-size: 0.9rem; margin-bottom: 15px; opacity: 0.9; }
    .highlight-info .price { font-size: 2rem; font-weight: bold; }

    .product-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}