/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Título e descrição de páginas SIS (perfil, login, cadastro) – mesmo estilo da página Favoritos */
.sis-page-header {
    text-align: center;
    margin-bottom: 2rem;
}
.sis-page-header h1 {
    color: #1e3a5f;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}
.sis-page-header h1 i {
    margin-right: 0.35rem;
}
.sis-page-header p {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Otimizações de performance */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Lazy loading para imagens */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Header da loja - fundo branco, sem degradê. Alinhado com o conteúdo da página. */
.header {
    background: #ffffff;
    color: #1a1a1a;
    padding: 1rem 0 0 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.header-content {
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    gap: 0;
}

/* Espaçador: empurra Documentação e Área do Cliente para a direita (próximo aos ícones) */
.header-spacer {
    flex: 1;
    min-width: 1rem;
}

.header-links {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

/* Blocos Documentação e Área do Cliente no header */
.header-link-block {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: #1e3a5f;
    padding: 0.25rem 0;
    transition: opacity 0.2s ease;
}

.header-link-block:hover {
    opacity: 0.85;
}

.header-link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-link-icon i {
    font-size: 1.25rem;
    color: #1e3a5f;
}

.header-link-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.header-link-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
}

.header-link-sub {
    font-size: 0.7rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: #1a1a1a;
    transition: transform 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-image {
    max-width: 250px;
    height: auto;
    display: block;
}

.cart-icon-header {
    position: relative;
    color: white;
    text-decoration: none;
    font-size: 1.3rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.cart-icon-header:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.menu-toggle {
    background: none;
    border: none;
    color: #1e3a5f;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    touch-action: manipulation;
}

.menu-toggle:hover,
.menu-toggle:focus {
    background: rgba(30, 58, 95, 0.08);
    transform: scale(1.05);
    color: #152a47;
}

/* Menu lateral (drawer) */
.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 20px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    z-index: 1001;
    overflow-y: auto;
    will-change: transform;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    background: #1e3a5f;
    color: #ffffff;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: bold;
}

.close-sidebar {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    touch-action: manipulation;
}

.close-sidebar:hover,
.close-sidebar:focus {
    background: rgba(255,255,255,0.15);
    transform: scale(1.05);
}

.sidebar-menu {
    padding: 1rem 0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    touch-action: manipulation;
}

.menu-item:hover,
.menu-item:focus {
    background: #f8f9fa;
    border-left-color: #667eea;
    transform: translateX(5px);
}

.menu-item .icon {
    margin-right: 1rem;
    font-size: 1.1rem;
    color: #1e3a5f;
    width: 20px;
    text-align: center;
}

.menu-item.active {
    background: rgba(30, 58, 95, 0.1);
    border-left-color: #1e3a5f;
    font-weight: 600;
    color: #152a47;
}

.menu-item.sidebar-item-logout .icon {
    color: #dc2626;
}

.menu-item.sidebar-item-logout:hover {
    border-left-color: #dc2626;
}

.sidebar-menu-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: 0.5rem 1.5rem;
}

/* No desktop: Home/Sobre/Contato só na barra do header, não no sidebar */
.sidebar-main-nav-only-mobile {
    display: none;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Container principal */
.main-container {
    /* margin-top ajustado via JS com base na altura real do header (logo + menu) */
    margin-top: 0;
    padding: 1rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    min-height: calc(100vh - 80px);
}

/* Títulos e subtítulos de página (Sobre, Contato, etc.) – padrão index */
.hero-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 0.5rem;
}
.hero-subtitle {
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.5;
}
.about-section h2,
.about-card h2 {
    font-size: 1.45rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 0.5rem;
}
.about-section .about-item h3,
.about-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.4rem;
}
.about-section p,
.about-card p,
.about-item p {
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.5;
}
.contact-section h2,
.contact-card h2 {
    font-size: 1.45rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 0.5rem;
}
.contact-section .contact-card p {
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.5;
}
.contact-section {
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 0 1rem;
}
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.contact-card {
    background: #ffffff;
    border-radius: 15px;
    padding: 1.4rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.25);
}
.contact-card a.btn-contact {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    background: #22c55e;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
}
.contact-card a.btn-contact:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.35);
}

