﻿/* ========================================
   FUENTE SAN FELIPE - SISTEMA DE PEDIDOS
   ======================================== */
:root {
    --p-bg: #1a1a1a;
    --p-bg-soft: #242424;
    --p-bg-card: #2e2e2e;
    --p-bg-card-2: #383838;
    --p-border: #3a3a3a;
    --p-text: #f5f0e8;
    --p-muted: #a89e94;
    --p-faint: #6d6d6d;
    --p-primary: #d4a853;
    --p-primary-hover: #e6bc6a;
    --p-accent: #c49a6c;
    --p-green: #3ddc84;
    --p-red: #ef4444;
    --p-radius: 16px;
    --p-radius-sm: 10px;
    --p-radius-pill: 999px;
    --p-font: 'Inter', system-ui, sans-serif;
    --p-font-brand: 'Playfair Display', Georgia, serif;
    --p-shadow: 0 4px 24px rgba(0,0,0,0.3);
    --p-max: 1120px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
    font-family: var(--p-font);
    background: var(--p-bg);
    color: var(--p-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
.p-main { flex: 1; }

/* Container */
.p-container { max-width: var(--p-max); margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.p-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(26,26,26,0.92);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--p-border);
}
.p-header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}
.p-brand { display: flex; align-items: center; gap: 0.6rem; }
.p-brand-img { height: 38px; border-radius: 8px; }
.p-brand-text { font-family: var(--p-font-brand); font-weight: 700; font-size: 1.1rem; color: var(--p-primary); }
.p-nav { display: flex; align-items: center; gap: 0.5rem; }
.p-nav-link {
    padding: 0.4rem 0.9rem; font-size: 0.9rem; font-weight: 500;
    border-radius: var(--p-radius-pill); transition: all 0.2s;
}
.p-nav-link:hover { background: var(--p-bg-card); }
.p-nav-link.active { color: var(--p-primary); }
.p-cart-btn {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--p-bg-card); border: 1px solid var(--p-border);
    transition: all 0.2s; margin-left: 0.5rem;
}
.p-cart-btn:hover { border-color: var(--p-primary); }
.p-cart-badge {
    position: absolute; top: -4px; right: -4px;
    background: var(--p-red); color: #fff; font-size: 0.65rem; font-weight: 700;
    width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* Flash */
.p-flash { padding: 0.75rem 0; font-size: 0.9rem; font-weight: 500; }
.p-flash-success { background: rgba(61,220,132,0.1); color: var(--p-green); border-bottom: 1px solid rgba(61,220,132,0.2); }
.p-flash-error { background: rgba(239,68,68,0.1); color: var(--p-red); border-bottom: 1px solid rgba(239,68,68,0.2); }
.p-flash-info { background: rgba(212,168,83,0.1); color: var(--p-primary); border-bottom: 1px solid rgba(212,168,83,0.2); }

/* Hero */
.p-hero { position: relative; height: 340px; overflow: hidden; }
.p-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.p-hero-overlay { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(26,26,26,0.85), rgba(26,26,26,0.6)); }
.p-hero-content { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; padding: 2rem; }
.p-hero-kicker { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em; color: var(--p-primary); margin-bottom: 0.5rem; }
.p-hero-title { font-family: var(--p-font-brand); font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; margin-bottom: 0.5rem; }
.p-hero-sub { font-size: 1.05rem; color: var(--p-muted); }

/* Sections */
.p-section { padding: 3rem 0; }
.p-section-header { text-align: center; margin-bottom: 2rem; }
.p-section-kicker { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--p-primary); margin-bottom: 0.4rem; }
.p-section-title { font-family: var(--p-font-brand); font-size: 1.8rem; font-weight: 700; }

/* Category Tabs */
.p-cat-tabs {
    display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 1rem;
    margin-bottom: 2rem; scrollbar-width: none;
}
.p-cat-tabs::-webkit-scrollbar { display: none; }
.p-cat-tab {
    padding: 0.5rem 1.2rem; font-family: var(--p-font); font-size: 0.85rem; font-weight: 600;
    background: var(--p-bg-card); border: 1px solid var(--p-border); border-radius: var(--p-radius-pill);
    color: var(--p-muted); cursor: pointer; white-space: nowrap; transition: all 0.2s;
}
.p-cat-tab:hover { border-color: var(--p-primary); color: var(--p-text); }
.p-cat-tab.active { background: var(--p-primary); color: #1a1a1a; border-color: var(--p-primary); }

/* Category Block */
.p-cat-block { margin-bottom: 2.5rem; }
.p-cat-title { font-family: var(--p-font-brand); font-size: 1.3rem; font-weight: 600; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--p-border); }

