@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #5e72e4;
    --secondary-color: #f4f5f7;
    --background-color: #f6f6f6;
    --text-color: #32325d;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --card-hover-shadow: 0 7px 14px rgba(0,0,0,0.1), 0 3px 6px rgba(0,0,0,0.08);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px;
}

.search-bar input[type="text"] {
    padding: 12px 20px;
    font-size: 1rem;
    border-radius: 30px;
    border: 1px solid #dee2e6;
    width: 100%;
    max-width: 450px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.search-bar input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.25);
}

.category-section {
    margin-bottom: 50px;
}

.category-title {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--text-color);
    padding-bottom: 10px;
    margin-bottom: 30px;
    position: relative;
}

.category-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

/* --- Título da Página de Produtos --- */
.page-title-container {
    margin-bottom: 30px;
}

.page-title {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--text-color);
    padding-bottom: 10px;
    margin: 0;
    position: relative;
    display: inline-block;
}

.page-title::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 60px; height: 3px; background-color: var(--primary-color);
}

.products-grid {
    display: grid;
    /* Padrão para telas menores */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

/* Para telas maiores, força 5 colunas */
@media (min-width: 1280px) {
    .products-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.product-card {
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid #e6e6e6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 0;
    text-align: center;
    position: relative;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.product-photo-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background-color: #fff;
    padding: 6px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-photo {
    position: static;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center !important;
    transition: transform 0.3s ease;
}

.product-media {
    position: static;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center !important;
}

.product-card:hover .product-photo {
    transform: scale(1.05);
}

.product-info {
    padding: 10px 8px 8px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 4px;
}

.product-name {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    min-height: 2.2em;
    margin: 0;
    color: var(--text-color);
    text-transform: uppercase;
}

.product-name span:first-child {
    /* Limita o texto a 2 linhas com "..." */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.top-product-badge {
    width: 20px;
    height: 20px;
    animation: fire-animation 1s infinite alternate;
    cursor: help;
}

@keyframes fire-animation {
    from { transform: scale(1) translateY(0); }
    to { transform: scale(1.15) translateY(-2px); }
}

.product-brand {
    font-size: 0.58rem;
    color: #8898aa;
    margin: 2px 0 0;
}

.product-category {
    font-size: 0.58rem;
    color: #8898aa;
    margin: 2px 0 0;
}

.product-code {
    font-size: 0.58rem;
    color: #adb5bd;
    margin: 2px 0 0;
    text-align: right;
}

.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.product-image-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.product-image-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
}

.product-image-link.disabled {
    cursor: not-allowed;
}

.buy-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: calc(100% - 16px);
    padding: 10px 16px;
    background: #8c52ff;
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    align-self: center;
    margin-top: 6px;
}

.buy-button:hover {
    background: #7b48e5; /* Um tom um pouco mais escuro para o efeito hover */
}

.buy-button.disabled {
    background: #adb5bd;
    cursor: not-allowed;
}

.buy-button.disabled:hover {
    background: #adb5bd;
}

/* Estilos para produtos esgotados */
.product-card.out-of-stock .product-photo {
    opacity: 0.5;
    filter: grayscale(100%);
}

.recommended-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--primary-color);
    color: #fff;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    z-index: 3;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Estilo para o texto "ESGOTADO" sobre a foto */
.stock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    pointer-events: none; /* Impede que o texto interfira com o mouse */
}

.stock-overlay span {
    color: red;
    font-size: 1.8rem;
    font-weight: 700;
    writing-mode: vertical-rl; /* Deixa o texto na vertical */
    text-orientation: mixed;
}

.no-results {
    text-align: center;
    font-size: 1.2rem;
    color: #8898aa;
    padding: 40px 0;
}

#site-footer {
    padding: 40px 0;
    margin-top: 40px;
    background-color: #8c52ff;
    border-top: 1px solid #e9ecef;
}

.main-footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-logo-img {
    height: 40px;
    width: auto;
    opacity: 0.7;
}

.main-footer p {
    margin: 0;
    font-size: 0.9rem;
    color: #fff;
}

/* --- Paginação --- */
.pagination-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding: 6px;
    border-top: 1px solid #e9ecef;
}

.pagination-arrow {
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.2s;
}

.pagination-arrow:hover {
    background-color: #435fe0;
}

.pagination-arrow.disabled {
    background-color: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
}

.page-info {
    font-weight: 600;
    color: var(--text-color);
    text-transform: uppercase;
}


