/* ============================================================
 * CATÁLOGO DE PRODUCTOS — Kome Sabor Casero
 * ============================================================ */

.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }

/* Toolbar */
.cat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.cat-toolbar-right {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.cat-toolbar-right input[type=search] {
    width: 220px;
    max-width: 100%;
}
.cat-toolbar-right .btn { white-space: nowrap; }

/* Resumen */
.cat-resumen {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 14px;
}
.cat-resumen .cat-stat {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    border: 1px solid #eee;
}
.cat-resumen .cat-stat-num { font-size: 1.5rem; font-weight: 700; color: #2a2a2a; }
.cat-resumen .cat-stat-label { font-size: 0.72rem; color: #888; text-transform: uppercase; letter-spacing: 0.3px; margin-top: 2px; }

/* Tabs */
.cat-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.cat-tab {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all .2s;
}
.cat-tab:hover { border-color: #999; background: #f8f9fa; }
.cat-tab.active { background: #2a2a2a; color: #fff; border-color: #2a2a2a; }

/* Grupos de categoría */
.cat-grupo-titulo {
    font-size: 0.9rem;
    font-weight: 700;
    color: #2a2a2a;
    margin: 16px 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cat-grupo-titulo:first-child { margin-top: 0; }

/* Lista de productos */
.cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    margin-bottom: 6px;
    transition: box-shadow .15s, border-color .15s;
}
.cat-item:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    border-color: #ddd;
}
.cat-item .cat-nombre { font-size: 0.9rem; color: #333; }
.cat-item .cat-acciones { display: flex; gap: 6px; }
.cat-item .cat-btn {
    border: none;
    background: #f0f0f0;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .1s;
}
.cat-btn.editar:hover { background: #d0ebff; }
.cat-btn.borrar:hover { background: #ffe3e3; }
.cat-btn:active { transform: scale(0.9); }

.cat-vacio {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 0.9rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeIn .2s ease;
}
.modal-box {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
    animation: slideUp .25s ease;
}
.modal-box h3 { font-size: 1.15rem; color: #2a2a2a; margin-bottom: 16px; }
.modal-box label { display:block; font-weight:600; margin:10px 0 4px; color:#444; font-size:0.8rem; }
.modal-error { color: #c0392b; font-size: 0.8rem; margin-top: 8px; min-height: 18px; }
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive */
@media (max-width: 600px) {
    .cat-toolbar-right { width: 100%; }
    .cat-toolbar-right input[type=search] { flex: 1; width: auto; }
    .cat-resumen { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .cat-resumen .cat-stat-num { font-size: 1.2rem; }
}
