/* Catálogo de www.alsidoor.es
   Pensado primero para móvil; los bloques @media amplían para tableta (768 px) y ordenador (1024 px). */

/* ---------- Colores y medidas ---------- */
:root {
  --azul: #0055a4;
  --azul-oscuro: #003e7a;
  --azul-claro: #eaf2fa;
  --gris: #7a7a7a;
  --texto: #222;
  --texto-suave: #555;
  --borde: #dde1e6;
  --fondo-suave: #f4f6f9;
  --verde: #1e7e34;
  --verde-oscuro: #17642a;
  --aviso: #fff4e0;
  --aviso-texto: #7a4100;
  --radio: 8px;
  --ancho: 1200px;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--texto);
  background: #fff;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--azul);
}

a:hover {
  color: var(--azul-oscuro);
}

:focus-visible {
  outline: 3px solid #f0a500;
  outline-offset: 2px;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
}

.contenedor {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 0 1rem;
}

.saltar {
  position: absolute;
  left: -9999px;
}

.saltar:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: #fff;
}

.solo-escritorio {
  display: none;
}

/* ---------- Botones ---------- */
.botones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 36rem;
}

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.55rem 1rem;
  border: 2px solid transparent;
  border-radius: var(--radio);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
}

.botones .boton {
  flex: 1 1 auto;
}

.boton--whatsapp {
  background: var(--verde);
  color: #fff;
}

.boton--whatsapp:hover {
  background: var(--verde-oscuro);
  color: #fff;
}

.boton--telefono {
  background: var(--azul);
  color: #fff;
}

.boton--telefono:hover {
  background: var(--azul-oscuro);
  color: #fff;
}

.boton--secundario {
  border-color: var(--azul);
  color: var(--azul);
}

.icono {
  flex: none;
  width: 1.25em;
  height: 1.25em;
  fill: currentColor;
}

/* ---------- Aviso superior ---------- */
.aviso {
  margin: 0;
  padding: 0.5rem 1rem;
  background: var(--azul);
  color: #fff;
  font-size: 0.875rem;
  text-align: center;
}

.aviso a {
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- Cabecera ---------- */
.cabecera {
  border-bottom: 1px solid var(--borde);
}

.cabecera__fila {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.cabecera__logo {
  display: block;
  flex: 1 1 100%;
  max-width: 420px;
}

.cabecera__logo img {
  display: block;
  width: 100%;
}

.cabecera__contacto {
  display: flex;
  flex: 1 1 100%;
  gap: 0.5rem;
}

.cabecera__contacto .boton {
  flex: 1;
}

/* ---------- Menú: en móvil se abre con el botón «Menú» ---------- */
.menu {
  position: relative;
  background: var(--azul);
}

.menu__interruptor {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.menu__boton {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0 1rem;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.menu__boton::before {
  content: "";
  width: 1.25rem;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -6px currentColor, 0 6px currentColor;
}

.menu__interruptor:focus-visible + .menu__boton {
  outline: 3px solid #f0a500;
  outline-offset: -3px;
}

.menu__lista,
.menu__columnas,
.menu__sub {
  padding: 0;
  list-style: none;
}

.menu__columnas,
.menu__sub {
  margin: 0;
}

.menu__lista {
  display: none;
  background: #fff;
}

.menu__interruptor:checked ~ .menu__lista {
  display: block;
}

.menu__elemento {
  border-bottom: 1px solid var(--borde);
}

.menu__enlace {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--texto);
  font-weight: 700;
  text-decoration: none;
}

.menu__columnas {
  padding-bottom: 0.5rem;
}

.menu__titulo {
  display: block;
  padding: 0.5rem 1rem 0.5rem 2rem;
  color: var(--azul);
  text-decoration: none;
}

.menu__imagen,
.menu__sub {
  display: none;
}

/* ---------- Contenido ---------- */
.principal {
  padding-top: 1rem;
  padding-bottom: 2.5rem;
}

.migas ol {
  display: flex;
  flex-wrap: wrap;
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  color: var(--gris);
}

.migas li + li::before {
  content: "›";
  margin: 0 0.4rem;
}

.migas a {
  color: var(--texto-suave);
}

.titulo {
  margin: 0.25rem 0 1rem;
  font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2rem);
  color: #1a1a1a;
}

.nota {
  color: var(--texto-suave);
}

.bloque {
  margin-top: 2rem;
}

.bloque__titulo {
  margin: 0 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--azul-claro);
  font-size: 1.25rem;
}

.bloque__cantidad {
  color: var(--gris);
  font-weight: 400;
}

.bloque__mas {
  margin: 1rem 0 0;
  text-align: right;
}

/* Textos que vienen de la tienda (descripciones y páginas de información) */
.texto {
  max-width: 52rem;
}

.texto > :first-child {
  margin-top: 0;
}

.texto h2,
.texto h3,
.texto h4 {
  margin: 1.5rem 0 0.5rem;
}

.texto img {
  height: auto;
}

.texto table {
  border-collapse: collapse;
}

.texto th,
.texto td {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--borde);
  vertical-align: top;
}

