/* ====== GLOBAL ====== */
* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f9f9f9;
    margin: 0;
    padding: 0;
    color: #333;
}

/* ====== HEADER ====== */
header {
    position: relative;
    background: #2171db;
    color: white;
    text-align: center;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
header .logo {
    position: absolute;
    left: 20px;
    height: 120px;
     width: 20%;
    border-radius: 10px;     /* esquinas suaves */
    box-shadow: 0 4px 6px rgba(0,0,0,0.2); /* sombra sutil */
    background: white;       /* para que se fusione con el recuadro */
    padding: 5px;
}

.header-text {
    display: inline-block;
}
header h1 {
    margin: 0;
    font-size: 2.5em;
}

header p {
    margin: 5px 0 0;
    font-size: 1.2em;
}

.btn-admin {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    color: #ff6b6b;
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-admin:hover {
    background: #ffe0e0;
}

/* ====== MAIN / GRILLA PRODUCTOS ====== */
main {
    padding: 20px;
}

.menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* siempre 2 columnas */
    gap: 25px;
    padding: 20px;
}

/* Tarjeta producto */
.item {
        background: linear-gradient(175deg, #ffecd2, #28aff7);
    padding: 40px; /* más espacio interno */
    border-radius: 15px;
    box-shadow: 0 8px 18px rgba(0,0,0,0.25);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.3s;
    min-height: 220px; /* más alto que antes */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

/* Título producto */
.item h2 {
    font-size: 1.8em; /* más grande */
    margin-bottom: 15px;
    color: #000;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

/* Precio producto */
.item p {
    font-size: 1.5em; /* más grande */
    font-weight: bold;
    color: #000;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}
/* ====== FOOTER ====== */
footer {
    text-align: center;
    padding: 15px;
    background: #333;
    color: white;
    margin-top: 20px;
}

/* ====== LOGIN ====== */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #ff9a9e, #fad0c4);
    margin: 0;
}

.login-container {
    background: white;
    padding: 40px; /* más grande */
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    width: 350px;
    max-width: 90%;
    text-align: center;
    animation: aparecer 0.6s ease-in-out;
}

.login-container h2 {
    margin-bottom: 20px;
    color: #ff6b6b;
    font-size: 1.8em;
}

.login-container form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-container input[type="password"] {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
}

.login-container button {
    background: #ff6b6b;
    border: none;
    padding: 12px;
    color: white;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.login-container button:hover {
    background: #ff3b3b;
}

.error {
    margin-top: 10px;
    color: red;
    font-size: 0.9em;
}

.volver {
    display: inline-block;
    margin-top: 15px;
    text-decoration: none;
    color: #555;
    font-size: 0.9em;
}

.volver:hover {
    color: #000;
}

@keyframes aparecer {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ====== ADMIN ====== */
.admin-body {
    background: #f4f6f9;
    margin: 0;
    padding: 0;
}

.admin-header {
    background: #4a90e2;
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.admin-header h1 {
    margin: 0;
    font-size: 2em;
}

.admin-main {
    padding: 20px;
    width: 100%;
    max-width: 1000px;
    margin: auto;
}

/* Formularios */
.form-section, .list-section {
    margin-bottom: 30px;
}

.form-card, .form-inline {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.form-card input, .form-inline input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
}

.form-card input { width: 100%; margin-bottom: 15px; }
.form-inline input[name="nombre"] { flex: 2; }
.form-inline input[name="precio"] { flex: 1; }

.form-card button, .form-inline button {
    width: 100%;
    background: #28a745;
    border: none;
    padding: 12px;
    color: white;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.form-card button:hover, .form-inline button:hover {
    background: #218838;
}

/* Tabla productos */
.list-section { overflow-x: auto; }

.tabla-productos {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    border-radius: 12px;
    overflow: hidden;
}

.tabla-productos th, .tabla-productos td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.tabla-productos th {
    background: #4a90e2;
    color: white;
    font-weight: bold;
}

.tabla-productos tr:hover { background: #f1f1f1; }

/* Botones editar / eliminar */
.btn-editar, .btn-eliminar {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9em;
    transition: all 0.3s ease;
    color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.btn-editar {
    background: linear-gradient(135deg, #ffb347, #ffcc33);
}

.btn-editar:hover {
    background: linear-gradient(135deg, #e69a2e, #f2b600);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.btn-eliminar {
    background: linear-gradient(135deg, #ff6b6b, #ff4757);
}

.btn-eliminar:hover {
    background: linear-gradient(135deg, #e74c3c, #d63031);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* ====== RESPONSIVE ====== */
@media (max-width: 900px) {
    header h1 { font-size: 1.8em; }
    header p { font-size: 0.9em; }
    .item h2 { font-size: 1.3em; }
    .item p { font-size: 1.1em; }
}

@media (max-width: 600px) {
    header h1 { font-size: 1.5em; }
    header p { font-size: 0.85em; }
    .btn-admin { position: static; display: inline-block; margin-top: 10px; }

    .menu { grid-template-columns: 1fr; padding: 10px; gap: 15px; }

    .item { padding: 20px; min-height: 150px; }
    .item h2 { font-size: 1.2em; }
    .item p { font-size: 1.1em; }

    footer { font-size: 0.9em; padding: 10px; }

    .form-inline { flex-direction: column; align-items: stretch; }
    .form-inline input, .form-inline button { width: 100%; }

    .login-container { width: 90%; padding: 30px; }
}
