/* TailwindCSS via CDN + Custom Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1f2937;
    --light: #f9fafb;
    --gray: #6b7280;
    --border: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f3f4f6;
    color: #1f2937;
    line-height: 1.6;
}

/* Dark mode support - GLOBAL */
.dark body {
    background-color: #111827;
    color: #f9fafb;
}

/* Garantir que o dark mode funcione em todas as páginas */
html.dark {
    color-scheme: dark;
}

html.dark body {
    background-color: #111827;
    color: #f9fafb;
}

/* Garantir que elementos comuns tenham dark mode */
.dark .card,
.dark .stat-card,
.dark .table {
    background-color: #1f2937;
    color: #f9fafb;
}

.dark .table th {
    background-color: #374151;
    color: #f9fafb;
}

.dark .table td {
    border-color: #4b5563;
    color: #f9fafb;
}

.dark .input {
    background-color: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

.dark .input::placeholder {
    color: #9ca3af;
}

.dark .btn-primary {
    background-color: #6366f1;
    color: white;
}

.dark .btn-primary:hover {
    background-color: #4f46e5;
}

.dark .badge-success {
    background-color: #065f46;
    color: #d1fae5;
}

.dark .badge-danger {
    background-color: #991b1b;
    color: #fee2e2;
}

.dark .badge-warning {
    background-color: #92400e;
    color: #fef3c7;
}

.dark .badge-info {
    background-color: #1e40af;
    color: #dbeafe;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--gray);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Mobile-First Improvements */
.touch-manipulation {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Better touch targets for mobile */
button, a, .btn {
    min-height: 44px;
    min-width: 44px;
}

@media (max-width: 640px) {
    button, a, .btn {
        min-height: 44px;
    }
    
    /* Prevent text selection on buttons */
    button, .btn {
        -webkit-user-select: none;
        -moz-user-select: none;
        user-select: none;
    }
    
    /* Better scrollbar on mobile */
    .custom-scrollbar {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    /* Optimize modals for mobile */
    .modal-container {
        max-width: 100%;
        margin: 0;
        padding: 0.5rem;
    }
    
    /* Better spacing on mobile */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Layout */
.header {
    background: white;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar {
    width: 250px;
    background: white;
    min-height: calc(100vh - 100px);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    padding: 1.5rem 0;
}

.sidebar-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #374151;
    text-decoration: none;
    transition: background 0.2s;
}

.sidebar-menu a:hover {
    background: #f3f4f6;
}

.sidebar-menu a.active {
    background: var(--primary);
    color: white;
}

.main-content {
    flex: 1;
    padding: 2rem;
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Stats Cards */
.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--gray);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        min-height: auto;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
}

/* Loading */
.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Banner Container Styles */
.banner-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
}

.banner-card {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.slider-wrapper {
    position: relative;
    min-height: 400px;
}

.banner-slide {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.banner-slide.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-text {
    padding: 2rem 0;
}

.btn-catalog {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.btn-catalog:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.promo-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-inner {
    height: 100%;
    background: white;
    width: 0%;
    transition: width 0.1s linear;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* FAQ Styles */
.faq-question {
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: rgba(255, 255, 255, 0.05);
}

.faq-question i {
    transition: transform 0.3s ease;
}

.faq-question.open i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

/* Notification Styles */
#sales-notification {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* WhatsApp Button */
#whatsapp-button {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Dark mode adjustments - GLOBAL */
.dark .banner-container {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

/* Garantir que todas as páginas tenham dark mode aplicado */
html.dark,
html.dark body {
    background-color: #111827 !important;
    color: #f9fafb !important;
}

/* Garantir que elementos comuns funcionem em dark mode */
html.dark .bg-white {
    background-color: #1f2937 !important;
}

html.dark .text-gray-900 {
    color: #f9fafb !important;
}

html.dark .text-gray-700 {
    color: #d1d5db !important;
}

html.dark .text-gray-600 {
    color: #9ca3af !important;
}

html.dark .text-gray-500 {
    color: #6b7280 !important;
}

html.dark .border-gray-200 {
    border-color: #374151 !important;
}

html.dark .border-gray-300 {
    border-color: #4b5563 !important;
}

html.dark input,
html.dark select,
html.dark textarea {
    background-color: #374151 !important;
    border-color: #4b5563 !important;
    color: #f9fafb !important;
}

html.dark input::placeholder,
html.dark select::placeholder,
html.dark textarea::placeholder {
    color: #9ca3af !important;
}

/* Garantir que todas as páginas tenham dark mode forçado */
html.dark .container,
html.dark .max-w-7xl,
html.dark .max-w-2xl,
html.dark .max-w-4xl,
html.dark .max-w-6xl {
    background-color: transparent;
}

/* Garantir que modais e overlays funcionem em dark mode */
html.dark .fixed,
html.dark .absolute,
html.dark .relative {
    /* Não sobrescrever, mas garantir contexto */
}

/* Garantir que QR Code e imagens funcionem em dark mode */
html.dark img,
html.dark canvas {
    /* Imagens não devem ser alteradas */
}

html.dark svg {
    /* SVGs podem precisar de ajuste */
    fill: currentColor;
}

/* Garantir que botões funcionem em dark mode */
html.dark button:not(.dark\\:bg-),
html.dark .btn:not(.dark\\:bg-) {
    background-color: #374151 !important;
    color: #f9fafb !important;
}

html.dark button:hover:not(.dark\\:hover\\:bg-),
html.dark .btn:hover:not(.dark\\:hover\\:bg-) {
    background-color: #4b5563 !important;
}

/* Garantir que links funcionem em dark mode */
html.dark a:not(.dark\\:text-):not(.text-) {
    color: #60a5fa !important;
}

html.dark a:hover:not(.dark\\:hover\\:text-):not(.hover\\:text-) {
    color: #93c5fd !important;
}

/* Garantir que cards e containers funcionem - apenas se não tiverem bg- */
html.dark .rounded-xl:not([class*="bg-"]),
html.dark .rounded-lg:not([class*="bg-"]),
html.dark .rounded-md:not([class*="bg-"]) {
    background-color: #1f2937;
    border-color: #374151;
}

/* Aplicar apenas se não tiverem classes específicas */
html.dark div:not([class*="bg-"]):not([class*="dark:"]) {
    /* Não aplicar automaticamente, deixar Tailwind fazer */
}

/* Garantir que tabelas funcionem */
html.dark table,
html.dark .table {
    background-color: #1f2937 !important;
    color: #f9fafb !important;
}

html.dark table th,
html.dark .table th {
    background-color: #374151 !important;
    color: #f9fafb !important;
}

html.dark table td,
html.dark .table td {
    border-color: #4b5563 !important;
    color: #f9fafb !important;
}

/* Garantir que badges funcionem */
html.dark .badge,
html.dark .rounded-full {
    background-color: #374151 !important;
    color: #f9fafb !important;
}

/* Product Card Styles */
.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
}

.size-7 {
    width: 1.75rem;
    height: 1.75rem;
}

.size-8 {
    width: 2rem;
    height: 2rem;
}

.size-full {
    width: 100%;
    height: 100%;
}

.aspect-video {
    aspect-ratio: 16 / 9;
}

/* Badge discount */
.badge-discount {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* PIX Icon Container */
.pix-icon-container {
    background: rgba(50, 188, 173, 0.15);
    border: 1px solid rgba(50, 188, 173, 0.3);
}

/* Auto delivery icon */
.auto-delivery-icon {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.5);
}

/* Out of stock overlay */
.out-of-stock-overlay {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}

/* Cart Drawer Animations */
@keyframes fade-in {
    from {
        background-color: rgba(0, 0, 0, 0);
    }
    to {
        background-color: rgba(0, 0, 0, 0.8);
    }
}

@keyframes fade-out {
    from {
        background-color: rgba(0, 0, 0, 0.8);
    }
    to {
        background-color: rgba(0, 0, 0, 0);
    }
}

@keyframes slide-in {
    from {
        transform: translateX(500px);
    }
    to {
        transform: translateX(0px);
    }
}

@keyframes slide-out {
    from {
        transform: translateX(0px);
    }
    to {
        transform: translateX(500px);
    }
}

#cart-drawer[data-state="open"] {
    animation: fade-in 0.4s forwards;
}

#cart-drawer[data-state="closed"] {
    animation: fade-out 0.4s forwards;
}

#cart-drawer[data-state="open"] > div {
    animation: slide-in 0.4s forwards;
}

#cart-drawer[data-state="closed"] > div {
    animation: slide-out 0.4s forwards;
}

/* Dialog Animations */
@keyframes dialog-in {
    from {
        opacity: 0;
        scale: 50%;
    }
    to {
        opacity: 1;
        scale: 100%;
    }
}

@keyframes dialog-out {
    from {
        opacity: 1;
        scale: 100%;
    }
    to {
        opacity: 0;
        scale: 50%;
    }
}

.dialog[data-state="open"] {
    animation: fade-in 0.4s forwards;
}

.dialog[data-state="closed"] {
    animation: fade-out 0.4s forwards;
}

.dialog[data-state="open"] > div {
    animation: dialog-in 0.2s forwards;
}

.dialog[data-state="closed"] > div {
    animation: dialog-out 0.2s forwards;
}

/* Category Section Animations */
#category-section,
#category #products-list {
    scroll-margin-top: 100px;
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    opacity: 0;
    transform: translateY(20px);
}

#category-section.visible,
#category #products-list.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes loading {
    0% {
        left: -50%;
    }
    to {
        left: 100%;
    }
}

/* Custom Navbar */
.custom-navbar {
    background-color: #14141c;
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
}

/* Sales Notification Styles */
#sales-notification {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out, visibility 0.5s;
    overflow: hidden;
}

