/* Reset CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Variáveis CSS */
:root {
    --primary-color: #c60003;
    --secondary-color: #033393;
    --hamburger-bg: #880305;
    --white: #ffffff;
    --gray-light: #f8f9fa;
    --gray-medium: #dee2e6;
    --gray-dark: #495057;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --success-color: #28a745;
    --warning-color: #ffc107;
}

/* Estilos Globais */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--gray-dark);
    background-color: var(--gray-light);
    overflow-x: hidden;
    margin-bottom: 80px; /* Adicionado para dar espaço ao rodapé fixo */
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Cor de fundo alterada para sólida */
    background-color: #880305;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hide {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: var(--white);
}

.loading-logo {
    margin-bottom: 32px;
}

.loading-logo i {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: bounce 2s infinite;
}

.loading-logo h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.loading-text {
    font-size: 1.1rem;
    opacity: 0.9;
    animation: fadeInOut 2s ease-in-out infinite;
    margin-bottom: 24px;
}

.loading-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.loading-icons i {
    font-size: 2rem;
    animation: float 3s ease-in-out infinite;
}

.loading-icons i:nth-child(2) {
    animation-delay: 0.5s;
}

.loading-icons i:nth-child(3) {
    animation-delay: 1s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0.6; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--white);
    box-shadow: var(--shadow);
    z-index: 1000;
    height: 64px;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.back-btn {
    background-color: var(--hamburger-bg);
    color: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.back-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    flex: 1;
    margin: 0 16px;
}

/* Novo estilo para o botão de login */
.login-btn {
    background-color: var(--secondary-color);
    color: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    text-decoration: none;
}

.login-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

/* Remover contagem do carrinho */
.cart-count {
    display: none;
}

/* Carrossel de Banners */
.banner-carousel {
    position: relative;
    height: 250px;
    overflow: hidden;
    background-color: var(--gray-medium);
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: var(--white);
    padding: 40px 20px 20px;
}

.carousel-content h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.carousel-content p {
    font-size: 1rem;
    opacity: 0.9;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--white);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 2;
}

.carousel-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: 16px;
}

.next-btn {
    right: 16px;
}

.carousel-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

.dot.active,
.dot:hover {
    background-color: var(--white);
}

/* Search Section */
.search-section {
    margin-top: 0;
    padding: 16px;
    background-color: var(--white);
    box-shadow: var(--shadow);
}

.search-container {
    display: flex;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

.search-box {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--gray-light);
    border-radius: var(--border-radius);
    padding: 0 16px;
}

.search-box i {
    color: var(--gray-dark);
    margin-right: 12px;
}

.search-box input {
    flex: 1;
    border: none;
    background: none;
    padding: 12px 0;
    font-size: 1rem;
    color: var(--gray-dark);
    outline: none;
}

.search-box input::placeholder {
    color: #999;
}

.filter-btn {
    background-color: var(--secondary-color);
    color: var(--white);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    background-color: #022a7a;
    transform: scale(1.05);
}

/* Categories */
.categories-section {
    background-color: var(--white);
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-medium);
}

.categories-container {
    display: flex;
    gap: 8px;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: 1200px;
    margin: 0 auto;
}

.categories-container::-webkit-scrollbar {
    display: none;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    background-color: var(--gray-light);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    min-width: 80px;
    text-align: center;
}

.category-item:hover,
.category-item.active {
    background-color: var(--secondary-color);
    color: var(--white);
    transform: translateY(-2px);
}

.category-item i {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.category-item span {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Main Content */
.main-content {
    padding: 24px 16px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 200px);
}

/* Restaurants Grid */
.restaurants-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.restaurant-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.restaurant-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.restaurant-image {
    position: relative;
    height: 120px;
    overflow: hidden;
}

.restaurant-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.restaurant-card:hover .restaurant-image img {
    transform: scale(1.05);
}

.delivery-time {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.restaurant-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: var(--success-color);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.restaurant-info {
    padding: 16px;
}

.restaurant-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-dark);
    margin-bottom: 4px;
    line-height: 1.3;
}

