/* =========================================
   RESET E VARIÁVEIS GERAIS
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Open Sans', sans-serif;
}

:root {
    --primary-blue: #3E4095;
    --dark-blue: #2A2C6B;
    --nav-bg: #322d9b;
    --nav-hover: #29d5e2;
    --bg-gray: #f4f4f4;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    background-color: var(--bg-gray);
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
}

/* =========================================
   HEADER E NAVEGAÇÃO (Comum a todas as páginas)
   ========================================= */
.top-bar {
    background-color: #fff;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.top-bar .container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.logo img {
    max-height: 60px;
    width: auto;
}

.mobile-menu-icon {
    display: none; /* Escondido no Desktop */
    position: absolute;
    left: 15px;
    font-size: 24px;
    color: var(--primary-blue);
    cursor: pointer;
}

.nav-bar {
    background-color: var(--nav-bg);
    color: white;
    position: relative;
    z-index: 1000;
}

.nav-list {
    display: flex;
    justify-content: space-between;
    padding: 0;
    gap: 0;
    width: 100%;
}

.nav-bar .menu-item {
    position: relative;
    padding: 20px 10px; 
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.3s;
    flex-grow: 1;
    text-align: center;
    white-space: nowrap;
}

.nav-bar .menu-item:hover {
    background-color: var(--nav-hover);
}

/* Submenu Dropdown */
.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--nav-bg);
    min-width: 220px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1001;
    padding: 0;
    text-align: left;
}

@media (min-width: 993px) {
    .menu-item:hover .dropdown {
        display: block;
    }
}

