/**
 * =====================================================
 * ESTILOS GLOBAIS - MYBEZ BAZAR
 * =====================================================
 * Estilos customizados para complementar Tailwind CSS
 * =====================================================
 */

/* =====================================================
   RESET E CONFIGURAÇÕES GERAIS
   ===================================================== */
* {
    -webkit-tap-highlight-color: transparent;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevenir scroll quando modal está aberto */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* =====================================================
   CARDS DE PRODUTO
   ===================================================== */
.produto-card {
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

.produto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* =====================================================
   ZOOM DE IMAGENS
   ===================================================== */
.zoom-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 9999px;
    padding: 0.5rem;
    transition: background-color 0.2s ease;
    cursor: pointer;
    z-index: 10;
}

.zoom-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* =====================================================
   BADGES DE TAMANHO E CATEGORIA
   ===================================================== */

/* Badges do BAZAR (Vermelho) */
.size-badge.bazar-size,
.category-badge {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.size-badge.bazar-size.active,
.category-badge.active {
    background-color: #dc2626;
    color: white;
    border-color: #dc2626;
    transform: scale(1.05);
}

.category-badge:not(.active) {
    background-color: #f3f4f6;
    color: #1f2937;
}

/* Badges de NOVIDADES (Roxo) */
.filter-badge {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.filter-badge.active {
    background-color: #8b5cf6;
    color: white;
    border-color: #8b5cf6;
    transform: scale(1.05);
}

.filter-badge:not(.active) {
    background-color: #f3f4f6;
    color: #1f2937;
}

/* Badges na página de PRODUTO */
.size-badge.produto-size {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.size-badge.produto-size.active {
    background-color: #000;
    color: white;
    border-color: #000;
    transform: scale(1.05);
}

/* =====================================================
   GALERIA DE IMAGENS (Produto)
   ===================================================== */
.thumbnail {
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.thumbnail:hover {
    opacity: 0.8;
}

.thumbnail.active {
    opacity: 1;
    border: 2px solid #dc2626;
}

/* =====================================================
   CAMPANHAS (Homepage)
   ===================================================== */
.campaign-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.campaign-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* =====================================================
   CONTADOR REGRESSIVO
   ===================================================== */
.countdown-container {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    text-align: center;
    color: #374151;
}

.countdown-item {
    background-color: #f3f4f6;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
    min-width: 50px;
}

.countdown-number {
    display: block;
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: 700;
}

.countdown-label {
    display: block;
    font-size: 0.75rem;
    line-height: 1rem;
    text-transform: uppercase;
    color: #6b7280;
}

/* Urgente (menos de 24h) */
.countdown-urgent .countdown-item {
    background-color: #fee2e2;
    border-color: #fecaca;
}

.countdown-urgent .countdown-number {
    color: #b91c1c;
}

/* =====================================================
   TIMER PIX (Página Sucesso)
   ===================================================== */
.timer-green {
    background: linear-gradient(45deg, #22c55e, #16a34a);
}

.timer-red {
    background: linear-gradient(45deg, #dc2626, #991b1b);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0.8;
    }
}

/* Timer no painel admin */
.pix-timer {
    background: linear-gradient(45deg, #22c55e, #16a34a);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: bold;
}

.pix-timer.urgent {
    background: linear-gradient(45deg, #dc2626, #991b1b);
    animation: blink 1s infinite;
}

/* =====================================================
   GALERIA DE FOTOS (Admin - Pedidos)
   ===================================================== */
.photo-stack {
    position: relative;
    width: 64px;
    height: 64px;
    cursor: pointer;
}

.photo-stack img,
.photo-stack .photo-placeholder {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 0.25rem;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: absolute;
    transition: transform 0.2s ease;
}

.photo-stack img:nth-child(1),
.photo-stack .photo-placeholder:nth-child(1) {
    top: 0;
    left: 0;
    z-index: 3;
}

.photo-stack img:nth-child(2),
.photo-stack .photo-placeholder:nth-child(2) {
    top: 4px;
    left: 4px;
    z-index: 2;
}

.photo-stack img:nth-child(3),
.photo-stack .photo-placeholder:nth-child(3) {
    top: 8px;
    left: 8px;
    z-index: 1;
}

.photo-placeholder {
    background-color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.photo-stack:hover img:nth-child(1) {
    transform: translateX(-12px) rotate(-8deg) scale(1.05);
}

.photo-stack:hover img:nth-child(2) {
    transform: translateY(-4px) rotate(0deg) scale(1.05);
    z-index: 4;
}

.photo-stack:hover img:nth-child(3) {
    transform: translateX(12px) rotate(8deg) scale(1.05);
}

/* =====================================================
   NOTIFICAÇÕES (Toast)
   ===================================================== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideIn 0.5s ease;
    min-width: 300px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* =====================================================
   ÍCONES DO HEADER
   ===================================================== */
.header-icon {
    transition: color 0.2s ease-in-out;
}

/* =====================================================
   TEXTAREA PIX CODE (Página Sucesso)
   ===================================================== */
textarea#pix-code {
    height: 110px;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
}

/* =====================================================
   POPUPS/MODAIS DE CONFIRMAÇÃO
   ===================================================== */
#cart-popup-modal.flex,
#warning-popup-modal.flex {
    display: flex;
}

#cart-popup-modal.flex #cart-popup-content,
#warning-popup-modal.flex #warning-popup-content {
    opacity: 1;
    transform: translateY(0);
}

/* =====================================================
   RESPONSIVIDADE MOBILE
   ===================================================== */
@media (max-width: 640px) {
    .countdown-container {
        gap: 0.5rem;
    }
    
    .countdown-item {
        padding: 0.375rem 0.5rem;
        min-width: 45px;
    }
    
    .countdown-number {
        font-size: 1.25rem;
    }
    
    .countdown-label {
        font-size: 0.625rem;
    }
}

/* =====================================================
   ESTADOS DE LOADING
   ===================================================== */
.loading-spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #dc2626;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* =====================================================
   UTILITÁRIOS
   ===================================================== */
.text-balance {
    text-wrap: balance;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* =====================================================
   IMPRESSÃO
   ===================================================== */
@media print {
    body * {
        visibility: hidden;
    }
    
    .print-area,
    .print-area * {
        visibility: visible;
    }
    
    .print-area {
        position: absolute;
        left: 0;
        top: 0;
    }
}
/* --- SIDEBAR ADMIN --- */
.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    color: #d1d5db;
    transition: all 0.2s;
}

.nav-item:hover {
    background-color: #374151;
    color: #ffffff;
}
.nav-item.active {
    background-color: #1f2937;
    color: #ffffff;
}

.nav-subitem {
    width: 100%;
    text-align: left;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #d1d5db;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.nav-subitem:hover {
    background-color: #374151;
    color: #ffffff;
}

/* --- SIDEBAR ADMIN --- */
aside {
    position: sticky;
    top: 0;
    height: 100vh;
}

aside.is-open {
    transform: translateX(0);
}

/* Mobile: sidebar hidden por padrão */
@media (max-width: 768px) {
    aside {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }
    
    aside.show-mobile {
        transform: translateX(0);
    }
    
    /* Overlay escuro quando menu mobile está aberto */
    aside.show-mobile::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}
/* Compra Rápida */
.quick-buy-size-btn.active,
.quick-buy-payment-btn.active,
.quick-buy-shipping-btn.active {
    border-color: rgb(104, 137, 93) !important;
    background-color: rgba(104, 137, 93, 0.1);
}

.quick-buy-size-btn,
.quick-buy-payment-btn,
.quick-buy-shipping-btn {
    border-color: #d1d5db;
}
/* =====================================================
   VITRINE VIVA
   ===================================================== */

/* Ponto clicável na imagem */
.hotspot-point {
    position: absolute;
    width: 24px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5), 0 2px 5px rgba(0,0,0,0.3);
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: transform 0.2s ease;
    z-index: 10;
}

.hotspot-point::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(1);
    animation: pulse 2s infinite;
    z-index: -1;
}

.hotspot-point:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0.7;
    }
    70% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
    }
}

/* Painel Lateral de Produto */
.product-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100%;
    background-color: white;
    z-index: 1000;
    box-shadow: -10px 0 30px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}