/* Product Grid */
.p-products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }

/* Product Card */
.p-card-product {
    background: var(--p-bg-card); border: 1px solid var(--p-border); border-radius: var(--p-radius);
    overflow: hidden; transition: all 0.25s;
}
.p-card-product:hover { transform: translateY(-4px); box-shadow: var(--p-shadow); border-color: var(--p-accent); }
.p-card-img-wrap { height: 170px; overflow: hidden; }
.p-card-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.p-card-product:hover .p-card-img { transform: scale(1.05); }
.p-card-body { padding: 1rem; }
.p-card-name { font-family: var(--p-font-brand); font-size: 1.1rem; font-weight: 600; margin-bottom: 0.3rem; }
.p-card-desc { font-size: 0.82rem; color: var(--p-muted); margin-bottom: 0.8rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.p-card-price { font-family: var(--p-font-brand); font-size: 1.2rem; font-weight: 700; color: var(--p-primary); }
.p-card-actions { display: flex; align-items: center; gap: 0.4rem; }

/* Quantity Stepper */
.p-qty-stepper {
    display: flex; align-items: center; background: var(--p-bg-card-2);
    border-radius: var(--p-radius-pill); border: 1px solid var(--p-border);
}
.p-qty-btn {
    width: 30px; height: 30px; border: none; background: none; color: var(--p-text);
    font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: color 0.2s;
}
.p-qty-btn:hover { color: var(--p-primary); }
.p-qty-input {
    width: 32px; text-align: center; border: none; background: none;
    color: var(--p-text); font-family: var(--p-font); font-size: 0.85rem; font-weight: 600;
    -moz-appearance: textfield;
}
.p-qty-input::-webkit-inner-spin-button, .p-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* Buttons */
.p-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    padding: 0.55rem 1rem; font-family: var(--p-font); font-size: 0.82rem; font-weight: 600;
    border: none; border-radius: var(--p-radius-pill); cursor: pointer; transition: all 0.2s;
    white-space: nowrap;
}
.p-btn-primary { background: var(--p-primary); color: #1a1a1a; }
.p-btn-primary:hover { background: var(--p-primary-hover); transform: translateY(-1px); }
.p-btn-secondary { background: var(--p-bg-card); color: var(--p-text); border: 1px solid var(--p-border); }
.p-btn-secondary:hover { border-color: var(--p-primary); }
.p-btn-danger { background: rgba(239,68,68,0.1); color: var(--p-red); border: 1px solid rgba(239,68,68,0.2); }
.p-btn-danger:hover { background: var(--p-red); color: #fff; }
.p-btn-full { width: 100%; }
.p-btn-lg { padding: 0.75rem 1.5rem; font-size: 0.95rem; }

/* Toast */
.p-toast {
    position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(100px);
    background: var(--p-bg-card); border: 1px solid var(--p-border); border-radius: var(--p-radius-sm);
    padding: 0.75rem 1.25rem; font-size: 0.85rem; font-weight: 500; z-index: 9999;
    box-shadow: var(--p-shadow); transition: transform 0.3s ease; pointer-events: none;
}
.p-toast.show { transform: translateX(-50%) translateY(0); }
.p-toast-success { border-color: var(--p-green); color: var(--p-green); }
.p-toast-error { border-color: var(--p-red); color: var(--p-red); }

/* Cart Page */
.p-cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 2rem; align-items: start; }
.p-cart-item {
    display: flex; gap: 1rem; padding: 1rem; background: var(--p-bg-card);
    border: 1px solid var(--p-border); border-radius: var(--p-radius-sm); margin-bottom: 0.75rem;
}
.p-cart-item-img { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.p-cart-item-info { flex: 1; }
.p-cart-item-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.2rem; }
.p-cart-item-price { color: var(--p-primary); font-weight: 600; font-size: 0.9rem; }
.p-cart-item-total { color: var(--p-primary); font-family: var(--p-font-brand); font-weight: 700; font-size: 1rem; }
.p-cart-item-remove { color: var(--p-faint); cursor: pointer; font-size: 1.1rem; transition: color 0.2s; }
.p-cart-item-remove:hover { color: var(--p-red); }

/* Cart Summary */
.p-cart-summary {
    background: var(--p-bg-card); border: 1px solid var(--p-border); border-radius: var(--p-radius);
    padding: 1.5rem; position: sticky; top: 80px;
}
.p-cart-summary h3 { font-family: var(--p-font-brand); font-size: 1.2rem; margin-bottom: 1rem; }
.p-cart-row { display: flex; justify-content: space-between; padding: 0.4rem 0; font-size: 0.9rem; }
.p-cart-row-total { border-top: 1px solid var(--p-border); padding-top: 0.75rem; margin-top: 0.5rem; font-weight: 700; font-size: 1.1rem; }
.p-cart-row-total .p-card-price { font-size: 1.1rem; }

/* Checkout */
.p-checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: 2rem; align-items: start; }
.p-form-card {
    background: var(--p-bg-card); border: 1px solid var(--p-border); border-radius: var(--p-radius);
    padding: 1.5rem; margin-bottom: 1.25rem;
}
.p-form-card h3 { font-family: var(--p-font-brand); font-size: 1.1rem; margin-bottom: 1rem; }
.p-form-group { margin-bottom: 1rem; }
.p-form-group label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--p-muted); margin-bottom: 0.3rem; text-transform: uppercase; letter-spacing: 0.05em; }
.p-form-group input, .p-form-group select, .p-form-group textarea {
    width: 100%; padding: 0.6rem 0.85rem; background: var(--p-bg); border: 1px solid var(--p-border);
    border-radius: var(--p-radius-sm); color: var(--p-text); font-family: var(--p-font); font-size: 0.9rem;
}
.p-form-group input:focus, .p-form-group select:focus, .p-form-group textarea:focus {
    outline: none; border-color: var(--p-primary); box-shadow: 0 0 0 3px rgba(212,168,83,0.12);
}
.p-form-group textarea { min-height: 80px; resize: vertical; }

