:root { 
    --primary: #e67e22; 
    --danger: #ef4444; 
    --bg: #f8fafc; 
    --text: #1e293b; 
    --card: #ffffff; 
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body { 
    font-family: 'Inter', sans-serif; 
    background: var(--bg); 
    color: var(--text); 
    margin: 0; 
    padding-bottom: 100px; 
}

.btn-main { 
    background: var(--primary); 
    color: white; 
    border: none; 
    width: 100%; 
    padding: 18px; 
    border-radius: 15px; 
    font-weight: 800; 
    font-size: 1.1rem; 
    cursor: pointer; 
    transition: 0.2s; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.btn-main:active { transform: scale(0.98); }

.fixed-bottom-bar { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    right: 0; 
    background: white; 
    padding: 15px 20px 25px; 
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08); 
    z-index: 1000; 
}

/* Vistas */
#view-store { display: block; }
#view-product { display: none; background: white; min-height: 100vh; padding-bottom: 120px; animation: slideIn 0.3s ease; }
#view-cart { display: none; background: #f8fafc; min-height: 100vh; padding-bottom: 120px; animation: slideIn 0.3s ease; }

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

/* Header y Buscador */
header { background: white; padding: 15px 20px 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); position: sticky; top: 0; z-index: 100; }
.header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
header h1 { margin: 0; font-size: 1.3rem; font-weight: 800; color: var(--primary); }
.search-bar { width: 100%; padding: 12px 15px; border-radius: 12px; border: 1px solid #e2e8f0; background: #f1f5f9; font-family: inherit; font-size: 0.95rem; outline: none; transition: 0.2s; }
.search-bar:focus { border-color: var(--primary); background: white; }

/* Categorías */
.categories { display: flex; overflow-x: auto; gap: 10px; padding: 10px 0; scrollbar-width: none; }
.categories::-webkit-scrollbar { display: none; }
.cat-btn { background: white; border: 1px solid #e2e8f0; padding: 8px 16px; border-radius: 20px; font-weight: 600; font-size: 0.85rem; cursor: pointer; white-space: nowrap; color: #64748b; }
.cat-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Grid de Productos */
.container { max-width: 800px; margin: 0 auto; padding: 0 15px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; }
.card { background: var(--card); border-radius: 20px; padding: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.03); cursor: pointer; border: 1px solid #f1f5f9; display: flex; flex-direction: column;}
.card img { width: 100%; height: 130px; object-fit: cover; border-radius: 14px; background: #f1f5f9; }
.card h3 { font-size: 0.95rem; margin: 10px 0 4px; font-weight: 700; line-height: 1.2; }
.card .price { font-weight: 800; color: var(--primary); font-size: 1.1rem; margin-top: auto; }

/* Carrito Flotante */
.cart-float { position: fixed; bottom: 20px; left: 20px; right: 20px; background: var(--text); color: white; padding: 18px 25px; border-radius: 20px; display: none; justify-content: space-between; align-items: center; box-shadow: 0 10px 25px rgba(0,0,0,0.3); z-index: 1000; cursor: pointer; transition: transform 0.2s; }

/* Detalles de Producto */
.nav-back { position: absolute; top: 15px; left: 15px; background: rgba(255,255,255,0.9); border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 1.2rem; display: flex; justify-content: center; align-items: center; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.1); z-index: 10; }
.pd-img { width: 100%; height: 300px; object-fit: cover; background: #f1f5f9; }
.pd-content { padding: 20px; max-width: 900px; margin: 0 auto; }
.pd-title { font-size: 1.5rem; font-weight: 800; margin: 0 0 8px 0; }
.pd-desc { color: #64748b; font-size: 0.95rem; line-height: 1.5; margin-bottom: 20px; }
.pd-price { font-size: 1.6rem; font-weight: 800; color: var(--primary); margin-bottom: 20px; }

.section-title { font-size: 1.1rem; font-weight: 800; margin: 25px 0 15px 0; display: flex; justify-content: space-between; }
.section-title span { font-size: 0.8rem; background: #f1f5f9; padding: 4px 8px; border-radius: 8px; font-weight: 600; color: #64748b; }

.extra-box { display: flex; justify-content: space-between; align-items: center; padding: 16px; border: 2px solid #f1f5f9; border-radius: 15px; margin-bottom: 10px; cursor: pointer; transition: 0.2s; }
.extra-box.active { border-color: var(--primary); background: #fffcf9; }
.extra-info { display: flex; flex-direction: column; }
.extra-name { font-weight: 600; font-size: 1rem; }
.extra-price { color: var(--primary); font-weight: 800; font-size: 0.9rem; margin-top: 4px; }
.custom-checkbox { width: 24px; height: 24px; border: 2px solid #cbd5e1; border-radius: 6px; display: flex; justify-content: center; align-items: center; transition: 0.2s; }
.extra-box.active .custom-checkbox { background: var(--primary); border-color: var(--primary); }
.extra-box.active .custom-checkbox::after { content: '✓'; color: white; font-weight: bold; }

.notes-area { width: 100%; padding: 15px; border-radius: 12px; border: 1px solid #cbd5e1; font-family: inherit; font-size: 0.95rem; resize: none; outline: none; height: 80px; background: #f8fafc; }
.notes-area:focus { border-color: var(--primary); background: white; }

.qty-selector { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 25px 0; }
.qty-btn { background: #f1f5f9; border: none; width: 40px; height: 40px; border-radius: 10px; font-size: 1.2rem; font-weight: bold; color: var(--text); cursor: pointer; }
.qty-number { font-size: 1.3rem; font-weight: 800; width: 30px; text-align: center; }

/* Carrito Detalle */
.cart-nav { background: white; padding: 20px; display: flex; align-items: center; gap: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); position: sticky; top: 0; z-index: 100; }
.cart-nav button { background: none; border: none; font-size: 1.2rem; cursor: pointer; padding: 0; }
.cart-nav h2 { margin: 0; font-size: 1.2rem; font-weight: 800; }

.cart-list { background: white; padding: 0 20px; margin-bottom: 15px; }
.cart-item { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 0; border-bottom: 1px dashed #e2e8f0; }
.cart-item:last-child { border-bottom: none; }
.cart-item-info { flex-grow: 1; padding-right: 15px; }
.cart-item-title { font-weight: 800; font-size: 1rem; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.cart-item-extras { font-size: 0.85rem; color: #64748b; line-height: 1.4; margin-bottom: 4px; }
.cart-item-notes { font-size: 0.85rem; color: #e67e22; font-style: italic; background: #fffcf9; padding: 4px 8px; border-radius: 6px; display: inline-block; margin-top: 4px; }
.cart-item-price { font-weight: 800; color: var(--primary); font-size: 1.1rem; margin-top: 8px; }

.cart-item-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 15px; }
.btn-delete { background: #fee2e2; color: var(--danger); border: none; width: 36px; height: 36px; border-radius: 10px; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.mini-qty-selector { display: flex; align-items: center; gap: 10px; background: #f1f5f9; padding: 4px; border-radius: 10px; }
.mini-qty-btn { background: white; border: none; width: 28px; height: 28px; border-radius: 6px; font-weight: bold; color: var(--text); cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.mini-qty-num { font-weight: 800; font-size: 0.9rem; min-width: 15px; text-align: center; }

.form-container { background: white; padding: 20px; margin-bottom: 15px; }
.input-field { width: 100%; padding: 14px 15px; border-radius: 10px; border: 1px solid #cbd5e1; font-family: inherit; font-size: 1rem; margin-bottom: 12px; outline: none; background: #f8fafc; }
.input-field:focus { border-color: var(--primary); background: white; }
.input-field.error { border-color: var(--danger); background: #fef2f2; }
textarea.input-field { resize: vertical; min-height: 80px; }

.totals-container { background: white; padding: 20px; }
.total-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 1rem; color: #64748b; }
.total-row.grand { font-size: 1.4rem; font-weight: 800; color: var(--text); margin-top: 10px; border-top: 2px solid #f1f5f9; padding-top: 15px; }

/* Modales */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: none; justify-content: center; align-items: center; z-index: 3000; }
.alert-box { background: white; width: 90%; max-width: 340px; border-radius: 25px; padding: 30px 20px; text-align: center; animation: scaleUp 0.3s ease; }
@keyframes scaleUp { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.btn-outline { background: white; color: #64748b; border: 2px solid #e2e8f0; width: 100%; padding: 16px; border-radius: 15px; font-weight: 700; font-size: 1rem; cursor: pointer; margin-top: 10px; }
