/**
 * Topo e Rodapé Modernos v3
 * Apostilas Domínio - Identidade Vermelho (#c01b1f) e Preto/Grafite (#18181b / #111827)
 */

button:focus {
    outline: none !important;
}

:root {
    --hdr-red: #c01b1f;
    --hdr-red-dark: #a01417;
    --hdr-red-light: #fef2f2;
    --hdr-black: #18181b;
    --hdr-dark-footer: #0f172a;
    --hdr-dark-footer-2: #1e293b;
    --hdr-gray-text: #475569;
    --hdr-gray-light: #f8fafc;
    --hdr-border: #e2e8f0;
    --hdr-border-dark: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   Barra Superior de Aviso (Announcement Bar)
   ========================================================================== */
.top-announcement-bar {
    background-color: var(--hdr-black);
    color: #cbd5e1;
    font-size: 12px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-announcement-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.top-announcement-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-announcement-badge {
    background: var(--hdr-red);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.top-announcement-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.top-announcement-right a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.top-announcement-right a:hover {
    color: #ffffff;
}

.top-announcement-right svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
}

/* ==========================================================================
   Header Principal (Logo, Busca, Conta e Carrinho)
   ========================================================================== */
.main-header-v3 {
    background: #ffffff;
    border-bottom: 1px solid var(--hdr-border);
    padding: 16px 0;
    position: relative;
    z-index: 100;
}

.main-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* Logo */
.header-logo-link {
    display: inline-block;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.header-logo-link:hover {
    opacity: 0.9;
}

.header-logo-img {
    height: 48px;
    width: auto;
    max-width: 210px;
    object-fit: contain;
}

/* Barra de Busca */
.header-search-box {
    flex-grow: 1;
    max-width: 620px;
    position: relative;
}

.search-form-v3 {
    display: flex;
    align-items: center;
    background: var(--hdr-gray-light);
    border: 2px solid var(--hdr-border);
    border-radius: 9999px;
    overflow: hidden;
    transition: all 0.25s ease;
}

.search-form-v3:focus-within {
    border-color: var(--hdr-red);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(192, 27, 31, 0.12);
}

.search-input-v3 {
    flex-grow: 1;
    border: none;
    background: transparent;
    padding: 10px 18px;
    font-size: 14px;
    color: var(--hdr-black);
    outline: none;
    font-family: inherit;
}

.search-input-v3::placeholder {
    color: #94a3b8;
}

.search-btn-v3 {
    background: var(--hdr-red);
    border: none;
    color: #ffffff;
    padding: 10px 20px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.search-btn-v3:hover {
    background: var(--hdr-red-dark);
}

.search-btn-v3 svg {
    width: 17px;
    height: 17px;
    fill: #ffffff;
}

/* Ações do Usuário e Carrinho */
.header-actions-group {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.header-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    color: var(--hdr-black);
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.header-action-btn:hover {
    background-color: var(--hdr-gray-light);
    color: var(--hdr-red);
}

.header-action-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--hdr-gray-light);
    border: 1px solid var(--hdr-border);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
}

.header-action-btn:hover .header-action-icon {
    background: var(--hdr-red-light);
    border-color: #fecaca;
}

.header-action-icon svg {
    width: 19px;
    height: 19px;
    fill: var(--hdr-black);
    transition: fill 0.2s ease;
}

.header-action-btn:hover .header-action-icon svg {
    fill: var(--hdr-red);
}

.header-action-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.header-action-sub {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

.header-action-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--hdr-black);
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badge do Carrinho */
.header-cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--hdr-red);
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9999px;
    padding: 0 4px;
}

/* ==========================================================================
   Barra de Navegação / Categorias (Desktop)
   ========================================================================== */
.main-navbar-v3 {
    background: linear-gradient(180deg, #c01b1f 0%, #b31418 100%);
    box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 999;
    overflow: visible !important;
}

.main-navbar-v3 .container {
    overflow: visible !important;
    position: relative;
}

.nav-links-list-v3 {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: visible !important;
}

.nav-link-item-v3 {
    position: relative;
    white-space: nowrap;
}

.nav-link-anchor-v3 {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 13px 16px;
    color: #ffffff !important;
    font-size: 13px;
    text-decoration: none !important;
    transition: background-color 0.2s ease;
}

.nav-link-anchor-v3:hover,
.nav-link-item-v3.active .nav-link-anchor-v3 {
    background-color: rgba(0, 0, 0, 0.18);
}

.nav-link-anchor-v3 svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
    opacity: 0.95;
}

.nav-link-dropdown-toggle svg.arrow-icon {
    width: 10px;
    height: 10px;
    margin-left: 3px;
    transition: transform 0.2s ease;
}

.nav-link-item-v3:hover .nav-link-dropdown-toggle svg.arrow-icon {
    transform: rotate(180deg);
}

/* Dropdown Menu Flutuante Desktop */
.nav-dropdown-menu-v3 {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 230px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--hdr-border);
    border-top: 3px solid var(--hdr-red);
    padding: 8px 0;
    z-index: 99999 !important;
}

.nav-link-item-v3:hover .nav-dropdown-menu-v3 {
    display: block;
    animation: fadeInDownMenu 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInDownMenu {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.nav-dropdown-menu-v3 a {
    display: block;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--hdr-black) !important;
    text-decoration: none !important;
    transition: all 0.15s ease;
}

.nav-dropdown-menu-v3 a:hover {
    background-color: var(--hdr-red-light);
    color: var(--hdr-red) !important;
    padding-left: 22px;
}

/* Dropdown Flutuante de Estados (Desktop) */
.nav-dropdown-estados {
    min-width: 380px;
    padding: 16px;
    border-radius: 10px;
}

.estados-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--hdr-border);
}

