/* --- RESET E FONTES --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --orbe-roxo: #713A9A;
    --orbe-dark: #11001C;
    --bg-body: #F4F6F8;
    --cinza-borda: #E0E0E0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: #333;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Utilitários */
.text-purple {
    color: var(--orbe-roxo) !important;
}

.bg-purple {
    background-color: var(--orbe-roxo) !important;
}

/* --- HEADER --- */
.top-bar {
    background: #fff;
    font-size: 12px;
    border-bottom: 1px solid #eee;
    padding: 5px 0;
}

/* --- SELETOR DE PAÍS (Estilo Referência) --- */
.country-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.country-label {
    color: var(--orbe-roxo);
    /* Cor do texto "País:" */
    font-weight: 600;
    font-size: 13px;
}

.flags-container {
    display: flex;
    align-items: center;
    background-color: #fff;
    border: 1px solid #E0C4F0;
    /* Borda lilás suave */
    border-radius: 12px;
    /* Borda arredondada do container */
    padding: 3px;
    gap: 2px;
}

.flag-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 8px;
    /* Borda arredondada do botão interno */
    transition: all 0.3s ease;
    opacity: 0.7;
    /* Bandeiras inativas ficam um pouco apagadas */
}

.flag-btn img {
    width: 22px;
    /* Tamanho da bandeira */
    height: auto;
    display: block;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    /* Sombra leve na bandeira */
}

/* Estado ATIVO (Selecionado) */
.flag-btn.active {
    background-color: var(--orbe-roxo);
    /* Fundo Roxo */
    opacity: 1;
    box-shadow: 0 2px 5px rgba(113, 58, 154, 0.4);
}

/* Hover nas inativas */
.flag-btn:hover:not(.active) {
    background-color: #f3f0f5;
    opacity: 1;
}

.main-header {
    background: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.search-input {
    border-radius: 50px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    padding: 10px 20px;
    width: 100%;
}

.search-input:focus {
    border-color: var(--orbe-roxo);
    outline: none;
}

/* --- MEGA MENU --- */
.mega-nav-wrapper {
    position: relative;
}

.mega-nav-item {
    padding: 8px 0;
    border-bottom: 2px solid transparent;
}

.mega-nav-item:hover,
.mega-nav-item.active {
    color: var(--orbe-roxo) !important;
    border-bottom-color: var(--orbe-roxo);
}

.mega-panel {
    position: absolute;
    left: 0;
    top: 100%;
    width: 100%;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    margin-top: 8px;
    display: none;
    z-index: 1040;
    overflow: hidden;
}

.mega-panel.show {
    display: block;
}

#megaSubcats {
    padding: 8px 0;
}

.mega-subcat {
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
}

.mega-subcat:hover,
.mega-subcat.active {
    background: #f8f9fa;
    color: var(--orbe-roxo);
}

#megaSubdetail h6 {
    font-weight: 700;
}

/* --- MENU HOME DROPDOWN --- */
.home-menu-dropdown {
    position: relative;
}

.home-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 340px;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    display: none;
    z-index: 1050;
    padding: 6px 0;
}

.home-menu-dropdown:hover .home-menu-panel,
.home-menu-dropdown.open .home-menu-panel {
    display: block;
}

.home-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #333;
    font-weight: 600;
}

.home-menu-item:hover {
    background: #f8f9fa;
    color: var(--orbe-roxo);
}

.home-menu-icon {
    width: 22px;
    text-align: center;
    color: var(--orbe-roxo);
}

.home-menu-text {
    flex: 1;
}

/* --- SLIDER (FLUIDO) --- */
.hero-section {
    width: 100%;
    padding: 0;
    margin-bottom: 30px;
}

/* Fix slider images to always respect full width */
.carousel-item img {
    width: 100% !important;
    height: auto !important;
    object-fit: cover;
    /* ou contain */
    max-height: none !important;
}


/* --- CATEGORIAS (Bolinhas) --- */
.cat-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cat-circle {
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 8px;
    transition: 0.3s;
    border: 2px solid transparent;
}

.cat-item:hover .cat-circle {
    border-color: var(--orbe-roxo);
}

/* --- CARD PRODUTO --- */
.product-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
    padding: 10px;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: 0.3s;
}

.img-wrap {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 10px;
}

.img-wrap img {
    transition: transform 0.3s ease;
}

.img-main {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.prod-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    height: 36px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 5px;
}

.price-main {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--orbe-roxo);
}

.price-sec {
    font-size: 0.8rem;
    color: #999;
}

