/* =====================================================
   ESTILO ZÉ EXPRESS - OTIMIZADO PARA APP
   Cores: Amarelo #F59E0B e Verde #22c55e
   ===================================================== */

:root {
    --theme-primary: #F59E0B;
    --theme-primary-dark: #D97706;
    --theme-primary-light: #fffbeb;
    --theme-green: #22c55e;
    --theme-green-dark: #16a34a;
}

/* ========== RESET E COMPORTAMENTO DE APP ========== */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* DESABILITAR ZOOM POR DOUBLE-TAP E PINCH */
html {
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: hidden;
    overscroll-behavior: none;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

/* Permitir seleção apenas em inputs */
input, textarea {
    user-select: text;
    -webkit-user-select: text;
}

/* ========== OTIMIZAÇÃO DE IMAGENS ========== */
img {
    content-visibility: auto;
    will-change: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Lazy loading com placeholder */
img[loading="lazy"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: img-shimmer 1.2s ease-in-out infinite;
}

img[loading="lazy"].loaded {
    animation: none;
    background: transparent;
}

@keyframes img-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========== PERFORMANCE GPU ========== */
.product-card,
.category-item,
.carousel-container {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
}

/* ========== UTILITÁRIOS ========== */
.bg-theme-primary { background-color: var(--theme-primary) !important; }
.bg-theme-primary-dark { background-color: var(--theme-primary-dark) !important; }
.text-theme-primary { color: var(--theme-primary) !important; }
.border-theme-primary { border-color: var(--theme-primary) !important; }

/* ========== HEADER / BANNER SUPERIOR ========== */
.location-banner {
    background: linear-gradient(to right, #F59E0B, #D97706, #B45309);
}

.hero-cover {
    background: linear-gradient(to right, rgba(245, 158, 11, 0.9), rgba(217, 119, 6, 0.9), rgba(180, 83, 9, 0.9));
    position: relative;
}

/* ========== BADGE ABERTO ========== */
.badge-aberto {
    background-color: #22c55e;
    color: white;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 700;
}

/* ========== BARRA DE PESQUISA ========== */
.search-bar-container {
    background: white;
    border-radius: 9999px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-bar-container input {
    border: 2px solid #e5e7eb;
    border-radius: 9999px;
}

.search-bar-container input:focus {
    border-color: #F59E0B;
    outline: none;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

/* ========== BANNER DE PROMOÇÃO ========== */
.promo-banner {
    background: linear-gradient(to right, #22c55e, #16a34a);
    color: white;
}

/* ========== NAVEGAÇÃO DE CATEGORIAS ========== */
#main-category-nav {
    background-color: #F59E0B;
    border-bottom: 1px solid #D97706;
}

#main-category-nav a {
    color: white;
    padding: 12px 16px;
    font-weight: 500;
    transition: background-color 0.2s;
}

#main-category-nav a:hover {
    background-color: rgba(0,0,0,0.1);
}

/* ========== GRID DE CATEGORIAS ========== */
.category-item {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.category-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.category-item img {
    border-radius: 50%;
}

/* ========== CARDS DE PRODUTO ========== */
.product-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: box-shadow 0.15s ease;
    contain: layout style paint;
    content-visibility: auto;
    touch-action: manipulation;
}

.product-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* Imagens de produto otimizadas */
.product-card img,
.product-card figure img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #fafafa;
    aspect-ratio: 1/1;
    transition: opacity 0.2s ease;
}

.product-card figure {
    position: relative;
    overflow: hidden;
    background: #f8f8f8;
}

/* Tag de desconto */
.discount-tag {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}

/* Preço antigo */
.price-old {
    color: #9ca3af;
    text-decoration: line-through;
    font-size: 12px;
}

/* Preço novo */
.price-new {
    color: #22c55e;
    font-weight: 700;
    font-size: 18px;
}

/* Botão adicionar ao carrinho */
.add-to-cart-btn {
    background: linear-gradient(135deg, #22c55e, #16a34a) !important;
    color: white !important;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-to-cart-btn:hover {
    background: linear-gradient(135deg, #16a34a, #15803d) !important;
    transform: scale(1.02);
}

/* ========== TÍTULOS DE SEÇÃO ========== */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.section-link {
    color: #F59E0B;
    font-weight: 600;
}

.section-link:hover {
    text-decoration: underline;
}

/* ========== CARROSSEL OTIMIZADO ========== */
.carousel-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    scroll-behavior: smooth;
    touch-action: pan-x;
    will-change: scroll-position;
}

.carousel-container::-webkit-scrollbar {
    display: none;
}

.carousel-container .product-card {
    scroll-snap-align: start;
    flex-shrink: 0;
    contain: layout style paint;
}

/* ========== MODAL DE LOCALIZAÇÃO ========== */
.location-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.location-modal .icon-container {
    background-color: #fffbeb;
    border-radius: 50%;
}

.location-modal .icon-container svg {
    color: #F59E0B;
}

.location-modal button.primary {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
}

/* ========== CARRINHO SIDEBAR ========== */
#cart-sidebar {
    background: white;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
}

.cart-item {
    border-bottom: 1px solid #f3f4f6;
    padding: 12px 0;
}

.checkout-btn {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border-radius: 12px;
    padding: 16px;
    font-weight: 700;
}

.checkout-btn:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
}

/* ========== FOOTER ========== */
.footer-gradient {
    background: linear-gradient(to bottom, #F59E0B, #D97706);
    color: white;
}

/* ========== ANIMAÇÕES ========== */
@keyframes bounce-in {
    0% { transform: translateX(-50%) scale(0.8); opacity: 0; }
    50% { transform: translateX(-50%) scale(1.05); }
    100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

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

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

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

/* ========== RESPONSIVO MOBILE ========== */
@media (max-width: 640px) {
    .hero-cover {
        min-height: 160px;
    }
    
    .product-card {
        min-height: 200px;
    }
    
    .product-card h3 {
        font-size: 0.85rem !important;
        line-height: 1.2 !important;
    }
    
    .price-new {
        font-size: 1rem !important;
    }
    
    .carousel-container .product-card {
        width: 180px !important;
        min-width: 180px !important;
    }
    
    #main-category-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #category-nav-links {
        display: flex;
        flex-wrap: nowrap;
        padding: 8px 0;
    }
    
    #category-nav-links a {
        padding: 8px 14px !important;
        font-size: 13px !important;
        white-space: nowrap;
    }
}

/* ========== SCROLLBAR CUSTOMIZADA ========== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ========== TOAST NOTIFICATIONS ========== */
.toast-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    padding: 12px 24px;
    border-radius: 9999px;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

/* ========== TAGS DE PRODUTO ========== */
.tag-red {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.tag-yellow {
    background: linear-gradient(135deg, #eab308, #ca8a04);
    color: white;
}

.tag-green {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.tag-blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}