/* --- Novo Header e Navegação --- */
.site-header {
    /* Nova textura de fundo, mais visível e elegante */
    background-color: #f8f9fe; /* Cor de fundo base */
    background-image: linear-gradient(45deg, #f0f2f5 25%, transparent 25%, transparent 75%, #f0f2f5 75%, #f0f2f5), 
                      linear-gradient(-45deg, #f0f2f5 25%, transparent 25%, transparent 75%, #f0f2f5 75%, #f0f2f5);
    background-size: 20px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top-bar {
    padding: 0.25rem 0;
}

.header-top-bar > .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo a {
    text-decoration: none;
}

.logo-header-img {
    /* Ajusta a altura da imagem e mantém a proporção */
    height: 75px; 
    width: auto;
    display: block;
}
.header-search {
    flex-grow: 1;
    max-width: 500px;
}

.header-search form {
    display: flex;
    width: 100%;
}

.header-search input[type="search"] {
    width: 100%;
    border: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    border-radius: 6px 0 0 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: none;
}

.header-search input[type="search"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.2);
}

.header-search button {
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--primary-color);
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

.header-search button:hover {
    background-color: #435fe0;
}

.main-nav {
    background-color: #8c52ff;
    display: none; /* Oculta a barra antiga, usamos só a de ícones agora */
}

.main-nav .container {
    position: relative;
}

.main-nav-links { 
    display: flex; 
    gap: 1rem; 
    align-items: center; 
}

.main-nav a {
    padding: 0 0.25rem;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    line-height: 1; /* Altura da linha mínima, sem afetar o texto */
    font-size: 0.95rem; /* Tamanho da fonte restaurado */
    white-space: nowrap;
    background-color: transparent;
    border-bottom: 1px solid transparent; /* Borda mais fina */
    transition: color 0.3s ease, border-bottom-color 0.3s ease;
}

.main-nav a:hover {
    border-bottom-color: #fff;
}

.main-nav a.active {
    color: #fff;
    font-weight: 700;
    border-bottom-color: #fff;
}

.main-nav a.special-category,
.dropdown .dropbtn.special-category {
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    padding-left: 6px;
    padding-right: 6px;
}

/* Estilos para o dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    padding: 0 0.25rem;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    line-height: 1;
    font-size: 0.95rem;
    white-space: nowrap;
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    vertical-align: baseline; /* Fix alignment issue with links */
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content .nav-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    text-decoration: none;
    color: black;
    white-space: nowrap;
    box-sizing: border-box;
}

.dropdown-content .nav-item:hover {
    background-color: #f1f1f1;
}

.dropdown-content a:hover {background-color: #f1f1f1}

.dropdown-content.show {
    display: block;
}

/* --- Estilos do Menu Hambúrguer --- */
.nav-toggle {
    display: none; /* Escondido em telas grandes */
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
}

.nav-toggle-bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #fff;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

.nav-toggle-bar + .nav-toggle-bar {
    margin-top: 5px;
}

/* --- Responsividade do Menu --- */
@media (max-width: 992px) {
    .header-top-bar > .container {
        flex-direction: column;
        gap: 1rem;
    }
    .header-search {
        width: 100%;
    }
    .nav-toggle {
        display: block; /* Mostra o botão em telas menores */
    }

    .main-nav .container {
        display: block;
        padding: 0.5rem 20px;
    }

    .main-nav-links {
        display: none; /* Esconde os links por padrão */
        flex-direction: column;
        gap: 0;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #fff;
        box-shadow: 0 8px 16px rgba(0,0,0,0.1);
        z-index: 999;
        max-height: calc(100vh - 140px); /* Mantém o menu visível na tela inteira */
        overflow-y: auto; /* Permite rolar se houver muitas categorias */
        -webkit-overflow-scrolling: touch; /* Rolagem suave no iOS */
    }

    .main-nav-links.is-open {
        display: flex; /* Mostra os links quando o menu está aberto */
    }

    .main-nav a {
        padding: 1rem;
        color: var(--text-color); /* Altera a cor do texto para ser visível */
        border-radius: 0;
        border-bottom: 1px solid #f0f0f0;
    }
    .main-nav a:last-child {
        border-bottom: none;
    }
    .main-nav a:hover {
        background-color: #f8f9fa;
    }
    .main-nav a.active {
        background-color: var(--primary-color);
        color: #fff;
        font-weight: 700;
    }
}

/* --- Banner --- */
.banner-container {
    margin-top: 50px;
    width: 100%;
}

.banner-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
}

/* --- Seção de Novos Produtos --- */
.new-products-section {
    margin-top: 50px;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--text-color);
    padding-bottom: 10px;
    margin-bottom: 30px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

/* --- Category Icons --- */
.category-icons-section {
    padding: 8px 0;
    background-color: #8c52ff;
    border-bottom: none;
    overflow: hidden;
}

.category-icons-section .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    padding: 0 20px;
}

.category-icons-wrapper {
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    flex: 1;
    max-width: 100%;
    cursor: grab;
    user-select: none;
    padding: 0 10px;
    scroll-padding-left: 12px;
    scroll-padding-right: 12px;
}

.category-icons-wrapper.dragging {
    cursor: grabbing;
}

.category-icons-wrapper::-webkit-scrollbar {
    display: none;
}

.category-icons-track {
    display: flex;
    gap: 12px;
    padding: 4px 6px;
    width: max-content;
    align-items: center;
}

.category-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #e8edf6;
    transition: none;
}

.category-icon-item:hover {
    transform: none;
}

.category-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 6px;
    box-shadow: none;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #303848;
}

.category-icon-item.active .category-icon {
    box-shadow: 0 0 0 3px #fff;
    background-color: #6d5b46;
}

.category-icon img {
    width: 62%;
    height: 62%;
    object-fit: contain;
    display: block;
}

.category-icon img[src$=".svg"] {
    filter: invert(1) brightness(2);
}

.category-icon i {
    font-size: 24px;
    color: #fff;
    line-height: 1;
}

.category-icon-name {
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    color: #e8edf6;
}

.category-nav-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #0b0f18;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 6px rgba(0,0,0,0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
    font-size: 16px;
}

.category-nav-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.45);
    background-color: #111828;
}

.category-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}
