/*
 * Estilos consolidados - Achadinhos Niterói
 * Todos os estilos CSS em um único arquivo para facilitar manutenção
 */

/* Variáveis CSS */
:root {
    --color-primary: #002B5B;
    --color-secondary: #FFD700;
    --color-accent: #F39200;
    --magalu-blue: #0066FF;
    --bg-primary: #F8F9FA;
    --bg-secondary: #FFFFFF;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --orange-primary: #F15800;
    --orange-dark: #a33102;
    --orange-light: #fe5602;
}

/* Tema Escuro */
[data-theme="dark"] {
    --bg-primary: #111827;
    --bg-secondary: #1F2937;
    --text-primary: #F9FAFB;
    --text-secondary: #D1D5DB;
    --border-color: #374151;
    --orange-primary: #F15800;
    --orange-dark: #a33102;
    --orange-light: #fe5602;
}

/* Estilos específicos para tema escuro */
[data-theme="dark"] .search-container {
    background: var(--bg-secondary);
}

[data-theme="dark"] .search-input {
    background: white;
    color: var(--text-primary);
}

/* Garantir fundo branco para o input de busca específico */
[data-theme="dark"] #searchInput {
    background: white !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] #searchInput::placeholder {
    color: #9ca3af !important;
}

[data-theme="dark"] .search-input::placeholder {
    color: #9ca3af;
}

[data-theme="dark"] .product-card {
    background: white;
    border-color: transparent;
}

[data-theme="dark"] .product-card:hover {
    background: white;
    border-color: #f3f4f6;
}

[data-theme="dark"] .product-image-container {
    background: white;
}

[data-theme="dark"] .category-name {
    color: var(--text-primary);
}

[data-theme="dark"] .category-card:hover .category-name {
    color: var(--text-primary);
}

