/* --- IMPORTACIÓN DE FUENTES ELEGANTES --- */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;1,400&family=Nunito:wght@300;400;600;700&display=swap');

/* --- CONFIGURACIÓN GENERAL (ESTILO APP MODERNA) --- */
* {
    box-sizing: border-box;
}

body { 
    font-family: 'Nunito', sans-serif; 
    background-color: #f1f5f9; /* Gris azulado muy limpio, hace destacar las tarjetas blancas */
    color: #334155; 
    margin: 0; 
    padding: 0; 
    -webkit-font-smoothing: antialiased;
    font-size: 16px; 
}

/* --- CABECERA PRINCIPAL REFINADA --- */
.cabecera-principal { 
    text-align: center; 
    background: #ffffff; 
    padding: 35px 20px; 
    border-bottom: 1px solid #e2e8f0; 
    position: relative; 
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); 
}

.cabecera-principal h1 { 
    font-family: 'Lora', serif;
    margin: 0; 
    font-weight: 600;
    font-size: 2.6rem; 
    color: #0f172a; /* Slate oscuro, máxima elegancia */
    letter-spacing: -0.5px;
}

/* --- CONTENEDOR CENTRAL --- */
.contenedor-admin { 
    max-width: 1200px; 
    margin: 40px auto; 
    padding: 0 24px 60px 24px; 
}

/* --- TÍTULOS DE SECCIÓN --- */
h2 {
    font-family: 'Lora', serif;
    text-align: center;
    font-size: 2rem !important; 
    color: #1e293b;
    margin-top: 40px !important;
    margin-bottom: 40px !important;
}

h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 4px;
    background: #6d9788; 
    margin: 12px auto 0;
    border-radius: 10px;
}

