/* ============================
   RESET Y BASE
============================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    font-size: 16px;
    background: #f2f4f7;
    color: #333;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ============================
   CONTENEDOR PRINCIPAL
============================ */
.app-container {
    width: 95%;
    max-width: 900px;
    margin: 20px auto;
    padding: clamp(15px, 5vw, 30px);
}

/* ============================
   CABECERA
============================ */
header h1 {
    font-size: clamp(2rem, 6vw, 3rem);
    color: #27ae60;
    text-align: center;
    margin-bottom: 20px;
}

/* ============================
   FORMULARIO
============================ */
.form-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: clamp(10px, 2vw, 15px);
    margin-bottom: 25px;
}

.form-item input,
.form-item select,
.form-item button {
    width: 100%;
    padding: clamp(12px, 3vw, 16px);
    font-size: clamp(1rem, 2vw, 1.2rem);
    border-radius: 12px;
    border: 1px solid #ccc;
    outline: none;
    box-shadow: 0 3px 6px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.form-item input:focus,
.form-item select:focus {
    border-color: #27ae60;
    box-shadow: 0 4px 12px rgba(39,174,96,0.2);
}

.form-item button {
    background: #27ae60;
    color: #fff;
    font-weight: bold;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(39,174,96,0.3);
    transition: 0.3s;
}

.form-item button:hover {
    background: #219150;
    transform: translateY(-2px);
}

/* ============================
   LISTA DE ITEMS
============================ */
.lista h2.tienda {
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: #444;
    margin: 20px 0 10px 0;
    border-bottom: 2px solid #ddd;
    padding-bottom: 5px;
}

.item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: clamp(10px, 2vw, 15px);
    margin-bottom: 10px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.item .nombre {
    flex: 2 1 60%;
    font-size: clamp(1.2rem, 2vw, 1.4rem);
    word-break: break-word;
}

.item .precio {
    flex: 1 1 20%;
    font-size: clamp(1.1rem, 1.5vw, 1.3rem);
    color: #555;
    text-align: right;
}

.btn-borrar {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #e74c3c;
    font-size: clamp(1.4rem, 2vw, 1.6rem);
    cursor: pointer;
    transition: color 0.2s ease;
}

.btn-borrar:hover {
    color: #c0392b;
}

/* ============================
   RESPONSIVE MÓVIL
============================ */
@media (max-width: 600px) {
    /* Formulario en columna completa */
    .form-section {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .form-item {
        flex: 1 1 100%;
    }

    /* Botón agregar centrado y grande */
    .form-item button {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        display: block;
    }

    .form-item input,
    .form-item select,
    .form-item button {
        font-size: 1.4rem;
        padding: 16px;
    }

    /* Items en columna */
    .item {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
    }

    .item .precio {
        text-align: left;
        margin-top: 5px;
    }

    .btn-borrar {
        align-self: flex-end;
        margin-top: 8px;
    }
}
