/* ===================================
   Pizzaria Hit - Cardápio Digital
   Estilos customizados e animações
   =================================== */

/* Reset e Base */
* {
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Safe area para dispositivos móveis */
.safe-area-bottom {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

/* Esconder scrollbar horizontal nas categorias */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

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

/* Animação de slide up para modais */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-slide-up {
    animation: slideUp 0.3s ease-out forwards;
}

/* Animação de fade in */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-fade-in {
    animation: fadeIn 0.2s ease-out forwards;
}

/* Animação de pulse para o carrinho */
@keyframes pulse-cart {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.pulse-cart {
    animation: pulse-cart 0.3s ease-in-out;
}

/* Animação de shake para erros */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.3s ease-in-out;
}

/* Cards de produtos */
.product-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:active {
    transform: scale(0.98);
}

@media (hover: hover) {
    .product-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    }
}

/* Botões de categoria */
.category-btn {
    transition: all 0.2s ease;
}

.category-btn.active {
    background-color: #dc2626;
    color: white;
}

.category-btn:not(.active):hover {
    background-color: #e5e7eb;
}

/* Opções de tamanho e sabores */
.size-option,
.flavor-option,
.borda-option {
    transition: all 0.2s ease;
}

.size-option.selected,
.flavor-option.selected,
.borda-option.selected {
    border-color: #dc2626;
    background-color: #fef2f2;
}

/* Checkbox customizado para sabores */
.flavor-checkbox {
    position: relative;
    width: 24px;
    height: 24px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flavor-option.selected .flavor-checkbox {
    background-color: #dc2626;
    border-color: #dc2626;
}

.flavor-option.selected .flavor-checkbox::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Badge de status */
.status-open {
    background-color: #10b981;
    color: white;
}

.status-closed {
    background-color: #ef4444;
    color: white;
}

/* Imagem do produto */
.product-image {
    transition: transform 0.3s ease;
}

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

/* Loading skeleton */
.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;
    }
}

/* Itens do carrinho */
.cart-item {
    transition: all 0.2s ease;
}

.cart-item:hover {
    background-color: #f9fafb;
}

/* Botão de remover item */
.remove-item-btn {
    transition: all 0.2s ease;
}

.remove-item-btn:hover {
    background-color: #fee2e2;
    color: #dc2626;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 500;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

/* Input focus styles */
input:focus,
textarea:focus {
    outline: none;
}

/* Estilo para cards de bebidas */
.drink-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.drink-card:active {
    transform: scale(0.95);
}

/* Modal backdrop blur */
.backdrop-blur-sm {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Estilo para quantidade no carrinho */
.qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.2s ease;
}

.qty-btn:hover {
    transform: scale(1.1);
}

/* Responsividade */
@media (max-width: 640px) {
    .modal-content {
        max-height: 85vh;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    header,
    nav,
    #cart-float-btn,
    .modal {
        display: none !important;
    }
}

/* Scrollbar customizada para desktop */
@media (min-width: 768px) {
    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    ::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }

    ::-webkit-scrollbar-thumb {
        background: #dc2626;
        border-radius: 4px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: #991b1b;
    }
}

/* Ajuste para safe area em iPhones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: calc(6rem + env(safe-area-inset-bottom));
    }
    
    #cart-float-btn {
        bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
}
