/* ========================================
   ESTILO ECOMMERCE MODERNO COM ZOOM
   ======================================== */

/* Variáveis CSS */
:root {
    --primary-color: #0066cc;
    --primary-hover: #0052a3;
    --secondary-color: #f39c12;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --light-gray: #f8f9fa;
    --border-gray: #e0e0e0;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== PRODUTOS GRID ===== */
.produtos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 16px 0;
}

/* Card do Produto */
.product-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px);
}

/* Container de Imagem */
.product-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image-wrapper img {
    transform: scale(1.05);
}

.product-image-wrapper:hover img {
    filter: brightness(1.1);
}

/* Badge de Disponibilidade */
.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
    z-index: 2;
}

.product-badge.desconto {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}

/* Conteúdo do Card */
.product-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
    line-height: 1.4;
    min-height: 2.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 12px;
    line-height: 1.5;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Preço e Código */
.product-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.product-price-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.product-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.product-price-original {
    font-size: 0.9rem;
    color: var(--text-light);
    text-decoration: line-through;
    margin-right: 8px;
}

.product-code {
    font-size: 0.8rem;
    color: var(--text-light);
    font-family: 'Courier New', monospace;
}

/* Botão Comprar */
.btn-comprar {
    width: 100%;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.25);
    text-decoration: none;
    text-align: center;
}

.btn-comprar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 102, 204, 0.35);
}

.btn-comprar:active {
    transform: translateY(0);
}

.btn-comprar i {
    font-size: 1.1rem;
}

/* Botão Ver Vídeo */
.btn-video {
    width: 100%;
    padding: 14px 16px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.25);
    text-decoration: none;
    text-align: center;
    margin-top: 8px;
}

.btn-video:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.35);
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

.btn-video:active {
    transform: translateY(0);
}

.btn-video i {
    font-size: 1.1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ===== LIGHTBOX / ZOOM MODAL ===== */
.modal-zoom {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
    overflow: auto;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.modal-zoom.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: zoomIn 0.3s ease;
}

.modal-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Botão Fechar Modal */
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10001;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

/* Descrição no Modal */
.modal-info {
    color: white;
    text-align: center;
    margin-top: 20px;
    font-size: 1.1rem;
    max-width: 600px;
}

/* Navegação (Próximo/Anterior) */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 24px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.modal-nav.prev {
    left: 20px;
}

.modal-nav.next {
    right: 20px;
}

@media (max-width: 768px) {
    .modal-nav {
        width: 40px;
        height: 40px;
        font-size: 18px;
        padding: 8px 12px;
    }
    
    .modal-nav.prev {
        left: 10px;
    }
    
    .modal-nav.next {
        right: 10px;
    }
    
    .modal-close {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
        font-size: 24px;
    }
}

/* ===== RESPONSIVIDADE ===== */

/* Tablets (768px e acima) */
@media (max-width: 1024px) {
    .produtos-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
    
    .product-card {
        border-radius: 12px;
    }
}

/* Dispositivos Móveis (até 768px) */
@media (max-width: 768px) {
    .produtos-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 16px;
        padding: 12px 0;
    }
    
    .product-content {
        padding: 16px;
    }
    
    .product-title {
        font-size: 1rem;
        margin-bottom: 8px;
        min-height: 2.4rem;
    }
    
    .product-description {
        font-size: 0.85rem;
        margin-bottom: 10px;
    }
    
    .product-price {
        font-size: 1.5rem;
    }
    
    .btn-comprar {
        padding: 12px 14px;
        font-size: 0.95rem;
    }
    
    .product-badge {
        padding: 4px 10px;
        font-size: 0.65rem;
    }
    
    .modal-image {
        max-height: 80vh;
        border-radius: 0;
    }
}

/* Smartphones (até 480px) */
@media (max-width: 480px) {
    .produtos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .product-content {
        padding: 12px;
    }
    
    .product-title {
        font-size: 0.95rem;
        min-height: 2.2rem;
    }
    
    .product-description {
        font-size: 0.8rem;
        -webkit-line-clamp: 1;
    }
    
    .product-price {
        font-size: 1.3rem;
    }
    
    .btn-comprar {
        padding: 10px 12px;
        font-size: 0.9rem;
        gap: 6px;
    }
    
    .product-footer {
        padding-top: 12px;
    }
}

/* ===== ACESSIBILIDADE ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== PRINT ===== */
@media print {
    .modal-zoom {
        display: none;
    }
}
