/* Reset basico para que el calculo de anchos y altos sea mas predecible */
* {
    box-sizing: border-box;
}

/* Variables de color reutilizadas en toda la web para mantener coherencia visual */
:root {
    --color-bg: #f4f7fb;
    --color-bg-alt: #e6edf8;
    --color-surface: #ffffff;
    --color-surface-soft: #eef4ff;
    --color-surface-soft-alt: #f8fbff;
    --color-primary: #0b57d0;
    --color-primary-dark: #0a2a66;
    --color-primary-light: #dbe8ff;
    --color-accent: #ff6b00;
    --color-accent-dark: #d45500;
    --color-text: #111827;
    --color-text-muted: #4b5563;
    --color-footer: #0f172a;
    --color-border: #d7e1ef;
}

/* Mensaje de confirmacion pensado para el formulario de contacto */
#mensaje-exito {
    color: var(--color-text);
    font-weight: 600;
    margin-top: 12px;
    animation: slide-up 0.3s ease-out;
}

/* Bloques del formulario: fieldset, leyenda y agrupacion de campos */
fieldset {
    border: 1px solid var(--color-border);
    border-radius: 18px;
    padding: 24px;
    margin: 0;
}
legend {
    padding: 0 10px;
    font-weight: 700;
    color: var(--color-primary-dark);
    background-color: var(--color-surface);
}

legend + div {
    margin-top: 12px;
}
form div {
    margin-bottom: 12px;
}

/* Estructura base del documento: fondo, header, main y footer */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, var(--color-bg), var(--color-bg-alt));
    color: var(--color-text);
}

header {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    border-radius: 0 0 20px 20px;
}
header h1{
    margin-bottom: 10px;
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3rem); /* Tamaño de fuente adaptable */ 
    animation: fade-in 1.5s ease-out;
}
main {
    padding: 2rem;
    text-align: center;
}

footer {
    background-color: var(--color-footer);
    color: var(--color-surface);
    text-align: center;
    padding: 1rem;
    position: relative; /* Para que no se superponga al contenido en pantallas pequeñas */
    bottom: 0;
    width: 100%;
    border-radius: 10px;
}

/* Listas, tarjetas base e imagenes generales */
ul {
    list-style-type: none;
    padding: 0;
}

li {
    display: flex; 
    align-items: center;
    margin-bottom: 10px;
    background: var(--color-primary-dark);
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(15, 44, 95, 0.08);
    padding: 18px;
    
    transition: transform 0.2s ease, box-shadow 0.2s ease;  
    animation: slide-up 0.8s ease-out;
}
li:hover {
    transform: translateY(-3px);  
    box-shadow: 0 16px 30px rgba(15, 44, 95, 0.14);
}

img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 16px;
    margin-right: 18px;
}

/* Enlaces generales del sitio */
a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
}

a:hover {
    color: var(--color-primary-dark);
}

/* Formulario y controles del formulario */
form {
    max-width: 600px;
    margin: 40px auto;
    padding: 35px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    box-shadow: 0 18px 45px rgba(10, 45, 90, 0.08);
    animation: fade-in 1.5s ease-out;
}
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--color-text);
}

input, textarea {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid #c8d4e4;
    border-radius: 14px;
    font-size: 1rem;
    background: var(--color-surface-soft-alt);
}
input:focus, textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(11, 87, 208, 0.14);
    background: var(--color-surface);
}

button {
    background-color: var(--color-primary);
    color: var(--color-surface);
    border: none;
    padding: 12px 24px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease, transform 0.2s ease;
}
button:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
}

/* Pie de pagina y enlaces a redes sociales */
.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
 
}
.redes-sociales {
    margin: 10px 0;
}
.redes-sociales a {
    margin: 0 10px;
    color: var(--color-surface);
    text-decoration: none;
    transition: color 0.2s ease;
}
.redes-sociales a:hover {
    color: var(--color-primary-light);
}

/* Pequeno escalonado en la animacion de algunos elementos de lista */
li:nth-child(1) {
    animation-delay: 0.1s;
}

li:nth-child(2) {
    animation-delay: 0.2s;
}

li:nth-child(3) {
    animation-delay: 0.3s;
}
nav {
    margin-bottom: 20px;
}