/* Radio Cards */
.p-radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.p-radio-card {
    padding: 0.85rem; background: var(--p-bg); border: 2px solid var(--p-border);
    border-radius: var(--p-radius-sm); cursor: pointer; text-align: center; transition: all 0.2s;
}
.p-radio-card:hover { border-color: var(--p-accent); }
.p-radio-card.selected { border-color: var(--p-primary); background: rgba(212,168,83,0.08); }
.p-radio-card input { display: none; }
.p-radio-card-label { font-weight: 600; font-size: 0.9rem; }
.p-radio-card-desc { font-size: 0.75rem; color: var(--p-muted); margin-top: 0.2rem; }

/* Time Slots */
.p-slots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 0.5rem; }
.p-slot {
    padding: 0.5rem; text-align: center; font-size: 0.82rem; font-weight: 500;
    background: var(--p-bg); border: 1px solid var(--p-border); border-radius: var(--p-radius-sm);
    cursor: pointer; transition: all 0.2s;
}
.p-slot:hover { border-color: var(--p-primary); }
.p-slot.selected { background: var(--p-primary); color: #1a1a1a; border-color: var(--p-primary); }
.p-slot.disabled { opacity: 0.3; pointer-events: none; }

/* Empty State */
.p-empty { text-align: center; padding: 4rem 1rem; }
.p-empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.p-empty-title { font-family: var(--p-font-brand); font-size: 1.3rem; margin-bottom: 0.5rem; }
.p-empty-desc { color: var(--p-muted); margin-bottom: 1.5rem; }

/* Login */
.p-login-card {
    max-width: 420px; margin: 3rem auto; background: var(--p-bg-card);
    border: 1px solid var(--p-border); border-radius: var(--p-radius); padding: 2rem;
}
.p-login-card h2 { font-family: var(--p-font-brand); text-align: center; margin-bottom: 0.3rem; }
.p-login-sub { text-align: center; color: var(--p-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.p-google-btn {
    display: flex; align-items: center; justify-content: center; gap: 0.75rem;
    width: 100%; padding: 0.85rem; background: #fff; color: #333;
    border: none; border-radius: var(--p-radius-sm); font-family: var(--p-font);
    font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: opacity 0.2s;
}
.p-google-btn:hover { opacity: 0.9; }
.p-google-btn svg { width: 20px; height: 20px; }
.p-divider { text-align: center; margin: 1.25rem 0; position: relative; color: var(--p-faint); font-size: 0.8rem; }
.p-divider::before, .p-divider::after { content: ''; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--p-border); }
.p-divider::before { left: 0; }
.p-divider::after { right: 0; }

/* Admin Toggle (accordion) */
.p-admin-toggle { margin-top: 1.5rem; }
.p-admin-toggle-btn {
    display: block; width: 100%; text-align: center; font-size: 0.8rem; font-weight: 500;
    color: var(--p-faint); cursor: pointer; padding: 0.5rem; border-radius: var(--p-radius-sm);
    transition: color 0.2s; list-style: none;
}
.p-admin-toggle-btn::-webkit-details-marker { display: none; }
.p-admin-toggle-btn::marker { display: none; content: ''; }
.p-admin-toggle-btn:hover { color: var(--p-muted); }
.p-admin-toggle[open] .p-admin-toggle-btn { color: var(--p-muted); margin-bottom: 0.5rem; }
.p-admin-toggle-form {
    padding-top: 0.75rem; border-top: 1px solid var(--p-border);
}

/* Profile Card */
.p-profile-card {
    max-width: 420px; margin: 3rem auto; background: var(--p-bg-card);
    border: 1px solid var(--p-border); border-radius: var(--p-radius); padding: 2rem; text-align: center;
}
.p-profile-card h2 { font-family: var(--p-font-brand); margin-bottom: 0.3rem; }
.p-profile-sub { color: var(--p-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.p-profile-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 72px; height: 72px; border-radius: 50%; background: var(--p-bg-card-2);
    border: 2px solid var(--p-border); margin-bottom: 1rem; color: var(--p-primary);
}
.p-profile-card .p-form-group { text-align: left; }
.p-input-readonly {
    background: var(--p-bg-card-2) !important; color: var(--p-muted) !important;
    cursor: not-allowed; opacity: 0.7;
}

/* Alert */
.p-alert { padding: 0.75rem 1rem; font-size: 0.85rem; font-weight: 500; border-radius: var(--p-radius-sm); }
.p-alert-info { background: rgba(212,168,83,0.1); color: var(--p-primary); border: 1px solid rgba(212,168,83,0.2); }

/* Order Status */
.p-status-badge {
    display: inline-block; padding: 0.2rem 0.6rem; font-size: 0.7rem; font-weight: 700;
    border-radius: var(--p-radius-pill); text-transform: uppercase; letter-spacing: 0.05em;
}
.p-status-pendiente { background: rgba(212,168,83,0.15); color: var(--p-primary); }
.p-status-confirmado { background: rgba(196,154,108,0.15); color: var(--p-accent); }
.p-status-en_preparacion { background: rgba(59,130,246,0.15); color: #3b82f6; }
.p-status-listo { background: rgba(61,220,132,0.15); color: var(--p-green); }
.p-status-entregado { background: rgba(155,155,155,0.15); color: var(--p-muted); }
.p-status-cancelado { background: rgba(239,68,68,0.15); color: var(--p-red); }

/* Orders */
.p-order-card {
    background: var(--p-bg-card); border: 1px solid var(--p-border);
    border-radius: var(--p-radius); padding: 1.25rem; margin-bottom: 1rem;
}
.p-order-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.p-order-code { font-family: var(--p-font-brand); font-weight: 700; font-size: 1.1rem; }
.p-order-items { margin: 0.75rem 0; font-size: 0.9rem; color: var(--p-muted); }
.p-order-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 0.75rem; border-top: 1px solid var(--p-border); }

/* Footer */
.p-footer { background: #111; border-top: 1px solid var(--p-border); margin-top: auto; }
.p-footer-inner { display: flex; gap: 2rem; padding: 2.5rem 0; flex-wrap: wrap; }
.p-footer-brand { flex: 1; min-width: 200px; }
.p-footer-logo { height: 48px; border-radius: 8px; margin-bottom: 0.75rem; }
.p-footer-info { flex: 1; min-width: 200px; font-size: 0.9rem; color: var(--p-muted); }
.p-footer-info p { margin-bottom: 0.3rem; }
.p-footer-links { display: flex; gap: 1.5rem; font-size: 0.9rem; }
.p-footer-links a:hover { color: var(--p-primary); }
.p-footer-bottom { border-top: 1px solid var(--p-border); padding: 1rem 0; text-align: center; font-size: 0.8rem; color: var(--p-faint); }

/* Responsive */
@media (max-width: 860px) {
    .p-nav-link.hide-mobile { display: none; }
}
@media (max-width: 800px) {
    .p-cart-layout, .p-checkout-layout { grid-template-columns: 1fr; }
    .p-cart-summary { position: static; }
}
@media (max-width: 560px) {
    .p-hero { height: 260px; }
    .p-hero-title { font-size: 1.6rem; }
    .p-products-grid { grid-template-columns: 1fr; }
    .p-radio-cards { grid-template-columns: 1fr; }
    .p-footer-inner { flex-direction: column; gap: 1.5rem; }
}
