/* ============================================
   DOCBRAS - Estilos Principais
   Paleta de Cores Oficial
   ============================================ */

/* Variáveis de Cores */
:root {
    --cor-azul-escuro: #2e2c7d;
    --cor-verde-escuro: #026838;
    --cor-verde-claro: #0aa335;
    --cor-amarelo: #ffdf43;
    --cor-amarelo-suave: #fff9c4;
    --cor-verde-bg: #ebfff4;
    --cor-branco: #ffffff;
    --cor-cinza-claro: #f5f5f5;
    --cor-cinza: #757575;
    --cor-texto: #333333;
}

/* Reset e Base */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', 'Arial', sans-serif;
    background-color: var(--cor-cinza-claro);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--cor-texto);
    line-height: 1.6;
}

main {
    flex: 1;
}

/* Header - Estilo Governamental */
header {
    background: var(--cor-azul-escuro);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Mobile: header não deve ter background azul no topo */
@media only screen and (max-width: 600px) {
    /* Header completamente transparente no mobile */
    header {
        background: transparent !important;
        background-color: transparent !important;
        background-image: none !important;
    }
    
    /* Logo container com fundo #f5f5f5 sólido */
    header .logo-mobile-container,
    .logo-mobile-container,
    header > .logo-mobile-container {
        background-color: #f5f5f5 !important;
        background: #f5f5f5 !important;
        background-image: none !important;
    }
    
    /* Nav wrapper mantém azul apenas no menu */
    nav.nav-wrapper {
        background: var(--cor-azul-escuro) !important;
    }
    
    /* Garantir que elementos filhos não tenham background */
    .logo-mobile-container .brand-logo-mobile,
    .logo-mobile-container .logo-mobile {
        background-color: transparent !important;
        background: transparent !important;
    }
    
    /* Sobrescrever qualquer estilo do Materialize */
    header.blue,
    header.darken-2,
    header.blue.darken-2 {
        background: transparent !important;
        background-color: transparent !important;
    }
}

nav.nav-wrapper {
    background: var(--cor-azul-escuro) !important;
    padding: 0;
    height: auto;
    min-height: 70px;
    display: flex;
    align-items: center;
    position: relative;
    justify-content: space-between;
}

nav .container {
    display: flex;
    align-items: center;
    padding: 0 2rem;
}


.maintabs-tabs .brand-logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--cor-branco) !important;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1.5rem;
    padding-left: 2rem;
    padding-right: 0;
    flex-shrink: 0;
    height: 100% !important;
    z-index: 2;
    position: relative;
    margin-right: 0;
    margin-left: 0;
}

.brand-logo .logo-header {
    height: 80px !important;
    max-width: 300px !important;
    width: auto !important;
    object-fit: contain;
    display: block;
}