.estados-dropdown-header span {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--hdr-black);
    letter-spacing: 0.5px;
}

.estados-grid-v3 {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.estados-grid-v3 a {
    text-align: center;
    padding: 8px 4px !important;
    border-radius: 6px;
    background: #f8fafc;
    font-size: 13px;
    color: #334155 !important;
    border: 1px solid var(--hdr-border);
    transition: all 0.2s ease;
}

.estados-grid-v3 a:hover {
    background: var(--hdr-red) !important;
    color: #ffffff !important;
    border-color: var(--hdr-red);
    transform: translateY(-2px);
    padding-left: 4px !important;
}

/* Accordion de Estados no Menu Mobile (Drawer) */
.mobile-estados-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
}

.mobile-estados-toggle svg.arrow-mob {
    width: 12px;
    height: 12px;
    transition: transform 0.25s ease;
}

.mobile-estados-item.open .mobile-estados-toggle svg.arrow-mob {
    transform: rotate(180deg);
}

.mobile-estados-content {
    display: none;
    background: #f8fafc;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.mobile-estados-item.open .mobile-estados-content {
    display: block;
}

.mobile-estados-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.mobile-drawer-body .mobile-estados-grid a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 8px 4px !important;
    border-radius: 6px;
    background: #ffffff !important;
    font-size: 13px !important;
    color: #1e293b !important;
    border: 1px solid #e2e8f0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    gap: 0 !important;
    min-height: 38px;
    line-height: 1 !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.mobile-drawer-body .mobile-estados-grid a:hover,
.mobile-drawer-body .mobile-estados-grid a:active {
    background: var(--hdr-red) !important;
    color: #ffffff !important;
    border-color: var(--hdr-red) !important;
}

/* ==========================================================================
   Header Mobile & Menu Gaveta (Drawer)
   ========================================================================== */
.mobile-header-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #ffffff;
    border-bottom: 1px solid var(--hdr-border);
}

.mobile-burger-btn {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-burger-btn svg {
    width: 26px;
    height: 26px;
    fill: var(--hdr-black);
}

.mobile-actions-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Gaveta Lateral (Drawer) */
.mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 82%;
    max-width: 320px;
    background: #ffffff;
    z-index: 1001;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-drawer-overlay.active .mobile-drawer {
    transform: translateX(0);
}

.mobile-drawer-header {
    padding: 18px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--hdr-border);
    background: var(--hdr-gray-light);
}

.mobile-drawer-close {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
}

.mobile-drawer-close svg {
    width: 22px;
    height: 22px;
    fill: var(--hdr-black);
}

.mobile-drawer-body {
    padding: 16px 0;
    flex-grow: 1;
}

.mobile-drawer-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-drawer-body a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--hdr-black);
    text-decoration: none;
    border-bottom: 1px solid #f1f5f9;
}

.mobile-drawer-body a:hover {
    background: var(--hdr-red-light);
    color: var(--hdr-red);
}

.mobile-drawer-body a svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ==========================================================================
   Novo Rodapé Premium (Footer v3)
   ========================================================================== */
.footer-v3 {
    background: var(--hdr-dark-footer);
    color: #94a3b8;
    font-family: inherit;
    position: relative;
    z-index: 50;
    border-top: 3px solid var(--hdr-red);
}

/* Seção Superior do Footer: 4 Pilares */
.footer-features-bar {
    background: var(--hdr-dark-footer-2);
    border-bottom: 1px solid var(--hdr-border-dark);
    padding: 30px 0;
}

.footer-feature-col {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.footer-feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(192, 27, 31, 0.15);
    border: 1px solid rgba(192, 27, 31, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.footer-feature-icon svg {
    width: 22px;
    height: 22px;
    fill: #ef4444;
}

.footer-feature-text h4 {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 2px 0;
}

.footer-feature-text p {
    color: #94a3b8;
    font-size: 12px;
    margin: 0;
    line-height: 1.35;
}

/* Conteúdo Principal do Footer */
.footer-main-content {
    padding: 50px 0 35px 0;
}

.footer-brand-desc {
    font-size: 13px;
    line-height: 1.65;
    color: #94a3b8;
    margin: 16px 0 20px 0;
}

.footer-social-links {
    display: flex;
    gap: 10px;
}

.footer-social-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--hdr-border-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.footer-social-btn:hover {
    background: var(--hdr-red);
    color: #ffffff;
    transform: translateY(-2px);
    border-color: var(--hdr-red);
}

.footer-social-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Títulos de Coluna */
.footer-col-title {
    color: #ffffff;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 36px;
    height: 2px;
    background: var(--hdr-red);
}

/* Links do Rodapé */
.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links-list li {
    margin-bottom: 10px;
}

.footer-links-list a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-links-list a:hover {
    color: #ffffff;
    padding-left: 4px;
}

/* Métodos de Pagamento e Selos no Rodapé */
.footer-payment-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.footer-badge-item {
    background: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
}

.footer-badge-item img {
    height: 20px;
    width: auto;
    object-fit: contain;
}

.footer-selos-wrapper {
    margin-top: 16px;
}

/* Barra de Copyright */
.footer-bottom-bar {
    background: #090e17;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 12px;
    color: #64748b;
}

.footer-bottom-flex {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.footer-bottom-flex a {
    color: #94a3b8;
    text-decoration: none;
}

.footer-bottom-flex a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* ==========================================================================
   Responsividade do Topo e Rodapé
   ========================================================================== */
@media (max-width: 991px) {
    .main-header-v3 {
        display: none;
    }
    .main-navbar-v3 {
        display: none;
    }
    .mobile-header-bar {
        display: flex;
    }
    .top-announcement-bar {
        display: none;
    }
    .footer-features-bar .row > div {
        margin-bottom: 12px;
    }
}
