/* =================================================================
// ARCHIVO: style.css (Gestor de Productos)
// OBJETIVO: Diseño de Dashboard Full-Stack
// ================================================================= */

:root {
    --color-primary: #1f78b4; /* Azul profesional */
    --color-secondary: #33a02c; /* Verde para éxito/creación */
    --color-error: #e31a1c; /* Rojo para borrar */
    --color-edit: #ff7f00; /* Naranja para editar */
    --color-bg: #f8f9fa;
    --color-card: #ffffff;
    --color-text: #333;
    --color-border: #dee2e6;
}

body {
    background-color: var(--color-bg);
    font-family: 'Poppins', sans-serif;
    color: var(--color-text);
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: var(--color-card);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

h1 {
    color: var(--color-primary);
    text-align: center;
    margin-bottom: 5px;
}

.subtitle {
    text-align: center;
    margin-bottom: 30px;
    color: #6c757d;
}

/* ------------------ Formulario de Producto ------------------ */

.add-product-section {
    padding: 20px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 30px;
}

h2 {
    color: var(--color-text);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 5px;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.form-group {
    flex-grow: 1;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1em;
}

#submitBtn {
    padding: 12px 25px;
    background-color: var(--color-secondary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1em;
    margin-top: 15px;
    transition: background-color 0.3s;
}

#submitBtn:hover {
    background-color: #218838;
}

/* ------------------ Lista de Productos y Buscador ------------------ */

.list-controls {
    margin-bottom: 20px;
}

.list-controls h2 {
    border-bottom-color: #ccc;
}

.search-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

#search {
    flex-grow: 1;
}

#searchBtn {
    padding: 10px 20px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.product-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.product-table th, .product-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.product-table th {
    background-color: #e9ecef;
    font-weight: 700;
    color: #495057;
}

.product-table tbody tr:hover {
    background-color: #f1f1f1;
}

/* Botones de Acción de la Tabla */
.action-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    margin-right: 5px;
    transition: opacity 0.2s;
}

.action-btn:hover {
    opacity: 0.8;
}

.edit-btn {
    background-color: var(--color-edit);
    color: white;
}

.delete-btn {
    background-color: var(--color-error);
    color: white;
}