@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

:root {
    --primary: #1a73e8; /* Google Blue */
    --primary-hover: #174ea6;
    --success: #1e8e3e; /* Google Green */
    --success-hover: #188038;
    --background: #f8f9fa; /* Google Light Gray */
    --surface: #ffffff;
    --text: #202124;
    --text-secondary: #5f6368;
    --border: #dadce0;
    --shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    --shadow-hover: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
    --radius: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text);
    padding-bottom: 90px; /* Espacio para botón flotante */
    -webkit-font-smoothing: antialiased;
}

.container {
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
}

h1, h2, h3 {
    text-align: center;
    margin-bottom: 24px;
    margin-top: 16px;
    font-weight: 400;
    color: var(--text);
}

.producto-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.2s ease-in-out;
}

.producto-card:hover {
    box-shadow: var(--shadow);
}

.producto-info {
    flex-grow: 1;
}

.producto-nombre {
    font-weight: 500;
    font-size: 16px;
    color: var(--text);
    margin-bottom: 4px;
}

.producto-descripcion {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.producto-precio {
    color: var(--text);
    font-size: 18px;
    font-weight: 500;
}

.producto-controles {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-cantidad {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-cantidad:active {
    background: #e8f0fe; /* Google blue light */
}

.cantidad {
    font-size: 16px;
    font-weight: 500;
    min-width: 24px;
    text-align: center;
}

.btn-flotante {
    position: fixed;
    bottom: 16px;
    left: 16px;
    width: calc(100% - 32px);
    max-width: 568px;
    margin: 0 auto;
    right: 16px;
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.25px;
    text-decoration: none;
    border: none;
    border-radius: 24px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none;
    transition: background 0.2s;
}

.btn-flotante:active {
    background: var(--primary-hover);
}

.btn-flotante.visible {
    display: block;
}

/* Formularios */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 16px;
    color: var(--text);
    transition: border-color 0.2s;
    background: var(--surface);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    border-width: 2px;
    padding: 11px 15px; /* Compensa el borde más ancho */
}

.btn-block {
    display: block;
    width: 100%;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    text-align: center;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.25px;
    text-decoration: none;
    margin-top: 16px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.btn-block:hover {
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

.btn-block:active {
    background: var(--primary-hover);
}

.btn-block.success {
    background: var(--success);
}

.btn-block.success:active {
    background: var(--success-hover);
}

.resumen-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
}

.resumen-total {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    font-size: 18px;
    font-weight: 500;
    color: var(--text);
}

.box { 
    background: var(--surface); 
    padding: 24px; 
    border-radius: var(--radius); 
    border: 1px solid var(--border); 
    margin-bottom: 24px; 
}

.nav-admin { 
    background: var(--surface); 
    padding: 12px 16px; 
    display: flex; 
    gap: 8px; 
    overflow-x: auto; 
    border-bottom: 1px solid var(--border);
}

.nav-admin a { 
    color: var(--text-secondary); 
    text-decoration: none; 
    padding: 8px 16px; 
    border-radius: 16px; 
    white-space: nowrap; 
    font-size: 14px;
    font-weight: 500;
}

.nav-admin a.active {
    background: #e8f0fe;
    color: var(--primary);
}

/* ───────────── ALERTAS ───────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
    border-left: 4px solid transparent;
}
.alert-success { background: #d4edda; color: #155724; border-color: #28a745; }
.alert-error   { background: #f8d7da; color: #721c24; border-color: #dc3545; }
.alert-warning { background: #fff3cd; color: #856404; border-color: #ffc107; }
.alert-info    { background: #d1ecf1; color: #0c5460; border-color: #17a2b8; }

/* ───────────── NAV CLIENTE ───────────── */
.nav-cliente {
    background: var(--primary);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}
.nav-cliente-izq { display: flex; align-items: center; gap: 12px; }
.nav-cliente-nombre { font-size: 14px; font-weight: 500; }
.nav-cliente a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.18);
    transition: background 0.2s;
}
.nav-cliente a:hover { background: rgba(255,255,255,0.3); }

/* ───────────── BUSCADOR ───────────── */
.search-box {
    position: relative;
    margin-bottom: 12px;
}
.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 18px;
    pointer-events: none;
    line-height: 1;
}
.search-input {
    width: 100%;
    padding: 11px 16px 11px 42px;
    border: 1px solid var(--border);
    border-radius: 24px;
    font-size: 15px;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26,115,232,0.15);
}

/* ───────────── FILTROS CATEGORÍA ───────────── */
.cat-filtros {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 16px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}
.cat-filtros::-webkit-scrollbar { height: 0; }
.cat-btn {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}
.cat-btn:hover  { border-color: var(--primary); color: var(--primary); }
.cat-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ───────────── SIN RESULTADOS ───────────── */
.sin-resultados {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    display: none;
}
.sin-resultados-icon { font-size: 40px; margin-bottom: 8px; }

/* ───────────── CATEGORÍA TAG EN PRODUCTO ───────────── */
.cat-tag {
    display: inline-block;
    font-size: 11px;
    color: var(--primary);
    background: #e8f0fe;
    border-radius: 10px;
    padding: 1px 8px;
    margin-bottom: 4px;
    font-weight: 500;
}

/* ───────────── ESTADO BADGE ───────────── */
.estado-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.estado-Pendiente       { background: #fff3cd; color: #856404; }
.estado-En-preparacion  { background: #d1ecf1; color: #0c5460; }
.estado-Listo           { background: #cce5ff; color: #004085; }
.estado-Entregado       { background: #d4edda; color: #155724; }
.estado-Cancelado       { background: #f8d7da; color: #721c24; }

/* ───────────── MIS PEDIDOS (CLIENTE) ───────────── */
.mi-pedido-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    transition: box-shadow 0.2s;
}
.mi-pedido-card:hover { box-shadow: var(--shadow); }
.mi-pedido-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.mi-pedido-num { font-weight: 500; font-size: 15px; }
.mi-pedido-meta { font-size: 13px; color: var(--text-secondary); margin-top: 6px; }

/* ───────────── SPINNER ───────────── */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────────── STATS ADMIN ───────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 8px;
    text-align: center;
}
.stat-numero { font-size: 26px; font-weight: 700; color: var(--primary); line-height: 1.2; }
.stat-label  { font-size: 11px; color: var(--text-secondary); font-weight: 500; margin-top: 2px; }
.stat-pendiente .stat-numero  { color: #856404; }
.stat-prep .stat-numero      { color: #17a2b8; }
.stat-listo .stat-numero     { color: #004085; }

/* ───────────── BADGE GENÉRICO ───────────── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}
.badge-activo   { background: #d4edda; color: #155724; }
.badge-inactivo { background: #f8d7da; color: #721c24; }

/* ───────────── PROD CARD ADMIN ───────────── */
.prod-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: box-shadow 0.2s;
}
.prod-card:hover { box-shadow: var(--shadow); }
.prod-card-info { flex-grow: 1; min-width: 0; }
.prod-card-nombre { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-card-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.prod-card-precio { font-weight: 600; font-size: 15px; white-space: nowrap; }