.dropdown li {
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.dropdown li a {
    display: block;
    padding: 12px 20px;
    color: white;
    font-size: 12px;
    text-transform: none;
    font-weight: 600;
    transition: background 0.2s;
    text-align: left;
}

.dropdown li a:hover {
    background-color: var(--nav-hover);
    color: white;
}

/* =========================================
   ELEMENTOS DE PÁGINA (Titulos, Banner)
   ========================================= */
.hero-banner {
    width: 100%;
    height: 475px; 
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    z-index: 1;
    background-color: #fff;
}

.hero-banner img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.hero-banner img.active { opacity: 1; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
    margin-top: 15px;
}

.category-header {
    padding: 30px 0 10px 0; /* Específico para paginas de categoria */
}

.breadcrumb {
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
}
.breadcrumb a:hover { color: var(--primary-blue); }

.section-title {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-title h2 {
    font-size: 24px;
    color: var(--primary-blue);
    font-weight: 800;
    margin-top: 5px;
}

/* =========================================
   CARDS DE PRODUTO (Design Unificado)
   ========================================= */
.product-card {
    background: white;
    padding: 20px;
    text-align: center;
    border-radius: 4px;
    transition: box-shadow 0.3s;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer; /* Indica que o card é um link */
    text-decoration: none; /* Remove sublinhado se usar tag <a> */
    height: 100%; /* Garante preenchimento no grid/carrossel */
}

.product-card:hover { 
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); 
    border-color: #ccc;
}

.product-image {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.product-image img { max-width: 100%; max-height: 100%; object-fit: contain; }

.product-name {
    font-size: 16px;      /* Aumentado para melhor visibilidade */
    font-weight: 700;     /* Negrito para destacar */
    color: #333;          /* Cor um pouco mais escura para contraste */
    margin-bottom: 15px;
    line-height: 1.4;
    
    /* REMOVIDO: travas de altura e overflow para mostrar nome completo */
    height: auto;         
    overflow: visible;    
    display: block;       
}

.product-price {
    font-size: 18px;
    color: var(--primary-blue);
    font-weight: 800;
    margin-top: 10px;
    display: block;
}

.product-old-price {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
    margin-bottom: -5px;
    display: block;
}

/* =========================================
   HOME: CARROSSEL (Scroll Horizontal)
   ========================================= */
.nav-arrows {
    display: flex;
    gap: 5px;
}

.nav-arrows button {
    background: #fff;
    border: 1px solid #ccc;
    color: var(--primary-blue);
    width: 35px;
    height: 35px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.nav-arrows button:hover { background: #eee; }

.carousel-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.carousel-container::-webkit-scrollbar { display: none; }

.carousel-track {
    display: flex; 
    gap: 20px;
    width: max-content;
    padding-bottom: 10px;
}

/* Na Home, o card tem largura fixa dentro do carrossel */
.carousel-track .product-card {
    width: 270px; 
}

/* =========================================
   CATEGORIA: GRID (Papelaria, etc)
   ========================================= */
.products-grid {
    display: grid;
    /* Grid responsivo automático */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

/* Paginação (Para páginas de categoria) */
.pagination-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 50px;
    margin-bottom: 20px;
}

.page-btn {
    width: 45px;
    height: 45px;
    border: 1px solid #ddd;
    background-color: white;
    color: var(--primary-blue);
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 4px;
}

.page-btn:hover, .page-btn.active {
    background-color: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.page-content {
    display: block; 
    animation: fadeIn 0.5s ease-in;
}

.page-content.hidden { display: none; }
.hidden { display: none !important; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* =========================================
   FOOTER (Comum a todas as páginas)
   ========================================= */
footer {
    background-color: #f0f0f0;
    padding: 40px 0;
    font-size: 13px;
    color: #555;
    margin-top: 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.footer-col h4 {
    color: var(--primary-blue);
    margin-bottom: 15px;
    text-transform: uppercase;
    font-size: 14px;
}

.footer-col ul li { margin-bottom: 8px; }
.contact-item { display: flex; gap: 10px; margin-bottom: 10px; align-items: center; }
.contact-icon { color: var(--primary-blue); font-size: 18px; min-width: 20px; }
.payment-icons i { font-size: 24px; margin-right: 8px; margin-bottom: 8px; color: #555; }

.social-media {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    flex-wrap: wrap;
}

.social-media i {
    font-size: 24px;
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
    border-radius: 50%;
    padding: 10px;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   RESPONSIVIDADE (MEDIA QUERIES GERAIS)
   ========================================= */

/* Tablets e Telas Menores que 992px */
@media (max-width: 992px) {
    .mobile-menu-icon { display: block; }
    .nav-bar { background-color: var(--nav-bg); }
    
    .nav-list {
        display: none; 
        flex-direction: column;
        width: 100%;
    }
    .nav-list.active { display: flex; }

    .nav-bar .menu-item {
        text-align: left;
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        width: 100%;
    }

    .dropdown {
        position: static;
        display: none;
        box-shadow: none;
        width: 100%;
        background-color: rgba(0,0,0,0.1);
        padding-left: 20px;
    }
    .menu-item.show-submenu .dropdown { display: block; }

    .hero-banner {
        height: auto;
        aspect-ratio: 2.5/1;
    }
    .hero-banner img {
        position: relative;
        display: none;
        width: 100%;
        height: auto;
    }
    .hero-banner img.active { display: block; }
    
    /* Ajuste do grid da pagina de categoria */
    .products-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Telas de Tablet e Celular Grande (max 768px) */
@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }

    /* Ajuste para carrossel da Home */
    .carousel-track .product-card { width: 200px; }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .nav-arrows { align-self: flex-end; }
    
    /* Ajuste do grid da pagina de categoria */
    .products-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Celulares Pequenos (max 480px) */
@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .contact-item { justify-content: center; }

    /* Ajuste para carrossel da Home */
    .carousel-track .product-card {
        width: 160px;
        padding: 10px;
    }
    
    /* Ajuste do grid da pagina de categoria (2 COLUNAS LADO A LADO) */
    .products-grid {
        grid-template-columns: repeat(2, 1fr); 
        gap: 10px; 
    }
    /* Ajuste geral dos cards no mobile */
    .product-card { padding: 10px; }
    .product-image { height: 120px; }
    .product-name { font-size: 11px; height: 30px; }
    .product-price { font-size: 16px; }
    
    .section-title h2 { font-size: 20px; }
    .hero-banner { aspect-ratio: 2.5/1; }
}