nav a {
    color: var(--color-surface);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

nav a:hover {
    color: var(--color-primary-light);
}

/* Navegacion principal y submenu desplegable */
.menu-principal {
    margin-top: 16px;
}

.menu-principal > ul > li > a{
    border-radius:10px;
}
.menu-principal > ul > li > a:hover {
    background-color: var(--color-surface-soft);
    color: var(--color-primary-dark);
}
.menu-principal ul {
    list-style: none;
    margin:0;
    padding:0;
}

.desplegable > a::after {
    content: ' ▼';
    font-size: 0.8em;
}
.desplegable.abierto > a::after {
    content: ' ▲';
}
.menu-principal > ul {
    display: flex;
    justify-content: center;
    align-items: center;
    gap:20px;
}

.menu-principal li{
    display: block;
    position:relative;
    align-items:normal;
    background:transparent;
    border-radius:0;
    box-shadow:none;
    padding:0;
    margin-bottom:0;
    animation:none;
    transition:none;
}

.menu-principal li:hover{
   transform:none;
   box-shadow:none;
}

.menu-principal a{
    display: block;
    padding: 10px 16px;
    color: var(--color-primary-dark);
    text-decoration:none;
}

.submenu{
    position:absolute;
    top:100%;
    left:0;
    min-width:180px;
    background-color: var(--color-surface);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    z-index:10;
    opacity:0;
    visibility:hidden;
    transform:translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s; 
}

.submenu a{
    color: var(--color-text);
    padding: 12px 16px;
}

.submenu a:hover{
    background-color: var(--color-surface-soft);
    color: var(--color-primary-dark);
}

.desplegable.abierto .submenu{
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Carrusel de productos destacados */
.productos-carrusel {
    display: flex;
    gap: 20px;
    justify-content: flex-start;
    overflow-x: auto;
    scroll-behavior:smooth;
    padding-bottom:10px;
    scroll-snap-type: x mandatory; /* Encaja el scroll tarjeta a tarjeta */
}
.producto-card {
    min-width: 280px;
    background-color: var(--color-surface);
    border-radius: 18px;
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;  
    animation: slide-up 0.8s ease-out;
    flex: 0 0 280px; /* Mantiene el ancho fijo de cada tarjeta */
    scroll-snap-align: start;/* Alinea cada tarjeta al inicio del carrusel */
    display: flex;
    flex-direction: column;
    align-items: center;
}
.producto-card:hover {
    transform: translateY(-5px);  
    box-shadow: 0 16px 30px rgba(15, 44, 95, 0.14);
}

.producto-card img{
    width: 50%;
    border-radius: 5px;
    display: block;
    margin: 0 auto 12px;
    height: 180px;
    object-fit: contain;
}

.producto-precio {
    color: var(--color-text);
    font-weight: 700;
    font-size: 1.2rem;
    margin-top: auto; /* Ayuda a alinear el precio y el boton aunque cambie el texto */
}
.producto-card h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--color-text);
}

.producto-descripcion {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
    margin: 10px 0 0;
    min-height: 58px;
}

.producto-boton {
    background-color: var(--color-accent);
    color: var(--color-surface);
    border: none;
    padding: 10px 20px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease, transform 0.2s ease;
    margin-top: 12px;
    display: inline-block;
}
.producto-boton:hover {
    background-color: var(--color-accent-dark);
    transform: translateY(-2px);
    color: var(--color-surface);
}

.producto-categoria{
    display: inline-block;
    background-color: var(--color-surface-soft);
    color: var(--color-primary-dark);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    margin-bottom: 10px;
}

/* Carrusel de categorias destacadas */
.categorias-carrusel {
    display: flex;
    gap: 20px;
    justify-content: flex-start;
    overflow-x: auto;
    scroll-behavior:smooth;
    padding-bottom:10px;
    scroll-snap-type: x mandatory; /* Permite desplazar las categorias como un slider */
}
.categorias-card {
    min-width: 280px;
    background-color: var(--color-surface);
    border-radius: 18px;
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;  
    animation: slide-up 0.8s ease-out;
    flex: 0 0 280px; /* Mantiene el ancho fijo de las tarjetas de categoria */
    scroll-snap-align: start;/* Alinea cada categoria al inicio del carrusel */
    display: flex;
    flex-direction: column;
    align-items: center;
}
.categorias-card:hover {
    transform: translateY(-5px);  
    box-shadow: 0 16px 30px rgba(15, 44, 95, 0.14);
}

.categorias-card img{
    width: 50%;
    border-radius: 5px;
    display: block;
    margin: 0 auto 12px;
    height: 180px;
    object-fit: contain;
}


.categorias-card h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--color-text);
}

.categorias-descripcion {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
    margin: 10px 0 0;
    min-height: 58px;
}