#sales-notification.show {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

@keyframes countdown {
    from { width: 100%; }
    to { width: 0%; }
}

#sales-notification.show #timer-bar {
    animation: countdown 5s linear forwards;
}

#notification-text {
    font-size: 0.65rem;
    line-height: 0.9rem;
}

.gift-icon {
    width: 1rem;
    height: 1rem;
    color: white;
}

/* WhatsApp Button */
#whatsapp-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* WhatsApp Modal */
#whatsapp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1010;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

#whatsapp-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

#whatsapp-modal-content {
    position: relative;
    background-color: white;
    padding: 2rem;
    border-radius: 0.75rem;
    width: 90%;
    max-width: 400px;
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

#whatsapp-modal-overlay.show #whatsapp-modal-content {
    transform: scale(1);
}

/* Banner Container Enhanced Styles */
.banner-container {
    font-family: 'Inter', sans-serif;
    background-size: auto, cover;
    padding: 2rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-card {
    width: 100%;
    max-width: 92rem;
    position: relative;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2.5rem;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.slider-wrapper {
    display: grid;
}

.banner-slide {
    grid-area: 1 / 1 / 2 / 2;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
}

.banner-slide.active {
    opacity: 1;
    visibility: visible;
}

.banner-slide.active .slide-text {
    animation: slideInLeft 0.8s ease-out forwards;
}

.banner-slide.active .slide-image-wrapper {
    animation: slideInRight 0.8s ease-out forwards;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.promo-image {
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    transform: perspective(1000px) rotateY(-5deg) rotateX(2deg) scale(1.05);
    transition: transform 0.4s ease;
}

.promo-image:hover {
    transform: perspective(1000px) rotateY(0) rotateX(0) scale(1);
}

.btn-catalog {
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    transition: all 0.3s ease;
}

.btn-catalog:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background-color: rgba(255,255,255,0.2);
    width: 100%;
}

.progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #60a5fa, #2563eb);
    border-radius: 0 2px 2px 0;
    animation: progress 5s linear forwards;
}

@keyframes progress {
    from { width: 0%; }
    to { width: 100%; }
}

/* FAQ Enhanced Styles */
.faq-question svg {
    transition: transform 0.3s ease-in-out;
}

.faq-question.open svg {
    transform: rotate(180deg);
}

#faq-image {
    transition: opacity 0.3s ease-in-out;
}