/* Filtros de categoria */
.category-filters {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
    text-align: center;
}

.category-filters h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    text-align: center;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    justify-content: center;
    align-items: center;
}

.filter-buttons::-webkit-scrollbar {
    height: 4px;
}

.filter-buttons::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.filter-buttons::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 2px;
}

.filter-btn {
    background: #f8f9fa;
    color: #333;
    padding: 0.6rem 1.2rem;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    border: 2px solid transparent;
    touch-action: manipulation;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

.filter-btn:hover,
.filter-btn:focus {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #764ba2;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

/* Grid de produtos */
.products-section {
    margin-bottom: 2rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.product-card {
    /* Remover width fixa, deixar o grid controlar */
    max-width: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    will-change: transform;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

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

/* Container fixo para a imagem: mesma altura em todos os cards, imagem encaixa sem cortar */
.product-card > a:first-of-type {
    display: block;
    height: 280px;
    flex-shrink: 0;
    overflow: hidden;
    background: #f8f9fa;
    border-radius: 12px;
}

.product-card > a:first-of-type img.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 12px;
    display: block;
}

.product-image {
    width: 100%;
    height: 280px;
    object-fit: contain;
    object-position: center;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
    flex-shrink: 0;
}

.product-card:hover .product-image {
    transform: scale(1.02);
}

.product-image.no-image {
    height: 280px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 3rem;
    flex-shrink: 0;
    border-radius: 12px;
}

.product-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: #28a745;
    margin-bottom: 1rem;
}

/* Amarelo estilo logo, um pouco mais escuro para contraste com texto branco */
.btn-buy {
    width: 100%;
    background: #c99a0e;
    color: white;
    padding: 0.8rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
    touch-action: manipulation;
    margin-top: auto;
}

.btn-buy:hover,
.btn-buy:focus {
    background: #b8860b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(184, 134, 11, 0.35);
    color: white;
}

/* Estado vazio */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.empty-state .icon {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.empty-state p {
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Utilitários */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsividade para dispositivos móveis */
@media (max-width: 768px) {
    .header {
        padding: 0.8rem;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .main-container {
        /* margin-top também será ajustado via JS no mobile */
        margin-top: 0;
        padding: 0.8rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .product-card {
        border-radius: 12px;
    }
    
    .product-card > a:first-of-type {
        height: 220px;
    }
    
    .product-image.no-image {
        height: 220px;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .category-filters {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .filter-buttons {
        gap: 0.3rem;
        justify-content: center;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        max-width: 100%;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        border-radius: 12px;
    }
}

/* Breakpoint para tablets */
@media (max-width: 1024px) and (min-width: 769px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .product-card > a:first-of-type {
        height: 240px;
    }
    
    .product-image.no-image {
        height: 240px;
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 0.5rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .product-card > a:first-of-type {
        height: 220px;
    }
    
    .product-image.no-image {
        height: 220px;
    }
    
    .product-info {
        padding: 0.8rem;
    }
    
    .product-name {
        font-size: 1rem;
    }
    
    .product-price {
        font-size: 1.1rem;
    }
    
    .btn-buy {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    
    .filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        border-radius: 10px;
        text-align: center;
        width: 100%;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .filter-buttons {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}

/* Otimizações para touch devices */
@media (hover: none) and (pointer: coarse) {
    .product-card:hover {
        transform: none;
        box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    }
    
    .product-card:hover .product-image {
        transform: none;
    }
    
    .btn-buy:hover,
    .filter-btn:hover,
    .menu-item:hover {
        transform: none;
    }
    
    /* Aumentar área de toque */
    .menu-toggle,
    .close-sidebar,
    .btn-buy,
    .filter-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Melhorias de acessibilidade */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    .product-card,
    .category-filters {
        background: #2d2d2d;
        color: #e0e0e0;
    }
    
    .product-name {
        color: #e0e0e0;
    }
    
    .sidebar {
        background: #2d2d2d;
    }
    
    .menu-item {
        color: #e0e0e0;
    }
    
    .menu-item:hover {
        background: #3d3d3d;
    }
    
    .category-filters h3 {
        color: #e0e0e0; /* Garante que o texto seja visível no modo escuro */
    }
    
    .category-filters h3 .fas {
        color: #e0e0e0; /* Garante que o ícone seja visível no modo escuro */
    }
}

/* Performance optimizations */
.product-card,
.sidebar,
.overlay {
    will-change: transform;
}

/* Altura da área de imagem já definida no container (.product-card > a:first-of-type) */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
button:focus,
a:focus,
input:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* Ícones à direita: favoritos, carrinho, menu - cor azul escuro (visíveis no fundo branco) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 3rem; /* espaçamento maior entre Área do Cliente e os ícones */
}

/* Forçar azul escuro nos ícones do header (evitar herança branca) */
.header .header-icon,
.header .header-icon i,
.header .menu-toggle,
.header .menu-toggle i {
    color: #1e3a5f !important;
}

.header-icon {
    position: relative;
    color: #1e3a5f;
    text-decoration: none;
    font-size: 1.3rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-icon:hover,
.header-icon:hover i {
    background: rgba(30, 58, 95, 0.1);
    transform: scale(1.05);
    color: #152a47 !important;
}

.header .menu-toggle:hover i,
.header .menu-toggle:focus i {
    color: #152a47 !important;
}

.header-icon .cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Menu principal - azul escuro, encaixotado (não ponta a ponta) */
.main-nav {
    position: static;
    margin-top: 20px;
    padding: 0 1rem;
}

.main-nav-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    background: #1e3a5f;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(30, 58, 95, 0.25);
}

.main-nav-container {
    padding: 0.4rem 1rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.main-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 3px;
    background: transparent;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-bottom: 2px solid transparent;
    transition: all 0.25s ease;
}

.main-nav-item i {
    font-size: 1rem;
    color: inherit;
}

.main-nav-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.main-nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: #facc15;
    border-bottom-color: #ffffff;
}

.main-nav-item.active i {
    color: #facc15;
}

/* Botão ATENDIMENTO no menu */
.main-nav-btn-atendimento {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    margin-left: auto;
    background: #dc2626;
    color: #ffffff !important;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border: none;
    border-radius: 4px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.main-nav-btn-atendimento i {
    font-size: 1rem;
    color: #ffffff;
}

.main-nav-btn-atendimento:hover {
    background: #b91c1c;
    color: #ffffff;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    /* No mobile: menu principal fica dentro do sidebar */
    .main-nav {
        display: none;
    }

    .sidebar-main-nav-only-mobile {
        display: block;
    }

    .main-nav-wrapper {
        border-radius: 0;
    }

    .main-nav-container {
        padding-inline: 0.7rem;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .main-nav-container::-webkit-scrollbar {
        height: 4px;
    }

    .main-nav-container::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.4);
        border-radius: 999px;
    }

    /* Header: em telas pequenas mostrar apenas os ícones (Documentação e Área do Cliente) */
    .header-link-text {
        display: none;
    }

    .header-link-block {
        padding: 0.35rem;
    }

    .header-links {
        gap: 0.5rem;
    }

    /* Garantir que favoritos, carrinho e menu sempre apareçam no mobile */
    .header-content {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        min-width: 0;
    }

    .header-spacer {
        min-width: 0;
    }

    .header-actions {
        flex-shrink: 0;
        margin-left: 0.35rem;
        gap: 0.35rem;
    }

    .header .logo-image {
        max-width: 130px;
        height: auto;
    }
}

