/**
 * La Bella Pizzaria - Custom Styles
 * Complementa Tailwind CSS
 */

/* ==================== GERAL ==================== */

/* Esconde scrollbar horizontal mas permite scroll */
.overflow-x-auto {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.overflow-x-auto::-webkit-scrollbar {
    display: none;
}

/* Transições suaves para navegação */
.screen {
    transition: opacity 0.2s ease-in-out;
}

/* ==================== COUNTDOWN ==================== */

#countdown-top,
#countdown-end {
    font-variant-numeric: tabular-nums;
}

/* ==================== CARDS DE PRODUTO ==================== */

.product-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1);
}

.product-card:active {
    transform: translateY(0);
}

/* Badge de status */
.product-tag {
    animation: pulse-subtle 2s infinite;
}

@keyframes pulse-subtle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Produto esgotado */
.product-sold-out {
    position: relative;
}

.product-sold-out::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

/* ==================== SELEÇÃO DE OPÇÕES ==================== */

.option-item {
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.option-item.selected {
    background-color: #32bcad15;
    border-color: #32bcad;
}

/* Contador de quantidade */
.quantity-btn {
    transition: background-color 0.15s ease;
}

.quantity-btn:hover {
    background-color: #e5e7eb;
}

.quantity-btn:active {
    background-color: #d1d5db;
}

/* ==================== DELIVERY OPTIONS ==================== */

.delivery-option {
    transition: all 0.2s ease;
}

.delivery-option.selected {
    border-color: #32bcad;
    background-color: rgba(50, 188, 173, 0.1);
}

.delivery-option:not(.selected):hover {
    border-color: #9ca3af;
}

/* ==================== INPUTS ==================== */

input:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Máscara de CPF e telefone */
input::placeholder {
    color: #9ca3af;
}

/* ==================== BOTÕES ==================== */

button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Botão copiar PIX */
#btn-copy-pix.copied {
    background-color: #22c55e;
}

/* ==================== MODAL ==================== */

#error-modal {
    animation: fadeIn 0.2s ease;
}

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

#error-modal > div {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== DEPOIMENTOS ==================== */

.review-card {
    min-width: 280px;
    flex-shrink: 0;
}

/* ==================== QR CODE ==================== */

#pix-qrcode {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* ==================== LOADING ==================== */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==================== RESPONSIVE ==================== */

/* Mobile (padrão) */
@media (max-width: 640px) {
    .product-card img {
        height: 100px;
    }

    #pix-qrcode {
        width: 200px;
        height: 200px;
    }
}

/* ==================== DESKTOP RESPONSIVO ==================== */

/* Tablets (768px+) */
@media (min-width: 768px) {
    /* Header maior */
    header {
        padding: 1.5rem 2rem;
    }

    #restaurant-logo {
        width: 5rem;
        height: 5rem;
    }

    #restaurant-name {
        font-size: 1.5rem;
    }

    /* Imagens de produto maiores */
    .product-card img {
        width: 10rem;
        height: 10rem;
    }

    /* Cards de promo com padding maior */
    #first-order-promo {
        padding: 1.5rem;
    }

    /* Reviews maiores */
    .review-card {
        min-width: 320px;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    /* Layout em grid para produtos */
    .products-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    /* Cards de produto maiores */
    .product-card img {
        width: 12rem;
        height: 12rem;
    }

    /* Header mais espaçoso */
    header .flex {
        gap: 2rem;
    }

    #restaurant-logo {
        width: 6rem;
        height: 6rem;
    }

    #restaurant-name {
        font-size: 1.75rem;
    }

    /* Footer fixo centralizado */
    .fixed.bottom-0 {
        left: 50%;
        transform: translateX(-50%);
        max-width: 1024px;
        width: 100%;
    }

    /* QR Code maior */
    #pix-qrcode {
        width: 250px;
        height: 250px;
    }
}

/* Desktop Grande (1280px+) */
@media (min-width: 1280px) {
    /* 3 produtos por linha */
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Footer ainda mais largo */
    .fixed.bottom-0 {
        max-width: 1200px;
    }

    /* QR Code ainda maior */
    #pix-qrcode {
        width: 280px;
        height: 280px;
    }
}

/* ==================== AJUSTES DE LAYOUT PARA GRID ==================== */

/* Garantir que cards preencham corretamente */
.product-card {
    width: 100%;
}

/* Textos não quebram de forma estranha */
.product-card h3 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==================== ACESSIBILIDADE ==================== */

/* Focus visible para teclado */
button:focus-visible,
input:focus-visible {
    outline: 2px solid #ef4444;
    outline-offset: 2px;
}

/* Reduz animações para quem prefere */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
