/* ==========================================================================
   Estilos específicos das páginas do site público
   ========================================================================== */

/* Variáveis CSS */
:root {
    --primary-color: #1e3a5f;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --dark-color: #212529;
}

/* ==========================================================================
   Estilos gerais
   ========================================================================== */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* ==========================================================================
   Header e Navegação
   ========================================================================== */

.navbar-toggler {
    border: none;
    color: white;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.main-header .navbar-brand {
    color: white !important;
}

.main-header .navbar-brand:hover {
    color: #f8f9fa !important;
}

/* Campo de pesquisa no header */
.header-search {
    max-width: 600px;
    margin: 0 20px;
    flex: 1;
}

.header-search .form-control {
    border-radius: 25px 0 0 25px;
    border: none;
    padding: 8px 15px;
}

.header-search .btn {
    border-radius: 0 25px 25px 0;
    border: none;
    background: white;
    color: var(--primary-color);
    padding: 8px 15px;
}

.header-search .btn:hover {
    background: #f8f9fa;
}

/* Botão WhatsApp no header */
.header-whatsapp {
    background: #25d366;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 8px 15px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.header-whatsapp:hover {
    background: #128c7e;
    color: white;
    transform: scale(1.05);
}

/* ==========================================================================
   Sidebar de categorias
   ========================================================================== */

.categories-sidebar {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgb(0 0 0 / 30%);
}

.categories-sidebar h5 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.category-item {
    display: block;
    padding: 10px 15px;
    color: #495057;
    text-decoration: none;
    border-radius: 5px;
    margin-bottom: 5px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.category-item:hover {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
}

.category-item.active {
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.3);
}

.category-item.active:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
}

.mobile-categories {
    display: none;
}

.category-item i {
    margin-right: 10px;
    width: 20px;
}

/* ==========================================================================
   Seções principais
   ========================================================================== */

.hero-section {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    padding: 4rem 0;
}

.page-header {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    padding: 4rem 0;
}

.contact-info {
    background: var(--primary-color);
    color: white;
    padding: 2rem 0;
}

.search-section {
    background: #f8f9fa;
    padding: 2rem 0;
}

/* ==========================================================================
   Cards de produtos
   ========================================================================== */

.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
    object-position: center;
}

.price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--success-color);
}

.badge-featured {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--warning-color);
    color: #000;
}

.category-filter {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 2rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    background: #212529;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-logo {
    max-height: 80px;
}

.social-links a {
    color: white;
    font-size: 1.5rem;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color);
}

/* ==========================================================================
   Botão WhatsApp flutuante
   ========================================================================== */

.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #25d366;
    color: white;
    border-radius: 50px;
    padding: 15px 20px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    color: white;
}

/* ==========================================================================
   Estados de carregamento
   ========================================================================== */

.loading {
    text-align: center;
    padding: 3rem;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* ==========================================================================
   Modal de produtos
   ========================================================================== */

.product-modal .modal-dialog {
    max-width: 800px;
}

.product-gallery {
    position: relative;
}

.gallery-main {
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
}

.gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
}

.gallery-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.gallery-thumb.active,
.gallery-thumb:hover {
    opacity: 1;
}

/* ==========================================================================
   Barra de pesquisa mobile
   ========================================================================== */

.mobile-search-bar {
    display: none;
    background-color: #f8f9fa;
    padding: 20px 10px;
    border-bottom: 1px solid #dee2e6;
}

/* Estilo padrão da barra de pesquisa desktop */
.desktop-search-bar {
    display: block;
}

@media (max-width: 768px) {
    .desktop-search-bar {
        display: none !important;
    }
}

.mobile-search-bar .container {
    padding-left: 5px;
    padding-right: 5px;
}

.mobile-search-bar .input-group {
    width: 100%;
}

.mobile-search-bar .form-control {
    font-size: 1.2rem;
    padding: 15px 20px;
    border-radius: 8px 0 0 8px;
    flex: 1;
}

.mobile-search-bar .btn {
    font-size: 1.2rem;
    padding: 15px 25px;
    border-radius: 0 8px 8px 0;
    flex-shrink: 0;
}

/* ==========================================================================
   Campos de pesquisa
   ========================================================================== */

#produtos-search-input {
    font-size: 1.1rem;
    box-shadow: none;
    border-radius: 8px 0 0 8px;
    border: 2px solid #ced4da;
}

#produtos-search-btn {
    font-weight: bold;
    padding: 0.375rem 0.75rem;
    border-radius: 0 8px 8px 0;
    transition: all 0.3s ease;
    border: 1px solid #198754;
}

#produtos-search-btn:hover {
    transform: scale(1.05);
}

/* ==========================================================================
   Painel de detalhes do produto
   ========================================================================== */

.product-details-panel {
    position: sticky;
    top: 20px;
}

.product-details-panel .card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.product-details-panel .card-header {
    background: var(--primary-color);
    color: white;
    border-bottom: none;
}

.product-details-panel .btn-close {
    filter: invert(1);
}

#product-details-placeholder {
    position: sticky;
    top: 20px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
}

.product-detail-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.product-detail-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--success-color);
}

.product-detail-code {
    background: var(--dark-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    display: inline-block;
    margin-bottom: 10px;
}

/* ==========================================================================
   Responsividade
   ========================================================================== */

@media (max-width: 768px) {
    .mobile-search-bar {
        display: block !important;
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    
    /* Esconder a barra de pesquisa original da página principal em mobile */
    .desktop-search-bar {
        display: none !important;
    }
    
    /* Manter apenas a barra de pesquisa mobile principal, esconder a do header */
    .header-search {
        display: none !important;
    }
    
    /* Esconder a barra de pesquisa da página do produto quando estiver em mobile */
    .product-search-container {
        display: none !important;
    }
    
    /* Garantir que o container principal tenha margem adequada */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Melhorar a experiência de pesquisa mobile */
    .mobile-search-bar .form-control {
        font-size: 16px; /* Evita zoom no iOS */
        border: 2px solid #ced4da;
    }
    
    .mobile-search-bar .btn {
        border: 2px solid #198754;
    }
    
    /* Corrigir cor do menu hambúrguer quando expandido */
    .navbar-collapse {
        background-color: #0e167e !important;
        margin-top: 15px;
        padding: 20px;
        border-radius: 8px;
    }
    
    .hero-section {
        padding: 2rem 0;
    }
    
    .page-header {
        padding: 2rem 0;
    }
    
    .product-image {
        aspect-ratio: 1/1;
    }
    
    .whatsapp-float {
        bottom: 10px;
        right: 10px;
        padding: 12px 15px;
    }
    
    .header-search {
        max-width: 300px;
    }
}

@media (max-width: 772px) {
    .categories-sidebar {
        display: none;
    }
    
    .mobile-categories {
        display: block;
    }
    
    #product-details-panel,
    #product-details-placeholder {
        display: none !important;
    }
}

/* ==========================================================================
   Estilos específicos da página de intermediação
   ========================================================================== */

.process-steps .step-number {
    width: 50px;
    height: 50px;
}

.cta-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 2rem;
}