.categorias-boton {
    background-color: var(--color-primary);
    color: var(--color-surface);
    border: none;
    padding: 10px 20px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease, transform 0.2s ease;
    margin-top: 12px;
    display: inline-block;
}
.categorias-boton:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-2px);
    color: var(--color-surface);
}

/* Hero principal de la portada */
.hero{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    background-color: var(--color-surface);
    padding: 40px;
    border-radius: 28px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    margin-bottom: 40px;
}

.hero-boton {
    background-color: var(--color-accent);
    color: var(--color-surface);
    border: none;
    padding: 10px 20px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease, transform 0.2s ease;
    margin-top: 12px;
    display: inline-block;
}
.hero-boton:hover {
    background-color: var(--color-accent-dark);
    transform: translateY(-2px);
    color: var(--color-surface);
}

.hero-imagen img {
    width: 100%;
    height: auto;
    max-width: 520px;
    margin: 0;
    border-radius: 24px;
    display: block;
}

.hero-texto{
    flex: 1;
    text-align: left;
}

.hero-imagen {
    flex: 1;
}

/* Ficha detallada del producto individual */
.detalle-producto {
    background-color: var(--color-surface);
    padding: 40px;
    border-radius: 28px;
    max-width: 950px;
    margin: 0 auto;
}
.detalle-producto-contenido {
    display: flex;
    align-items: center;
    gap: 40px;
    
}
.detalle-producto-informacion{
    flex: 1;
    text-align: left;

}
.detalle-producto-informacion p{
    margin-bottom: 16px;
    color: var(--color-text-muted);
    line-height: 1.6;
}
.detalle-producto-informacion h1{
    
    margin-top: 0;
    margin-bottom: 16px;
    color: var(--color-text);
    font-size: 2rem;
    color: var(--color-text);
}
.detalle-producto-contenido:hover {
    transform: translateY(-5px);  
    box-shadow: 0 16px 30px rgba(15, 44, 95, 0.14);
}
.detalle-producto-contenido img {
    width: 45%;
    max-width: 420px;
    height: auto;
    margin: 0;
    border-radius: 24px;
}

.detalle-caracteristicas li {
    display: flex; 
    align-items: center;
    margin-bottom: 10px;
    background: var(--color-surface);
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(15, 44, 95, 0.08);
    padding: 18px;
    
    transition: transform 0.2s ease, box-shadow 0.2s ease;  
    animation: slide-up 0.8s ease-out;
}
.detalle-caracteristicas {
    padding: 0;
    margin: 0 0 20px;
}

.detalle-producto-informacion .producto-boton{
    background-color: var(--color-accent);
    color: var(--color-surface);
    border: none;
    padding: 12px 24px;
    border-radius: 14px;
    display: block;
    margin: 0 auto 20px;
    width: fit-content; /* Ajusta el ancho al contenido para poder centrarlo mejor */
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.detalle-producto-informacion .producto-precio{
    color: var(--color-text);
    font-weight: 700;
    font-size: 1.5rem;
    margin-top: 0;
}

/* Animaciones suaves reutilizadas en entradas y tarjetas */
@keyframes fade-in {
   0% {
    opacity: 0;
    transform: translateY(-20px);
   }
   100% {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes slide-up {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ajustes para moviles */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    header {
        padding: 10px 5px;
    }
    h1 {
         font-size: 20px;
    }

    main {
        padding: 1rem;
    }

    ul {
        padding: 0;
    }
    li {
        display: block;
        margin-bottom: 20px;
    }

    img {
        margin-right: 0;  /* Sin espacio a la derecha */
        margin-bottom: 10px;  /* Espacio ABAJO de la imagen */
        width: 100%;  /* La imagen ocupa todo el ancho */
        max-width: 200px;  /* Pero no más de 200px */
    }
    
    form {
        max-width: 100%;  /* El formulario ocupa todo el ancho */
        padding: 15px;  /* Un poco de espacio */
    }
    
    footer {
        position: relative;  /* No fijo en móvil (si no, queda pegado abajo) */
        bottom: auto;
        width: 100%;
    }

    .footer-content {
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .menu-principal > ul {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .submenu{
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        margin-top: 8px;
    }


}
/* Ajustes para tablets y pantallas medianas */
@media (min-width: 601px) and (max-width: 1024px) {
    main {
        padding: 1.5rem;  /* Espacio medio */
    }
    
    form {
        max-width: 500px;  /* Formulario un poco más ancho */
    }
}