/* --- BOTONES GENERALES (ESTILO PÍLDORA PREMIUM) --- */
.btn-ver, .btn-comprar { 
    display: inline-block;
    background: linear-gradient(135deg, #6d9788 0%, #547c6e 100%);
    color: #ffffff; 
    padding: 14px 28px; 
    text-decoration: none; 
    border-radius: 8px; 
    font-weight: 600; 
    font-size: 0.95rem; 
    transition: all 0.25s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(109, 151, 136, 0.25);
}

.btn-ver:hover, .btn-comprar:hover {
    transform: translateY(-2px); 
    box-shadow: 0 6px 20px rgba(109, 151, 136, 0.4);
    filter: brightness(1.1);
}

.btn-volver { 
    background: #ffffff; 
    color: #475569; 
    padding: 10px 20px; 
    text-decoration: none; 
    border-radius: 8px; 
    display: inline-block; 
    cursor: pointer; 
    border: 1px solid #cbd5e1; 
    transition: all 0.2s;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-volver:hover { 
    background: #f8fafc; 
    color: #1e293b;
    border-color: #94a3b8; 
}

/* --- TABLA DEL PANEL DE CONTROL (REDISEÑO TOTAL) --- */
.tabla-admin { 
    width: 100%; 
    border-collapse: separate; 
    border-spacing: 0;
    background: #ffffff; 
    border-radius: 12px; /* Bordes redondeados en la tabla */
    overflow: hidden; 
    font-size: 0.95rem; 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.tabla-admin th { 
    background: #f8fafc; /* Gris muy claro para la cabecera */
    color: #475569; 
    padding: 16px 20px; 
    font-weight: 700; 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
    font-size: 0.8rem;
    border-bottom: 2px solid #e2e8f0;
    text-align: left;
}

.tabla-admin td { 
    padding: 16px 20px; 
    border-bottom: 1px solid #f1f5f9; 
    color: #334155;
    vertical-align: middle;
    text-align: left;
    transition: background-color 0.2s ease;
}

/* Filas alternas (Zebra striping) */
.tabla-admin tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

/* Efecto hover en la fila completa */
.tabla-admin tbody tr:hover td {
    background-color: #f1f5f9; 
}

/* Alineación de columnas específicas (Sincronizado) */
.tabla-admin th:nth-child(2), .tabla-admin td:nth-child(2),
.tabla-admin th:nth-child(3), .tabla-admin td:nth-child(3),
.tabla-admin th:nth-child(4), .tabla-admin td:nth-child(4) {
    text-align: center;
}

/* --- BOTONES DE ACCIÓN (ESTILO "CHIPS" INTERACTIVOS) --- */
.tabla-admin td a {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

/* Botón Editar Especializado */
.tabla-admin td a[href*="editar_producto"] {
    color: #0284c7 !important;
    background-color: rgba(2, 132, 199, 0.08);
}
.tabla-admin td a[href*="editar_producto"]:hover {
    background-color: #0284c7;
    color: #ffffff !important;
    text-shadow: none;
}

/* Botón Borrar Especializado */
.tabla-admin td a[href*="acciones_producto"] {
    color: #dc2626 !important;
    background-color: rgba(220, 38, 38, 0.08);
}
.tabla-admin td a[href*="acciones_producto"]:hover {
    background-color: #dc2626;
    color: #ffffff !important;
    text-shadow: none;
}


/* --- FORMULARIO DE INSERCIÓN/EDICIÓN --- */
.formulario-admin { 
    background: #ffffff; 
    padding: 40px; 
    border-radius: 12px; 
    border: 1px solid #e2e8f0; 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05); 
}

.formulario-admin h3 { 
    color: #0f172a !important; 
    font-family: 'Lora', serif; 
    font-size: 1.4rem;
    font-weight: 600;
}

.grupo-form { margin-bottom: 24px; display: flex; flex-direction: column; }
.grupo-form label { font-size: 0.9rem; margin-bottom: 8px; font-weight: 600; color: #475569; }

.grupo-form input[type="text"], 
.grupo-form input[type="number"], 
.grupo-form textarea { 
    padding: 12px 16px; 
    background: #f8fafc; 
    border: 1px solid #cbd5e1; 
    color: #1e293b; 
    border-radius: 6px; 
    font-family: 'Nunito', sans-serif; 
    font-size: 0.95rem; 
    transition: all 0.2s ease; 
}

/* Animación de enfoque en los inputs */
.grupo-form input:focus, .grupo-form textarea:focus { 
    outline: none; 
    border-color: #6d9788; 
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(109, 151, 136, 0.15);
}

/* Estilo para el input file */
.grupo-form input[type="file"] {
    padding: 8px 0;
    font-family: 'Nunito', sans-serif;
    color: #64748b;
}

.form-fila { display: flex; gap: 24px; }
.form-fila .grupo-form { flex: 1; }


/* --- TIENDA PÚBLICA: TARJETAS DE PRODUCTO --- */
.catalogo-container { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 40px; 
    justify-content: center; 
    padding: 0 20px 60px 20px; 
    max-width: 1200px;
    margin: 0 auto;
}

.tarjeta-producto { 
    background: #ffffff; 
    border: 1px solid #e2e8f0; 
    border-radius: 8px; 
    width: 280px; 
    padding: 24px; 
    text-align: center; 
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1); 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02); 
    display: flex;
    flex-direction: column;
}

.tarjeta-producto:hover { 
    transform: translateY(-6px); 
    border-color: #6d9788; 
    box-shadow: 0 20px 25px -5px rgba(109, 151, 136, 0.15), 0 10px 10px -5px rgba(109, 151, 136, 0.04); 
}

.tarjeta-producto img { 
    width: 100%; 
    height: 240px; 
    object-fit: contain; 
    margin-bottom: 20px;
    background-color: #f8fafc;
    border-radius: 6px;
    padding: 12px;
    border: 1px solid #f1f5f9;
}

/* --- ANIMACIÓN DE APARICIÓN SUAVE --- */
@keyframes aparicionSuave {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.tarjeta-producto { animation: aparicionSuave 0.6s cubic-bezier(0.165, 0.84, 0.44, 1) forwards; opacity: 0; }
.tarjeta-producto:nth-child(1) { animation-delay: 0.05s; }
.tabla-admin { animation: aparicionSuave 0.5s ease-out; }
.formulario-admin { animation: aparicionSuave 0.6s ease-out; }