.product-panel.is-open {
    transform: translateX(0);
}

.product-panel-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.product-panel-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}
/* Card do Look na Vitrine Mosaico */
.look-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.07);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.look-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.12);
}

.look-card-image {
    width: 100%;
    height: 400px; /* Altura fixa para consistência */
    object-fit: cover;
    transition: transform 0.4s ease;
}

.look-card:hover .look-card-image {
    transform: scale(1.05);
}
/* =====================================================
   BADGE DE PREÇO FLUTUANTE (VITRINE)
   ===================================================== */

.price-badge {
    position: absolute;
    bottom: 0.75rem; /* 12px do fundo */
    right: 0.75rem;  /* 12px da direita */
    background-color: rgba(26, 26, 26, 0.7); /* Preto semi-transparente */
    color: white;
    padding: 6px 14px;
    border-radius: 9999px; /* Totalmente arredondado */
    font-size: 0.875rem; /* 14px */
    font-weight: 600; /* semi-bold */
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    
    /* Efeito "vidro fosco" para um toque moderno */
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    
    /* Animação suave de entrada */
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.4s ease;
}

/* O badge aparece quando o card é carregado */
.look-card .price-badge {
    transform: translateY(0);
    opacity: 1;
}
/* =====================================================
   BLOCO DE PREÇO DETALHADO (VITRINE MOSAICO)
   ===================================================== */