nav ul.right {
    margin: 0;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

nav .sidenav-trigger {
    position: relative;
    flex-shrink: 0;
    z-index: 10;
    color: var(--cor-branco);
    margin-left: auto;
    padding: 0 1rem;
}

nav .maintabs-tabs {
    display: flex;
    align-items: center;
    height: 100%;
    position: relative;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
    justify-content: flex-start;
}

nav .maintabs-tabs .tabs {
    pointer-events: auto;
    justify-content: center;
    flex: 1;
    display: flex;
    margin-right: 0;
    margin-left: 0;
    width: auto;
    max-width: 100%;
    min-width: 0;
}

nav ul li a {
    color: var(--cor-branco) !important;
    font-weight: 500;
    padding: 0 1rem;
    transition: background-color 0.3s;
}

nav ul li a:hover {
    background-color: rgba(255,255,255,0.1);
}

/* Tabs de Navegação - Estilo Governamental */

.maintabs-tabs {
    background-color: var(--cor-azul-escuro);
    border-top: 0 solid rgba(255,255,255,0.1);
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.maintabs-tabs .tabs {
    background-color: transparent;
    border: none;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    position: relative;
    justify-content: center;
}

.maintabs-tabs .tabs .tab {
    flex: 0 0 auto;
    min-width: 120px;
    text-align: center;
    background-color: transparent;
    border: none;
    position: relative;
}

.maintabs-tabs .tabs .tab a {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    padding: 1rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    text-transform: none;
    font-size: 0.95rem;
    white-space: nowrap;
}

.maintabs-tabs .tabs .tab a:hover {
    background-color: rgba(255,255,255,0.1);
    color: var(--cor-branco) !important;
}


.maintabs-tabs .tabs .tab a.active {
    color: var(--cor-branco) !important;
    border-bottom-color: var(--cor-verde-claro);
    background-color: rgba(255,255,255,0.05);
    font-weight: 600;
}

.maintabs-tabs .tabs .tab.tab-first a {
    padding-left: 0px;
    margin-left: 0;
}

.maintabs-tabs .tabs .tab.tab-last a {
    padding-right: 2rem;
}

.maintabs-tabs .tabs .tab a i.material-icons {
    font-size: 1.2rem;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.25rem;
}

.maintabs-tabs .tabs .tab a span {
    display: inline-block;
}

/* Indicador das tabs */
.maintabs-tabs .tabs .indicator {
    background-color: var(--cor-verde-claro) !important;
    height: 0 !important;
    bottom: 0 !important;
    z-index: 1;
}

/* Logo Mobile - Esconder no desktop */
@media only screen and (min-width: 601px) {
    .logo-mobile-container,
    header .logo-mobile-container,
    .logo-mobile-container.hide-on-med-and-up,
    header .logo-mobile-container.hide-on-med-and-up,
    div.logo-mobile-container {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* Logo Mobile - Apenas para mobile */
.logo-mobile-container {
    display: none; /* Escondido por padrão */
}

@media only screen and (max-width: 600px) {
    /* Logo Mobile - Mostrar apenas no mobile */
    header .logo-mobile-container,
    .logo-mobile-container,
    .logo-mobile-container.hide-on-med-and-up {
        background-color: #f5f5f5 !important;
        background: #f5f5f5 !important;
        padding: 1rem 0 !important;
        text-align: center;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        width: 100% !important;
        position: relative;
        z-index: 100;
        display: flex !important;
        justify-content: center;
        align-items: center;
        min-height: 80px;
        margin: 0 !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        overflow: visible !important;
    }
}

/* Forçar fundo #f5f5f5 no mobile - regra mais específica */
@media only screen and (max-width: 600px) {
    /* Todas as variações possíveis do logo container */
    header .logo-mobile-container.hide-on-med-and-up,
    .logo-mobile-container.hide-on-med-and-up,
    body > header > .logo-mobile-container,
    header > .logo-mobile-container,
    div.logo-mobile-container {
        background-color: #f5f5f5 !important;
        background: #f5f5f5 !important;
        background-image: none !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        margin: 0 auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Centralizar o link do logo */
    .logo-mobile-container .brand-logo-mobile,
    header .logo-mobile-container .brand-logo-mobile {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        text-align: center !important;
        margin: 0 auto !important;
    }
    
    /* Centralizar a imagem do logo */
    .logo-mobile-container .logo-mobile,
    header .logo-mobile-container .logo-mobile,
    .brand-logo-mobile .logo-mobile {
        display: block !important;
        margin: 0 auto !important;
        text-align: center !important;
    }
    
    /* Garantir que o header não interfira */
    header {
        background: transparent !important;
        background-color: transparent !important;
        background-image: none !important;
    }
    
    /* Garantir que o body não tenha background azul nessa área */
    body > header > .logo-mobile-container {
        background-color: #f5f5f5 !important;
        background: #f5f5f5 !important;
    }
}

.brand-logo-mobile {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    text-align: center !important;
    text-decoration: none;
    margin: 0 auto !important;
}

.logo-mobile {
    height: 60px !important;
    max-width: 200px !important;
    width: auto !important;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Responsive para tabs */
@media only screen and (max-width: 992px) {
    .maintabs-tabs {
        display: none;
    }
}

@media only screen and (max-width: 600px) {
    .maintabs-tabs .tabs .tab {
        min-width: 100px;
    }
    
    .maintabs-tabs .tabs .tab a {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .maintabs-tabs .tabs .tab a span {
        display: none;
    }
}

/* Hero Section - Estilo Governamental */
.hero-section {
    background: linear-gradient(135deg, var(--cor-azul-escuro) 0%, var(--cor-verde-escuro) 100%);
    padding: 4rem 0;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="none"/><path d="M0 50 L100 50" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></svg>');
    opacity: 0.3;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hero-section .flow-text {
    font-size: 1.3rem;
    margin-bottom: 2rem;
}

.hero-section .input-field {
    margin-top: 2rem;
    background: var(--cor-branco);
    border-radius: 4px;
    padding: 0.5rem;
}

.hero-section .input-field input {
    border: none !important;
    box-shadow: none !important;
    margin: 0;
}

.hero-section .input-field input:focus {
    border: none !important;
    box-shadow: none !important;
}

/* Cards - Estilo Governamental */
.card {
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #e0e0e0;
    background: var(--cor-branco);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: var(--cor-verde-claro);
}

.card-content {
    padding: 1.5rem;
}

.card-title {
    color: var(--cor-azul-escuro);
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title i {
    color: var(--cor-verde-escuro);
}

.card-content ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.card-content ul li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e8e8e8;
    transition: padding-left 0.3s;
}

.card-content ul li:last-child {
    border-bottom: none;
}

.card-content ul li:hover {
    padding-left: 0.5rem;
    background-color: var(--cor-verde-bg);
    margin: 0 -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.card-content ul li a {
    color: var(--cor-azul-escuro);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    display: block;
}

.card-content ul li a:hover {
    color: var(--cor-verde-escuro);
}

/* Suporte para collection items */
.card-content ul.collection {
    border: none;
    margin: 0;
}

.card-content ul.collection li.collection-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s;
}

.card-content ul.collection li.collection-item:last-child {
    border-bottom: none;
}

.card-content ul.collection li.collection-item:hover {
    background-color: var(--cor-verde-bg);
    padding-left: 1.5rem;
}

.card-content ul.collection li.collection-item a {
    color: var(--cor-azul-escuro);
    text-decoration: none;
    display: block;
    transition: all 0.3s;
}

.card-content ul.collection li.collection-item a:hover {
    color: var(--cor-verde-escuro);
}

/* Search Results */
.search-results {
    background: var(--cor-branco);
    border-radius: 4px;
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border: 1px solid #e0e0e0;
}

.search-results.active {
    display: block;
}

.search-results .collection-item {
    cursor: pointer;
    transition: background-color 0.3s;
    border-bottom: 1px solid #e8e8e8;
}

.search-results .collection-item:hover {
    background-color: var(--cor-verde-bg);
}

/* Formulários */
.input-field label {
    color: var(--cor-cinza);
}

.input-field input:focus + label,
.input-field select:focus + label {
    color: var(--cor-verde-escuro);
}

.input-field input:focus,
.input-field select:focus {
    border-bottom: 2px solid var(--cor-verde-escuro) !important;
    box-shadow: 0 1px 0 0 var(--cor-verde-escuro) !important;
}

/* Buttons - Estilo Governamental */
.btn {
    border-radius: 4px;
    text-transform: none;
    font-weight: 600;
    padding: 0 2rem;
    height: 44px;
    line-height: 44px;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--cor-verde-escuro) !important;
    color: var(--cor-branco) !important;
}

.btn-primary:hover {
    background-color: var(--cor-verde-claro) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-secondary {
    background-color: var(--cor-azul-escuro) !important;
    color: var(--cor-branco) !important;
}

.btn-secondary:hover {
    background-color: #1a1955 !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn:hover {
    transform: translateY(-2px);
}

/* Badge do Carrinho */
#cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    font-size: 12px;
    padding: 0 5px;
    background-color: var(--cor-amarelo) !important;
    color: var(--cor-azul-escuro) !important;
    font-weight: bold;
}

/* Footer - Estilo Governamental */
footer {
    margin-top: auto;
    background: var(--cor-azul-escuro);
    color: var(--cor-branco);
}

footer.page-footer {
    background-color: var(--cor-azul-escuro) !important;
    margin-top: 3rem;
    padding-top: 2rem;
}

footer .footer-copyright {
    background-color: rgba(0,0,0,0.2) !important;
    padding: 1rem 0;
}

footer a {
    color: var(--cor-branco) !important;
    transition: color 0.3s;
}

footer a:hover {
    color: var(--cor-verde-claro) !important;
}

/* Seções */
.section {
    padding: 3rem 0;
}

.section h2 {
    color: var(--cor-azul-escuro);
    font-weight: 700;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.section.grey {
    background-color: var(--cor-verde-bg) !important;
}

/* Card Panels */
.card-panel {
    background-color: var(--cor-branco);
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-panel i {
    color: var(--cor-verde-escuro);
}

/* Responsive */
@media only screen and (max-width: 600px) {
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .hero-section {
        padding: 2rem 0;
    }
    
    nav .container {
        padding: 0 1rem;
    }
    
    .brand-logo {
        font-size: 1.2rem;
    }
    
    .brand-logo img {
        height: 80px;
    }
}

/* Loading Spinner */
.spinner-wrapper {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(46, 44, 125, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.spinner-wrapper.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255,255,255,0.3);
    border-top: 5px solid var(--cor-verde-claro);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alertas */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 4px;
    margin: 1rem 0;
    border-left: 4px solid;
}

.alert-success {
    background-color: var(--cor-verde-bg);
    color: var(--cor-verde-escuro);
    border-left-color: var(--cor-verde-claro);
}

.alert-error {
    background-color: #ffebee;
    color: #c62828;
    border-left-color: #f44336;
}

.alert-info {
    background-color: #e3f2fd;
    color: var(--cor-azul-escuro);
    border-left-color: var(--cor-azul-escuro);
}

.alert-warning {
    background-color: #fff9e6;
    color: #856404;
    border-left-color: var(--cor-amarelo);
}

/* Formatos de Entrega */
.formato-option {
    padding: 1.5rem;
    margin: 0.5rem 0;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--cor-branco);
}

.formato-option:hover {
    border-color: var(--cor-verde-claro);
    background-color: var(--cor-verde-bg);
}

.formato-option.selected {
    border-color: var(--cor-verde-escuro);
    background-color: var(--cor-verde-bg);
    box-shadow: 0 2px 8px rgba(2, 104, 56, 0.2);
}

.formato-option input[type="radio"] {
    margin-right: 0.5rem;
}

.formato-option .preco {
    float: right;
    font-weight: bold;
    color: var(--cor-verde-escuro);
    font-size: 1.2rem;
}

/* Links */
a {
    color: var(--cor-verde-escuro);
    transition: color 0.3s;
}

a:hover {
    color: var(--cor-verde-claro);
}

/* Materialize Overrides */
.blue.darken-2 {
    background-color: var(--cor-azul-escuro) !important;
}

.green {
    background-color: var(--cor-verde-escuro) !important;
}

.green.lighten-4 {
    background-color: var(--cor-verde-bg) !important;
}

/* Estilo Governamental - Barra Superior */
.gov-bar {
    background: #f5f5f5;
    color: var(--cor-azul-escuro);
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.gov-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gov-bar a {
    color: var(--cor-azul-escuro);
    text-decoration: none;
}

.gov-bar a:hover {
    text-decoration: underline;
    color: var(--cor-verde-escuro);
}

/* Botão Central do Cliente */
.btn-central-cliente {
    background-color: var(--cor-azul-escuro) !important;
    color: var(--cor-branco) !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 8px;
    text-decoration: none !important;
    display: inline-block;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    white-space: nowrap;
}

.btn-central-cliente:hover {
    background-color: #1f1d5a !important;
    text-decoration: none !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transform: translateY(-1px);
}

/* Logo Placeholder */
.logo-placeholder {
    display: inline-block;
    width: 50px;
    height: 50px;
    background: var(--cor-verde-claro);
    border-radius: 4px;
    position: relative;
}

.logo-placeholder::before {
    content: 'DB';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--cor-branco);
    font-weight: bold;
    font-size: 1.2rem;
}