.btn-buy {
    width: 100%;
    background: var(--orbe-dark);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px;
    font-weight: 600;
    margin-top: auto;
}

/* --- FOOTER --- */
.footer-main {
    padding-top: 40px;
    background: #fff;
    margin-top: 40px;
}


/* ==========================================
   MOBILE (Telas até 768px)
   ========================================== */
@media (max-width: 768px) {

    /* Banner menor no celular */
    .carousel-item img {
        height: 180px;
    }

    /* Categorias com Scroll Horizontal */
    .cat-scroll-container {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 15px;
        padding-bottom: 10px;
    }

    .cat-item-mobile {
        min-width: 75px;
    }

    .cat-circle {
        width: 65px;
        height: 65px;
    }

    .cat-circle img {
        max-width: 35px;
    }

    /* Grid de Produtos */
    .img-wrap {
        height: 140px;
    }

    .product-card {
        padding: 8px;
    }

    .prod-title {
        font-size: 13px;
    }

    /* Desativar hover de imagem no mobile */
    .img-hover-swap {
        display: none !important;
    }
}

/* ==========================================
   DESKTOP (Telas acima de 992px)
   ========================================== */
@media (min-width: 992px) {

    /* Banner Grande */
    .carousel-item img {
        height: 450px;
    }

    /* Categorias Grid */
    .cat-circle {
        width: 110px;
        height: 110px;
    }

    .cat-circle img {
        max-width: 60px;
    }

    /* Produtos */
    .img-wrap {
        height: 220px;
    }

    .product-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }

    /* Efeito Hover Imagem (Só Desktop) */
    .img-main {
        transition: opacity 0.3s;
    }

    .img-hover-swap {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        opacity: 0;
        transition: opacity 0.3s;
        max-height: 100%;
        max-width: 100%;
    }

    .img-wrap:hover .img-main {
        transform: scale(1.05);
    }

    .img-wrap.has-hover:hover .img-main {
        opacity: 0;
        transform: none;
    }

    .img-wrap.has-hover:hover .img-hover-swap {
        opacity: 1;
    }
}

@media (max-width: 991.98px) {
    .home-menu-panel {
        display: none !important;
    }

    .mega-panel {
        display: none !important;
    }
}

/* --- ESTILO COTAÇÃO NOVO (Igual Referência) --- */
.cotacao-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cotacao-icon-box {
    background-color: #EADCF8;
    /* Lilás claro da imagem */
    color: #5B2C87;
    /* Roxo escuro */
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.cotacao-label {
    color: #4A148C;
    /* Roxo forte */
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    letter-spacing: -0.5px;
}

.cotacao-values {
    display: flex;
    gap: 15px;
    color: #555;
    font-weight: 500;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
}

.val-item {
    color: #4A148C;
    /* Mantendo o tom roxo nos números também fica elegante */
}

/* --- AJUSTES FINAIS HEADER & MOBILE --- */

/* Logo Header */
.logo-header {
    max-height: 45px;
    width: auto;
}

/* Cotação Box */
.cotacao-icon-box {
    background-color: #EADCF8;
    color: #713A9A;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- REGRAS ESPECÍFICAS PARA MOBILE ( < 768px ) --- */
@media (max-width: 768px) {

    /* 1. Logo Centralizada */
    .logo-header {
        max-height: 35px;
        /* Logo menor no mobile */
        margin: 0 auto;
        /* Centraliza */
        display: block;
    }

    /* 2. Carrinho Absoluto à Direita */
    /* Tira o carrinho do fluxo normal e cola ele na direita do header */
    .static-mobile-icons {
        position: absolute;
        top: 5px;
        right: 21px;
        width: auto;
        padding: 0;
    }

    /* 3. Ajuste da Busca */
    .main-header {
        padding-bottom: 15px;
    }

    .form-control {
        font-size: 14px;
    }

    /* 4. Top Bar Ajustes */
    .top-bar {
        font-size: 11px;
    }

    .cotacao-label {
        display: none;
    }

    /* Esconde texto "Cotação" pra caber valor */
}

/* Ícone Carrinho Branco */
.text-white {
    color: #ffffff !important;
}

/* --- AUTOCOMPLETE AJAX --- */
.search-results-container {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 1100;
    background: white;
    border-radius: 0 0 15px 15px;
    overflow: hidden;
    margin-top: 2px;
    border: 1px solid #eee;
    border-top: none;
}

/* --- MOBILE BOTTOM BAR (Barra Fixa Inferior) --- */
.mobile-bottom-nav {
    display: none;
    /* Invisível no Desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    padding: 8px 0;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #eee;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #666;
    font-size: 10px;
    text-decoration: none;
    width: 70px;
    position: relative;
}

.mobile-nav-item i {
    font-size: 20px;
    margin-bottom: 3px;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
    color: var(--orbe-roxo);
}

/* Badge do Carrinho Mobile */
#cart-badge-mobile {
    position: absolute;
    top: -2px;
    right: 15px;
    font-size: 9px;
    padding: 3px 5px;
}

/* --- MENU LATERAL (Offcanvas Custom) --- */
.offcanvas-header {
    background: var(--orbe-roxo);
    color: white;
}

.offcanvas-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
}

.offcanvas-body .nav-link {
    color: #333;
    padding: 14px 15px;
    border-bottom: 1px solid #f5f5f5;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
}

.offcanvas-body .nav-link:hover {
    background: #f9f9f9;
    color: var(--orbe-roxo);
}

/* REGRAS MOBILE ESPECÍFICAS */
@media (max-width: 768px) {

    /* Esconder Carrinho do Header no Mobile */
    .cart-dropdown-area {
        display: none !important;
    }

    /* Mostrar Barra Inferior */
    .mobile-bottom-nav {
        display: flex;
    }

    /* Padding no Body para a barra não cobrir o footer */
    body {
        padding-bottom: 0px;
    }

    #footer-copy {
        padding-bottom: 75px !important;
    }

    /* Ajuste da Busca Ajax */
    .search-results-container {
        width: 94%;
        left: 3%;
        border-radius: 10px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }
}