.tabla {
  max-width: 100%;
  overflow-x: auto;
}

.video {
  max-width: 720px;
  margin: 1rem 0;
  aspect-ratio: 16 / 9;
}

.video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Portada ---------- */
.portada {
  padding: 1.5rem 1rem;
  border-radius: var(--radio);
  background: var(--azul-claro);
}

.portada__titulo {
  margin: 0 0 0.75rem;
  font-size: clamp(1.6rem, 1.3rem + 1.5vw, 2.25rem);
  color: var(--azul-oscuro);
}

.portada__texto {
  max-width: 48rem;
  margin: 0 0 0.75rem;
}

.portada .botones {
  margin-top: 1.25rem;
}

.ventajas {
  margin-top: 2rem;
  padding: 1.25rem 1rem;
  border-radius: var(--radio);
  background: var(--fondo-suave);
}

.ventajas__lista {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
}

.ventaja__titulo {
  display: block;
  color: var(--azul-oscuro);
}

/* ---------- Rejillas de productos, categorías y marcas ---------- */
.rejilla,
.subcategorias,
.marcas {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rejilla,
.subcategorias,
.marcas {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tarjeta__enlace,
.subcategoria__enlace,
.marca__enlace {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0.5rem;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  background: #fff;
  color: var(--texto);
  text-decoration: none;
}

.tarjeta__enlace:hover,
.subcategoria__enlace:hover,
.marca__enlace:hover {
  border-color: var(--azul);
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.08);
  color: var(--texto);
}

.tarjeta__foto {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}

.tarjeta__nombre {
  margin: 0.5rem 0;
  font-size: 0.9rem;
  font-weight: 500;
}

.tarjeta__precio {
  margin: auto 0 0;
  color: var(--azul);
  font-size: 1.05rem;
  font-weight: 700;
}

.subcategoria__enlace,
.marca__enlace {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.subcategoria__foto {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: contain;
}

.subcategoria__nombre {
  margin: 0.5rem 0 0.25rem;
  color: var(--azul);
  font-size: 1rem;
}

.marca__logo {
  width: 100%;
  max-width: 9rem;
  aspect-ratio: 1;
  object-fit: contain;
}

.marca__nombre {
  font-weight: 700;
}

.marca__cantidad {
  color: var(--gris);
  font-size: 0.85rem;
}

.marca-cabecera {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.marca-cabecera__logo {
  width: 6rem;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
}

/* ---------- Ficha de producto ---------- */
.producto {
  display: grid;
  gap: 1.5rem;
}

.galeria__fotos {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.galeria__foto {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-margin-top: 1rem;
}

.galeria__foto img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  background: #fff;
}

.galeria__miniaturas {
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0.5rem 0 0;
  list-style: none;
  overflow-x: auto;
}

.galeria__miniaturas a {
  display: block;
  flex: none;
}

.galeria__miniaturas img {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
  border: 1px solid var(--borde);
  border-radius: 4px;
  background: #fff;
}

.producto__nombre {
  margin-top: 0;
}

.producto__ficha {
  margin: -0.5rem 0 1rem;
  color: var(--texto-suave);
  font-size: 0.9rem;
}

.precio {
  margin: 0 0 1rem;
}

.precio p {
  margin: 0;
}

.precio__importe {
  color: var(--azul);
  font-size: 1.75rem;
  font-weight: 700;
}

.precio__iva {
  color: var(--gris);
  font-size: 0.85rem;
  font-weight: 400;
}

.precio__nota {
  margin-top: 0.25rem;
  color: var(--texto-suave);
  font-size: 0.9rem;
}

.precio .precio__aviso {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: var(--aviso);
  color: var(--aviso-texto);
  font-size: 0.9rem;
  font-weight: 700;
}

.producto__resumen {
  margin-bottom: 1rem;
}

.pedido {
  padding: 1rem;
  border: 2px solid var(--azul);
  border-radius: var(--radio);
  background: var(--azul-claro);
}

.pedido__titulo {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  color: var(--azul-oscuro);
}

.pedido__texto {
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.pedido__correo {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}

.producto__envio {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--texto-suave);
  font-size: 0.9rem;
}

.producto__envio li {
  position: relative;
  padding-left: 1.25rem;
}

.producto__envio li + li {
  margin-top: 0.25rem;
}

.producto__envio li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--verde);
  font-weight: 700;
}

.opciones {
  width: 100%;
  max-width: 44rem;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.opciones th,
.opciones td {
  padding: 0.5rem;
  border-bottom: 1px solid var(--borde);
  text-align: left;
}

.opciones th:last-child,
.opciones td:last-child {
  text-align: right;
  white-space: nowrap;
}

.opciones__defecto {
  background: var(--azul-claro);
  font-weight: 700;
}

.grupos {
  max-width: 44rem;
  margin: 0;
}

.grupos__fila {
  display: grid;
  grid-template-columns: minmax(7rem, 35%) 1fr;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--borde);
}

.grupos dt {
  font-weight: 700;
}

.grupos dd {
  margin: 0;
}

/* ---------- Contacto ---------- */
.contacto {
  display: grid;
  gap: 0 1.5rem;
  margin-top: 1rem;
}

/* ---------- Pie ---------- */
.pie {
  border-top: 4px solid var(--azul);
  background: var(--fondo-suave);
  font-size: 0.95rem;
}

.pie__columnas {
  display: grid;
  gap: 0 2rem;
  padding-top: 1.5rem;
  padding-bottom: 1rem;
}

.pie__titulo {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--azul-oscuro);
}

