/*
    css/general.css
    Propósito: estilos compartidos principales para la mayoría de páginas (tema verde/dorado).
    Contiene: tipografías, contenedor principal, estilos de formularios, botones, grid de productos y responsive.

    Notas de uso:
        - Preferir clases aquí para consistencia entre páginas. Evitar estilos inline en los PHP.
        - Si hay conflictos con css/style.css, decidir cuál es la fuente de verdad y eliminar duplicados.
*/
/* ---------- FUENTES ---------- */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@300;700&family=Poppins:wght@300;500&display=swap');

/* ---------- FONDO GENERAL ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(180deg, #0f3f14, #2f6b20, #3a7c24);
    font-family: 'Poppins', sans-serif;
    color: #333;
    min-height: 100vh;
    padding: 20px;
}

/* ---------- CONTENEDOR PRINCIPAL ---------- */
.container {
    max-width: 1000px;
    margin: 30px auto;
    background: #faf2dd;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* ---------- TÍTULOS ---------- */
h1 {
    font-family: 'Merriweather', serif;
    color: #2f6b20;
    font-size: 32px;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h2 {
    font-family: 'Merriweather', serif;
    color: #2f6b20;
    font-size: 24px;
    margin-bottom: 15px;
}

h3 {
    color: #3a7c24;
    margin-top: 15px;
    margin-bottom: 10px;
}

/* ---------- FORMULARIOS ---------- */
form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

label {
    font-weight: 600;
    color: #2f6b20;
    font-size: 14px;
    margin-top: 8px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 10px;
    background: #fff8e7;
    border: 1px solid #d1b676;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: .3s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus {
    border-color: #e8b23a;
    box-shadow: 0 0 6px rgba(255, 196, 0, 0.6);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* ---------- BOTONES ---------- */
input[type="submit"],
.btn,
.agregar-btn,
    .productor-btn,
.contactar-btn,
.volver-btn,
.eliminar-btn{
    width: 100%;
    padding: 15px;
    background: linear-gradient(180deg, #ffce48, #e8b23a);
    border: none;
    border-radius: 10px;
    font-size: 16px;
    color: #4a3a00;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: .3s;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}
.modificar-btn {
    width: 49%;
    padding: 15px;
    background: linear-gradient(180deg, #48ff48, #3ae86e);
    border: none;
    border-radius: 10px;
    font-size: 16px;
    color: #4a3a00;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: .3s;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

input[type="submit"]:hover,
.btn:hover,
.agregar-btn:hover,
    .productor-btn:hover,
.contactar-btn:hover,
.volver-btn:hover,
.eliminar-btn:hover,
.modificar-btn:hover
 {
    background: linear-gradient(180deg, #ffd968, #f0b93d);
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

/* Botones alternativos */
.btn-secondary {
    background: linear-gradient(180deg, #3c47e7, #2b3fc0);
    color: #fff;
    width: 20%;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: .3s;
    font-family: 'Poppins', sans-serif;
    display: inline-block;
    text-align: center;
}

.btn-danger {
    background: linear-gradient(180deg, #e74c3c, #c0392b);
    color: #fff;
    width: 49%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: .3s;
    font-family: 'Poppins', sans-serif;
    display: inline-block;
    text-align: center;
}


/* ---------- GRILLAS Y TARJETAS ---------- */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.producto-card {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform .3s, box-shadow .3s;
}

.producto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.producto-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
}

.producto-info {
    margin-top: 10px;
}

.producto-info h3 {
    margin: 8px 0;
    color: #2f6b20;
}

.precio {
    color: #2ecc71;
    font-weight: 700;
    font-size: 1.1em;
}

.productor {
    color: #555;
    font-style: italic;
    font-size: 14px;
}

.descripcion {
    color: #555;
    margin: 8px 0;
    font-size: 14px;
}

/* ---------- TABLAS ---------- */
.table,
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th,
table td {
    border: 1px solid #d1b676;
    padding: 12px;
    text-align: left;
}

table th {
    background: linear-gradient(180deg, #ffce48, #e8b23a);
    color: #4a3a00;
    font-weight: 600;
}

table tr:nth-child(even) {
    background: #fff8e7;
}

table tr:hover {
    background: #fef5d9;
}

/* ---------- INFORMACIÓN DEL PRODUCTOR ---------- */
.productor-info {
    margin-top: 20px;
}

.info-item {
    margin-bottom: 5px;
    padding: 8px;
    background: #fff8e7;
    border-left: 4px solid #ffce48;
    border-radius: 6px;
}

.info-item strong {
    color: #2f6b20;
    display: block;
    margin-bottom: 5px;
}

/* ---------- MENSAJES ---------- */
.error {
    color: #c0392b;
    background: #fadbd8;
    padding: 12px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #c0392b;
}

.success {
    color: #27ae60;
    background: #d5f4e6;
    padding: 12px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #27ae60;
}

.info {
    color: #2980b9;
    background: #d6eaf8;
    padding: 12px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #2980b9;
}

/* ---------- ENLACES ---------- */
a {
    color: #2f6b20;
    text-decoration: none;
    transition: .3s;
}

a:hover {
    color: #ffce48;
    text-decoration: underline;
}

p {
    margin: 10px 0;
    line-height: 1.6;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 20px auto;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    .productos-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    table {
        font-size: 14px;
    }

    table th,
    table td {
        padding: 8px;
    }

    input[type="submit"],
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
        margin: 15px auto;
    }

    h1 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .productos-grid {
        grid-template-columns: 1fr;
    }

    form {
        gap: 10px;
    }
    
}