/* Ajuste para o ícone de busca não ficar colado */
.search-input-custom {
    padding-right: 55px !important;
    /* Espaço para o botão */
    padding-left: 25px !important;
}

/* Botão de busca posicionado corretamente */
.main-header form button[type="submit"] {
    right: 15px !important;
    /* Afasta da borda direita */
}

/* --- ÍCONE REC / LIVE PULSANTE --- */
.rec-dot {
    width: 10px;
    height: 10px;
    background-color: #ff0000;
    /* Vermelho Vivo */
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    vertical-align: middle;
    /* Animação */
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7);
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(255, 0, 0, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
    }
}

/* Remove a DIV que envolve a barra */
.skiptranslate {
    display: none !important;
}

/* Remove o iframe interno da barra */
.VIpgJd-ZVi9od-ORHb-OEVmcd {
    display: none !important;
}

/* Força o body a não ser empurrado pra baixo */
body {
    top: 0 !important;
}

.goog-te-gadget-icon {
    display: none !important;
}

/* ===========================
   CART PAGE
   =========================== */
.cart-page {
    font-family: 'Inter', sans-serif;
}

.cart-item {
    border: 1px solid #f1f1f1;
}

.cart-page .qty-group {
    max-width: 120px;
}

.cart-page .qty-group input {
    min-width: 46px;
}

.cart-summary {
    background: linear-gradient(180deg, #ffffff 0%, #f9f9fb 100%);
}

.btn-purple {
    background: var(--orbe-roxo);
    color: #fff;
    border: 1px solid var(--orbe-roxo);
}

.btn-purple:hover {
    background: #5e2d82;
    color: #fff;
}

@media (max-width: 768px) {
    .cart-page h1 {
        font-size: 1.4rem;
    }

    .cart-page .qty-group {
        max-width: 110px;
    }
}

/* ===========================
   CART PAGE
   =========================== */
.cart-page {
    font-family: 'Inter', sans-serif;
}

.cart-table .table {
    margin-bottom: 0;
}

.cart-row .cart-thumb {
    background: #f8f8f8;
}

.cart-qty-group input {
    min-width: 48px;
}

.cart-remove .btn {
    line-height: 1;
}

@media (max-width: 768px) {
    .cart-table .table-responsive {
        border: none;
    }

    .cart-table table {
        display: block;
    }

    .cart-table thead {
        display: none;
    }

    .cart-table tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .cart-row {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 10px;
        background: #fff;
        border: 1px solid #eee;
        border-radius: 12px;
        padding: 12px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
    }

    .cart-row td {
        border-top: none;
        padding: 0;
    }

    .cart-product {
        grid-column: 1 / 3;
    }

    .cart-qty,
    .cart-price,
    .cart-subtotal {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .cart-remove {
        grid-row: 1 / 2;
        grid-column: 2 / 3;
        align-self: start;
    }

    .cart-remove .btn {
        padding: 4px 6px;
    }
}