.pie__logo {
  width: 100%;
  max-width: 240px;
}

.pie__lista {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.pie__lista li + li {
  margin-top: 0.35rem;
}

.pie__columna p {
  margin: 0 0 0.5rem;
}

.pie__legal {
  margin: 0;
  padding: 1rem 0 1.5rem;
  border-top: 1px solid var(--borde);
  color: var(--texto-suave);
  font-size: 0.85rem;
}

/* ---------- Tableta (desde 600 px) ---------- */
@media (min-width: 600px) {
  .rejilla,
  .subcategorias,
  .marcas {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ventajas__lista {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cabecera__contacto {
    flex: 0 0 auto;
  }

  .cabecera__logo {
    flex: 1 1 18rem;
  }

  .contacto,
  .pie__columnas {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- Tableta horizontal (desde 768 px) ---------- */
@media (min-width: 768px) {
  .producto {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
  }

  .portada {
    padding: 2rem;
  }
}

/* ---------- Ordenador (desde 1024 px): menú con desplegables ---------- */
@media (min-width: 1024px) {
  .solo-escritorio {
    display: block;
  }

  .solo-movil {
    display: none;
  }

  .rejilla {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .subcategorias,
  .marcas {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .ventajas__lista {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .producto {
    grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
    gap: 2.5rem;
  }

  .menu__boton {
    display: none;
  }

  .menu__lista {
    display: flex;
    background: none;
  }

  .menu__elemento {
    border: 0;
  }

  .menu__enlace {
    padding: 0.85rem 1rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    cursor: pointer;
  }

  .menu__elemento:hover > .menu__enlace,
  .menu__elemento:focus-within > .menu__enlace {
    background: var(--azul-oscuro);
    color: #fff;
  }

  .menu__desplegable {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    border-bottom: 3px solid var(--azul);
    background: #fff;
    box-shadow: 0 8px 16px rgb(0 0 0 / 0.12);
  }

  .menu__elemento:hover > .menu__desplegable,
  .menu__elemento:focus-within > .menu__desplegable {
    display: block;
  }

  .menu__columnas {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1.25rem;
    max-width: var(--ancho);
    margin: 0 auto;
    padding: 1.25rem 1rem;
  }

  .menu__imagen {
    display: block;
    margin-bottom: 0.5rem;
  }

  .menu__imagen img {
    display: block;
    width: 100%;
    max-width: 180px;
  }

  .menu__titulo {
    padding: 0;
    font-weight: 700;
  }

  .menu__titulo:hover {
    text-decoration: underline;
  }

  .menu__sub {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.9rem;
  }

  .menu__sub li + li {
    margin-top: 0.25rem;
  }

  .menu__sub a {
    color: var(--texto-suave);
    text-decoration: none;
  }

  .menu__sub a:hover {
    color: var(--azul);
    text-decoration: underline;
  }

  .pie__columnas {
    grid-template-columns: 1.2fr 1fr 1fr;
  }
}