.restaurant-category {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 12px;
}

.restaurant-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #888;
}

.delivery-fee {
    font-weight: 600;
    color: var(--secondary-color);
}

/* Novo estilo para a seção de anúncio de largura total */
.anuncie-section {
    padding: 24px 16px;
    max-width: 1200px;
    margin: 0 auto 24px;
}

.anuncie-card-full {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    display: block; /* Garante que o link ocupe toda a largura */
    text-decoration: none;
    color: inherit;
    animation: fadeInUp 0.6s ease forwards;
}

.anuncie-card-full:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.anuncie-image {
    height: 150px;
    position: relative;
}

.anuncie-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.anuncie-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.anuncie-overlay i {
    font-size: 2.5rem;
    color: var(--white);
}

.anuncie-content {
    padding: 24px;
}

.anuncie-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
    text-align: center; /* Centraliza apenas o título */
}

.anuncie-content p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gray-dark);
    margin-bottom: 20px;
}

.anuncie-btn {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

/* Filter Modal */
.filter-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.filter-modal.show {
    opacity: 1;
    visibility: visible;
}

.filter-content {
    background-color: var(--white);
    width: 100%;
    max-height: 70vh;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.filter-modal.show .filter-content {
    transform: translateY(0);
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--gray-medium);
}

.filter-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gray-dark);
}

.close-filter {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray-dark);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
}

.close-filter:hover {
    background-color: var(--gray-light);
}

.filter-body {
    padding: 20px;
    max-height: 50vh;
    overflow-y: auto;
}

.filter-group {
    margin-bottom: 24px;
}

.filter-group h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-dark);
    margin-bottom: 12px;
}

.filter-group label {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--gray-dark);
}

.filter-group input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    accent-color: var(--secondary-color);
}

.filter-footer {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid var(--gray-medium);
}

.clear-filters,
.apply-filters {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.clear-filters {
    background-color: var(--gray-light);
    color: var(--gray-dark);
}

.clear-filters:hover {
    background-color: var(--gray-medium);
}

.apply-filters {
    background-color: var(--secondary-color);
    color: var(--white);
}

.apply-filters:hover {
    background-color: #022a7a;
}

/* Footer styles (similar to index.php) */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--white);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    height: 80px;
}

.footer-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.footer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--secondary-color);
    transition: var(--transition);
    padding: 8px;
    border-radius: var(--border-radius);
}

.footer-item:hover,
.footer-item.active {
    color: var(--primary-color);
    background-color: var(--gray-light);
}

.footer-item i {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.footer-item span {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Animations */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-dark);
}

.empty-state i {
    font-size: 4rem;
    color: var(--gray-medium);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 1rem;
    color: #666;
}

/* Responsive Design */
@media (min-width: 480px) {
    .restaurants-grid {
        gap: 20px;
    }
    
    .restaurant-image {
        height: 140px;
    }
    
    .restaurant-info {
        padding: 20px;
    }
    
    .restaurant-info h3 {
        font-size: 1.2rem;
    }
}

@media (min-width: 768px) {
    .header-title {
        font-size: 2rem;
    }
    
    .search-section {
        padding: 20px;
    }
    
    .main-content {
        padding: 32px 24px;
    }
    
    .restaurants-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
    
    .restaurant-image {
        height: 160px;
    }
    
    .filter-modal {
        align-items: center;
        justify-content: center;
    }
    
    .filter-content {
        max-width: 500px;
        max-height: 80vh;
        border-radius: var(--border-radius);
        transform: scale(0.9);
    }
    
    .filter-modal.show .filter-content {
        transform: scale(1);
    }

    .anuncie-card-full {
        display: flex;
        align-items: center;
    }
    
    .anuncie-image {
        height: 100%;
        min-width: 30%;
    }

    .anuncie-content {
        padding: 24px;
    }
}

@media (min-width: 1024px) {
    .restaurants-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 32px;
    }
    
    .restaurant-image {
        height: 180px;
    }
    
    .main-content {
        padding: 40px 32px;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-light);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-medium);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}
