body{
    font-family: 'Segoe UI', Arial, sans-serif;
    background:#f5f7fb;
    color:#333;
    margin:0;
}

/* HEADER */
header{
    text-align:center;
    padding:40px 20px;
    background:linear-gradient(135deg,#0d6efd,#3aa0ff);
    color:white;
}

header h1{
    margin:0;
    font-size:40px;
}

header p{
    margin-top:10px;
    font-size:18px;
    opacity:0.9;
}

header input{
    padding:12px;
    width:260px;
    margin-top:15px;
    border-radius:30px;
    border:none;
    outline:none;
    box-shadow:0 2px 10px rgba(0,0,0,0.15);
}

/* BOTONES SUPERIORES */
nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 15px 10px;
}

button{
    padding:12px 22px;
    margin:0;
    border:none;
    border-radius:30px;
    background:#0d6efd;
    color:white;
    font-weight:600;
    cursor:pointer;
    transition:all 0.3s;
    box-shadow:0 4px 12px rgba(0,0,0,0.15);
}

button:hover{
    background:#0b5ed7;
    transform:translateY(-2px);
}

/* PRODUCTOS */
#productos{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
    gap:25px;
    padding:40px;
}

/* TARJETAS */
.card{
    background:white;
    padding:18px;
    border-radius:15px;
    box-shadow:0 6px 20px rgba(0,0,0,0.08);
    transition:all 0.3s;
}

.card:hover{
    transform:translateY(-5px);
    box-shadow:0 12px 30px rgba(0,0,0,0.15);
}

.card img{
    width:100%;
    border-radius:10px;
    height: auto;
    max-height: 250px;
    object-fit: contain;
}

.card h3{
    margin-top:10px;
}

.precio{
    color:#00a86b;
    font-size:22px;
    font-weight:bold;
    margin-top:5px;
}

.card a {
    display: inline-block;
    padding: 8px 0;
    color: #0d6efd;
    text-decoration: none;
    font-weight: 500;
}

.card button {
    width: 100%;
    margin-top: 10px;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-contenido {
    background-color: #fefefe;
    margin: 30px auto;
    padding: 20px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: modalSlideIn 0.3s ease;
}

.modal-pago {
    max-width: 500px;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    color: #333;
}

.cerrar {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.cerrar:hover {
    color: #333;
}

/* CARRITO */
#carritoContenido, #envioContenido {
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px;
}

.item-carrito {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.item-info {
    flex: 2;
}

.item-nombre {
    font-weight: 600;
    margin-bottom: 5px;
}

.item-precio {
    color: #00a86b;
    font-weight: 500;
}

.item-cantidad {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-cantidad {
    padding: 5px 10px;
    background: #f0f0f0;
    color: #333;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

.btn-cantidad:hover {
    background: #e0e0e0;
}

.item-eliminar {
    color: #dc3545;
    cursor: pointer;
    font-size: 20px;
    margin-left: 15px;
}

.item-eliminar:hover {
    color: #c82333;
}

.carrito-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
    font-size: 20px;
    font-weight: bold;
}

.acciones-carrito {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-secundario {
    background: #6c757d;
    flex: 1;
}

.btn-secundario:hover {
    background: #5a6268;
}

.btn-peligro {
    background: #dc3545;
}

.btn-peligro:hover {
    background: #c82333;
}

.btn-pago {
    width: 100%;
    padding: 15px;
    background: #00a86b;
    font-size: 18px;
    margin-top: 20px;
}

.btn-pago:hover {
    background: #00955e;
}

.btn-whatsapp {
    width: 100%;
    padding: 15px;
    background: #25D366;
    font-size: 18px;
    margin-top: 10px;
}

.btn-whatsapp:hover {
    background: #20B858;
}

/* FORMULARIO DE ENVÍO */
.form-envio {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #555;
}

.form-group input, .form-group select, .form-group textarea {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: 0.3s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #0d6efd;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.resumen-compra {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
}

.resumen-item {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
}

.resumen-total {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #ddd;
    font-weight: bold;
    font-size: 18px;
}

/* FOOTER */
footer{
    text-align:center;
    padding:30px;
    background:#0d6efd;
    color:white;
    margin-top:40px;
}

/* BOTON WHATSAPP FLOTANTE */
.whatsapp{
    position:fixed;
    bottom:25px;
    right:25px;
    background:#25D366;
    color:white;
    padding:14px 22px;
    border-radius:50px;
    text-decoration:none;
    font-size:16px;
    font-weight:bold;
    box-shadow:0 6px 15px rgba(0,0,0,0.2);
    transition:0.3s;
    z-index: 1000;
}

.whatsapp:hover{
    transform:scale(1.05);
}

/* Botón ver carrito superior */
body > button:first-of-type {
    position: sticky;
    top: 10px;
    left: 10px;
    z-index: 100;
    margin: 10px;
}

/* VERSIÓN MÓVIL */
@media (max-width: 600px) {

    header {
        padding: 30px 15px;
    }

    header h1 {
        font-size: 32px;
    }

    header p {
        font-size: 16px;
        padding: 0 10px;
    }

    header input {
        width: 90%;
        max-width: 300px;
    }

    button {
        padding: 10px 16px;
        font-size: 14px;
        flex: 1 1 auto;
        min-width: 100px;
    }

    #productos {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px 15px;
    }

    .card {
        padding: 15px;
    }

    .card h3 {
        font-size: 16px;
    }

    .card p {
        font-size: 14px;
        margin: 8px 0;
    }

    .precio {
        font-size: 20px;
    }

    footer {
        padding: 25px 15px;
        font-size: 14px;
    }

    footer p {
        margin: 8px 0;
    }

    .whatsapp {
        bottom: 15px;
        right: 15px;
        padding: 12px 18px;
        font-size: 14px;
    }

    body > button:first-of-type {
        width: calc(100% - 20px);
        margin: 10px;
        position: sticky;
        top: 10px;
    }

    .modal-contenido {
        margin: 10px;
        padding: 15px;
        width: auto;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .acciones-carrito {
        flex-direction: column;
    }
}