.price-block-on-card {
    text-align: left; /* Alinha o texto do bloco à esquerda */
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6; /* Uma linha sutil de separação */
}

.price-block-on-card .price-total {
    font-size: 1.25rem; /* 20px */
    font-weight: 700; /* bold */
    color: #1f2937; /* cinza escuro */
    margin-bottom: 0.5rem;
}

.price-block-on-card .price-item {
    font-size: 0.875rem; /* 14px - fonte menor */
    color: #6b7280; /* cinza médio */
    display: flex;
    justify-content: space-between; /* Alinha nome e preço nas extremidades */
}

/* =====================================================
   AÇÃO NO CARD DA VITRINE (MOBILE-FIRST)
   ===================================================== */

/* Transforma a imagem em um link clicável */
.look-card-link {
    display: block;
    position: relative;
    overflow: hidden;
}

/* O ícone central de ação */
.look-card-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.85); /* Fundo branco semi-transparente */
    border-radius: 50%;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    color: #1f2937; /* Cinza escuro */
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    
    /* Animação sutil */
    transition: all 0.3s ease;
    opacity: 0; /* Começa invisível */
    transform: translate(-50%, -50%) scale(0.8);
}

/* O ícone aparece quando o card é carregado/visível */
.look-card .look-card-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Efeito de hover para desktop */
@media (hover: hover) {
    .look-card-link:hover .look-card-icon {
        transform: translate(-50%, -50%) scale(1.1);
        background-color: white;
    }
}

/* Estilo para a linha de tamanhos no bloco de preço */
.price-item-sizes {
    font-size: 0.75rem; /* 12px */
    font-weight: 500;
    color: #4b5563; /* Cinza mais escuro */
    padding-left: 0.5rem; /* Pequeno recuo para alinhar com o nome do produto */
    margin-top: 4px;
}
.look-card-overlay-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    color: white;
    text-align: center;
    padding: 30px 20px 20px;
    font-weight: 600;
    letter-spacing: 1px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none; /* Importante para não atrapalhar o clique na lupa */
}

.look-card:hover .look-card-overlay-text {
    opacity: 1;
    transform: translateY(0);
}
.look-card-button {
    display: block;
    width: calc(100% - 40px);
    margin: 0 20px 20px;
    text-align: center;
    background-color: #1f2937; /* Cinza bem escuro */
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.look-card-button:hover {
    background-color: #000;
    transform: scale(1.03);
}