[data-theme="dark"] .product-image-main {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .product-price-section {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .product-affiliate-badge {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .product-tip-badge {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .admin-login-container {
    background: var(--bg-secondary);
}

[data-theme="dark"] .carousel-nav-btn {
    background: rgba(31, 41, 55, 0.8);
}

[data-theme="dark"] .carousel-nav-btn:hover {
    background: var(--bg-secondary);
}

/* Garantir visibilidade das setas nos botões de navegação no tema escuro */
[data-theme="dark"] .carousel-nav-btn i {
    color: #f3f4f6 !important;
}

[data-theme="dark"] .carousel-nav-btn:hover i {
    color: white !important;
}

[data-theme="dark"] .best-sellers-grid {
    background-color: rgb(31, 41, 55);
}

/* Garantir que os cards da seção Mais Vendidos mantenham aparência do modo claro no tema escuro */
[data-theme="dark"] .best-sellers-grid .group {
    background-color: #f3f4f6 !important;
}

[data-theme="dark"] .best-sellers-grid .group:hover {
    background-color: #f3f4f6 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

/* Manter textos dos cards Mais Vendidos com cores escuras para legibilidade */
[data-theme="dark"] .best-sellers-grid .group .text-gray-700,
[data-theme="dark"] .best-sellers-grid .group:hover .text-gray-700 {
    color: #374151 !important;
}

[data-theme="dark"] .best-sellers-grid .group .text-gray-900,
[data-theme="dark"] .best-sellers-grid .group:hover .text-gray-900 {
    color: #111827 !important;
}

/* Manter o container da imagem dos produtos Mais Vendidos com fundo branco */
[data-theme="dark"] .best-sellers-grid .group .bg-white {
    background-color: white !important;
}

/* Manter botão circular com estilo consistente no tema escuro */
[data-theme="dark"] .best-sellers-grid .group .bg-blue-600 {
    background-color: #2563eb !important;
}

[data-theme="dark"] .best-sellers-grid .group .bg-blue-600:hover {
    background-color: #fbbf24 !important;
}

/* Manter ícone do botão com cor branca no tema escuro */
[data-theme="dark"] .best-sellers-grid .group .bg-blue-600 i {
    color: white !important;
}

[data-theme="dark"] .best-sellers-grid .group .bg-blue-600:hover i {
    color: #2563eb !important;
}

/* Estilos para texto amarelo no tema escuro */
[data-theme="dark"] .text-yellow-400 {
    color: #fbbf24 !important;
}

/* Estilos para inputs no tema escuro - exceto campo de busca */
[data-theme="dark"] input:not(#searchInput) {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] input:not(#searchInput)::placeholder {
    color: var(--text-secondary);
}

/* Estilos para botões no tema escuro */
[data-theme="dark"] .bg-blue-600 {
    background-color: #2563eb;
}

[data-theme="dark"] .bg-blue-600:hover {
    background-color: #1d4ed8;
}

/* Estilos para cards de produtos no tema escuro - mantendo aparência do modo claro */
[data-theme="dark"] .group.bg-white {
    background-color: white !important;
}

/* Remover fundo branco no hover para não afetar ícones das categorias */
[data-theme="dark"] .group:hover {
    background-color: transparent !important;
}

/* Garantir que cards de produto mantenham fundo branco no hover */
[data-theme="dark"] .group.bg-white:hover {
    background-color: white !important;
}

/* Garantir legibilidade dos textos dentro dos cards de produto */
[data-theme="dark"] .group.bg-white .text-gray-900,
[data-theme="dark"] .group.bg-white .text-gray-700,
[data-theme="dark"] .product-card .text-gray-900,
[data-theme="dark"] .product-card .text-gray-700 {
    color: #1F2937 !important;
}

[data-theme="dark"] .group.bg-white .text-gray-600,
[data-theme="dark"] .product-card .text-gray-600 {
    color: #6B7280 !important;
}

/* Cards de produto da página categoria - texto preto no modo escuro */
[data-theme="dark"] .group.bg-white {
    background-color: white !important;
}

[data-theme="dark"] .group.bg-white .text-orange-500 {
    color: #f97316 !important;
}

[data-theme="dark"] .group.bg-white .text-red-500 {
    color: #ef4444 !important;
}

[data-theme="dark"] .group.bg-white .text-blue-600 {
    color: #2563eb !important;
}

[data-theme="dark"] .group.bg-white h3 {
    color: #111827 !important;
}

/* Título "Destaques da Semana" em branco no tema escuro */
[data-theme="dark"] .mb-12 h2.text-gray-900 {
    color: white !important;
}

/* Estilos para categorias no tema escuro */
[data-theme="dark"] .text-gray-700 {
    color: white !important;
}

[data-theme="dark"] .group:hover .text-gray-700 {
    color: white !important;
}

/* Corrigir textos dos cards de produto para manter cor escura */
[data-theme="dark"] .group.bg-white .text-gray-900,
[data-theme="dark"] .product-card .text-gray-900 {
    color: #1F2937 !important;
}

[data-theme="dark"] .group.bg-white .text-gray-700,
[data-theme="dark"] .product-card .text-gray-700 {
    color: #374151 !important;
}

/* Remover fundo branco dos ícones das categorias no tema escuro */
[data-theme="dark"] .group .bg-gradient-to-br {
    background: linear-gradient(to bottom right, var(--tw-gradient-stops)) !important;
}

/* Garantir que ícones de categoria mantenham gradientes no tema escuro */
[data-theme="dark"] .rounded-full.bg-gradient-to-br {
    background: linear-gradient(to bottom right, var(--tw-gradient-stops)) !important;
}

/* Forçar gradientes específicos das categorias no tema escuro */
[data-theme="dark"] .group .rounded-full.bg-gradient-to-br {
    background: linear-gradient(to bottom right, var(--tw-gradient-stops)) !important;
}

/* Manter o card 'Pronto para encontrar os melhores achadinhos?' com fundo branco e textos pretos no modo escuro */
[data-theme="dark"] .bg-white.rounded-xl.shadow-lg.p-12.text-center {
    background-color: white !important;
}

[data-theme="dark"] .bg-white.rounded-xl.shadow-lg.p-12.text-center h3,
[data-theme="dark"] .bg-white.rounded-xl.shadow-lg.p-12.text-center p {
    color: black !important;
}

/* Textos da seção Nossa Equipe em branco no modo escuro */
[data-theme="dark"] .text-center .text-gray-900,
[data-theme="dark"] .text-center .text-gray-600 {
    color: white !important;
}

/* Estilos para elementos de texto no tema escuro */
[data-theme="dark"] .text-black\/80 {
    color: white !important;
}

/* Subtítulo da página quem-somos em branco no modo escuro */
[data-theme="dark"] .container .text-xl.text-black\/80 {
    color: white !important;
}

/* Textos dos cards da página quem-somos em preto no modo escuro */
[data-theme="dark"] .bg-white .text-gray-900,
[data-theme="dark"] .bg-white .text-gray-700,
[data-theme="dark"] .bg-white .text-gray-600 {
    color: black !important;
}

/* Textos específicos dos cards da página quem-somos */
[data-theme="dark"] .bg-white.rounded-xl .text-gray-900,
[data-theme="dark"] .bg-white.rounded-xl .text-gray-700,
[data-theme="dark"] .bg-white.rounded-xl .text-gray-600 {
    color: black !important;
}

[data-theme="dark"] .text-gray-900 {
    color: black !important;
}

[data-theme="dark"] .text-gray-600 {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-gray-500 {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-gray-400 {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-gray-300 {
    color: var(--text-secondary) !important;
}

/* Estilos para elementos de fundo no tema escuro - exceto cards de produto */
[data-theme="dark"] .bg-gray-200 {
    background-color: var(--bg-secondary) !important;
}

/* Estilos para bordas no tema escuro */
[data-theme="dark"] .border-gray-100 {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .border-gray-200 {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .border-dashed {
    border-style: dashed !important;
}

/* Estilos Base */
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Estilo especial para página index */
body.index-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Estilo especial para página home - fundo cinza claro */
body.home-page {
    background: #f5f5f5;
}

[data-theme="dark"] body.home-page {
    background: var(--bg-primary);
}

/* Efeito Glass */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 35vh;
    background: linear-gradient(180deg, var(--orange-dark) 0%, var(--orange-light) 50%, #FFFFFF 100%);
    z-index: -1;
}

[data-theme="dark"] body::before {
    display: none;
}

/* Fontes */
.font-display { 
    font-family: 'Montserrat', sans-serif; 
}

/* Botões */
.btn-primary {
    background: var(--color-secondary);
    color: var(--color-primary);
    font-weight: 700;
    padding: .75rem 1.5rem;
    border-radius: .75rem;
    transition: all .3s;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0,43,91,.3);
}

.btn-primary:active { 
    transform: scale(.95); 
}

/* Classes Utilitárias */
.fundo-cinza { 
    background-color: #efeeee; 
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
    -moz-line-clamp: 2;
}

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 1;
    -moz-line-clamp: 1;
}

.hide-scrollbar {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.hide-scrollbar::-webkit-scrollbar { 
    display: none; 
}

/* Logo */
#logo {
    height: 80px !important;
    width: auto !important;
    max-height: 80px;
    transition: all 0.3s ease;
}

#logo.scrolled { 
    height: 60px !important; 
    max-height: 60px; 
}

/* Tema - Ícones */
.theme-icon-dark { 
    display: none; 
}

[data-theme="dark"] .theme-icon-light { 
    display: none; 
}

[data-theme="dark"] .theme-icon-dark { 
    display: block; 
}

/* Cores do Tailwind Customizadas */
.bg-white { 
    background-color: var(--bg-secondary); 
}

/* Manter gradientes dos ícones no tema escuro */
.bg-gradient-to-br {
    background-color: transparent !important;
}

[data-theme="dark"] .bg-gray-50 { 
    background-color: var(--bg-secondary); 
}

.text-gray-900 { 
    color: var(--text-primary); 
}

.text-gray-700 { 
    color: var(--text-primary); 
}

.text-gray-600 { 
    color: var(--text-secondary); 
}

.text-gray-500 { 
    color: var(--text-secondary); 
}

.text-gray-400 { 
    color: var(--text-secondary); 
}

.text-gray-300 { 
    color: var(--text-secondary); 
}

.border-gray-100 { 
    border-color: var(--border-color); 
}

.border-gray-200 { 
    border-color: var(--border-color); 
}

.border-dashed { 
    border-style: dashed; 
}

/* Sombras */
.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .product-card:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border-color: var(--border-color);
}

/* Estilos do Header */
.header-fixed {
    position: fixed;
    top: 0;
    z-index: 50;
    width: 100%;
    transition: all duration-300;
}

.header-transparent {
    background: transparent;
}

.header-scrolled {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Estilos do Footer */
.footer-main {
    background-color: #f15202ff;
    color: white;
    padding-top: 4rem;
    padding-bottom: 2rem;
}

.footer-link {
    color: white;
    transition: color 0.3s;
}

.footer-link:hover {
    color: #fbbf24;
}

/* Estilos de Produtos */
.product-card {
    background: white;
    border-radius: 1.5rem;
    padding: 1rem;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.product-card:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border-color: #f3f4f6;
}

.product-image-container {
    position: relative;
    aspect-ratio: 1;
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 1rem;
    background: white;
    padding: 1rem;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

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

.product-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 10;
    font-size: 0.625rem;
    font-weight: 900;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.badge-mercadolivre {
    background-color: #fbbf24;
    color: black;
}

.badge-oferta {
    background-color: #dc2626;
    color: white;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 900;
    color: #2563eb;
}

.product-price-original {
    font-size: 0.875rem;
    color: #ef4444;
    text-decoration: line-through;
}

.product-category {
    font-size: 0.625rem;
    font-weight: 700;
    color: #f97316;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.product-title {
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.75rem;
}

/* Estilos do Carousel */
.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
}

.carousel-slide {
    width: 100%;
    flex-shrink: 0;
    position: relative;
}

.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.carousel-nav-btn:hover {
    background: white;
}

.carousel-nav-left {
    left: 0.5rem;
}

.carousel-nav-right {
    right: 0.5rem;
}

/* Estilos das Categorias */
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    width: 6rem;
    transition: all 0.3s;
}

.category-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.category-card:hover .category-icon {
    transform: scale(1.1);
}

.category-name {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    color: #374151;
    transition: color 0.3s;
    line-height: 1.25;
}

.category-card:hover .category-name {
    color: #2563eb;
}

/* Estilos do Best Sellers */
.best-sellers-container {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.best-sellers-header {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    color: white;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.best-sellers-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
    background-color: rgb(255, 151, 12);
}

/* Estilos do Search */
.search-container {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 9999px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1.25rem;
    border: none;
    outline: none;
    color: #374151;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-btn {
    background: #2563eb;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 9999px;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #1d4ed8;
}

/* Estilos do Select de Categorias */
.category-select {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border-radius: 9999px;
    color: white;
    font-weight: 500;
    background-color: var(--orange-primary);
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 24 24\' fill=\'none\' stroke=\'white\' stroke-width=\'2\' stroke-linecap=\'round\' stroke-linejoin=\'round\'%3e%3cpolyline points=\'6,9 12,15 18,9\'%3e%3c/polyline%3e%3c/svg%3e');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    border: 2px solid transparent;
    cursor: pointer;
    appearance: none;
    transition: background 0.3s;
}

.category-select:hover {
    background-color: #dc2626;
}

/* Estilos do Produto Detalhe */
.product-detail-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 5rem;
}

.product-image-gallery {
    position: sticky;
    top: 7rem;
}

.product-image-main {
    aspect-ratio: 1;
    background: #f9fafb;
    border-radius: 2.5rem;
    overflow: hidden;
    border: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.product-zoom-image {
    transform-origin: center;
    transition: transform 0.3s ease;
    cursor: grab;
}

.product-zoom-image:active {
    cursor: grabbing;
}

.zoom-btn {
    opacity: 0.8;
    transition: all 0.3s ease;
}

.zoom-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.product-image-main:hover .zoom-btn {
    opacity: 1;
}

[data-theme="dark"] .product-image-main {
    background: white !important;
}

.product-info-section {
    margin-bottom: 2rem;
}

.product-price-section {
    background: #fff7ed;
    border-radius: 2rem;
    border: 1px solid #f3f4f6;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.product-affiliate-badge {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 1.5rem;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.product-tip-badge {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 1.5rem;
    padding: 1.5rem;
}

/* Estilos do Login Admin */
.admin-login-container {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    width: 100%;
    max-width: 28rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.admin-login-bg {
    background: linear-gradient(180deg, var(--orange-dark) 0%, var(--orange-light) 50%, #FFFFFF 100%);
}

/* Responsive */
@media (max-width: 768px) {
    .product-detail-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .best-sellers-container {
        flex-direction: column;
    }
    
    .best-sellers-grid {
        grid-template-columns: 1fr;
    }
    
    .category-card {
        width: 6rem;
    }
    
    .carousel-nav-btn {
        width: 1.5rem;
        height: 1.5rem;
    }
    
    .carousel-nav-btn i {
        width: 0.75rem;
        height: 0.75rem;
    }
}

@media (max-width: 640px) {
    .product-detail-container {
        margin-top: 5rem;
    }
    
    .category-card {
        width: 5rem;
    }
    
    .category-icon {
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
    }
}
