* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #f3f3f3;
    color: #222;
    font-family: Arial, Helvetica, sans-serif;
}

.pagina {
    width: 100%;
    max-width: 1200px;
    min-height: 100vh;
    margin: 0 auto;
    background: #fff;
}

.cabecera {
    padding: 20px;
    text-align: center;
}

.logo {
    display: block;
    width: 100%;
    max-width: 900px;
    height: auto;
    margin: 0 auto 25px;
}

.menu {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 15px;
    background: #111;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
}

.menu-boton {
    display: inline-block;
    padding: 12px 22px;
    color: #fff;
    background: #333;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: 8px;
    transition: background .2s ease, transform .2s ease;
}

.menu-boton:hover {
    background: #555;
    transform: translateY(-2px);
}

.menu-boton.activo {
    background: #b80000;
    border-color: #fff;
}

.contenido {
    padding: 25px 15px 50px;
}

.titulo-categoria {
    margin: 0 0 30px;
    text-align: center;
    font-size: 32px;
}

.producto {
    width: 100%;
    margin-bottom: 3rem;
    text-align: center;
}

.producto-imagen {
    display: block;
    width: 100%;
    max-width: 1000px;
    height: auto;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .15);
}

.enlace-comprar {
    display: inline-block;
    margin-top: 25px;
    text-decoration: none;
}

.boton-comprar-imagen {
    display: block;
    width: 100%;
    max-width: 320px;
    height: auto;
    margin: 0 auto;
    cursor: pointer;
    transition: transform .2s ease, opacity .2s ease;
}

.boton-comprar-imagen:hover {
    transform: scale(1.04);
    opacity: .9;
}

.mensaje {
    max-width: 700px;
    margin: 30px auto;
    padding: 25px;
    background: #eee;
    border-radius: 10px;
    text-align: center;
    font-size: 18px;
}

/* Formulario */

.pagina-formulario {
    padding: 20px;
    background: #eee;
}

.formulario-contenedor {
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, .15);
}

.formulario-contenedor h1 {
    margin: 0 0 30px;
    text-align: center;
}

fieldset {
    margin: 0 0 25px;
    padding: 25px;
    border: 1px solid #ccc;
    border-radius: 10px;
}

legend {
    padding: 0 10px;
    font-size: 20px;
    font-weight: bold;
}

.producto-seleccionado {
    margin-bottom: 30px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 10px;
    text-align: center;
}

.producto-seleccionado img {
    display: block;
    width: 100%;
    max-width: 500px;
    height: auto;
    margin: 0 auto 15px;
    border-radius: 8px;
}

.producto-seleccionado strong {
    display: block;
    font-size: 19px;
}

.grupo {
    margin-bottom: 18px;
}

.grupo-superior {
    margin-top: 20px;
}

.grupo > label {
    display: block;
    margin-bottom: 7px;
    font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 13px;
    font-size: 16px;
    border: 1px solid #aaa;
    border-radius: 7px;
}

textarea {
    min-height: 130px;
    resize: vertical;
}

.opciones {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.opcion {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    background: #f3f3f3;
    border: 1px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    font-weight: normal;
}

.opcion input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.campos-condicionales {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background: #f8f8f8;
    border-left: 5px solid #b80000;
    border-radius: 7px;
}

.alias {
    padding: 18px;
    background: #e8f5e9;
    border: 2px solid #298c3c;
    border-radius: 8px;
    text-align: center;
    font-size: 21px;
}

.alias strong {
    display: block;
    margin-top: 8px;
    font-size: 27px;
}

.boton-finalizar {
    display: block;
    width: 100%;
    padding: 18px;
    color: #fff;
    background: #b80000;
    font-size: 21px;
    font-weight: bold;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
}

.boton-finalizar:hover {
    background: #910000;
}

.errores {
    margin-bottom: 25px;
    padding: 20px;
    color: #8b0000;
    background: #ffe5e5;
    border: 1px solid #e00000;
    border-radius: 8px;
}

.errores ul {
    margin: 10px 0 0;
}

.confirmacion {
    padding: 30px;
    color: #155724;
    background: #d4edda;
    border: 2px solid #28a745;
    border-radius: 12px;
    text-align: center;
}

.confirmacion h2 {
    margin-top: 0;
}

.numero-pedido {
    display: block;
    margin: 20px 0;
    font-size: 25px;
    font-weight: bold;
}

.volver {
    display: inline-block;
    margin-top: 20px;
    padding: 13px 25px;
    color: #fff;
    background: #222;
    text-decoration: none;
    border-radius: 7px;
}

@media (max-width: 600px) {
    .cabecera {
        padding: 10px;
    }

    .menu {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 10px;
    }

    .menu-boton {
        flex: 0 0 auto;
        padding: 10px 16px;
        font-size: 15px;
    }

    .contenido {
        padding: 20px 10px 40px;
    }

    .titulo-categoria {
        font-size: 25px;
    }

    .pagina-formulario {
        padding: 8px;
    }

    .formulario-contenedor {
        padding: 18px 12px;
    }

    fieldset {
        padding: 18px 12px;
    }

    .opciones {
        display: block;
    }

    .opcion {
        margin-bottom: 10px;
    }
}
