/* Rebajero · identidad «Cartel de precio»: la marca es una etiqueta amarilla de oferta. */
:root {
  --azul: #0f1e4a;
  --azul-hover: #1c2f6b;
  --amarillo: #ffd200;
  --rojo: #e0182d;
  --gris: #5a6485;
  --suave: #f4f6fb;
  --borde: #e3e7f0;
  --verde: #0b7a3b;
  --blanco: #ffffff;
  --radio: 6px;
  --f-cartel: Anton, Impact, "Arial Narrow", "Helvetica Neue Condensed", sans-serif;
  --f-texto: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  /* Separacion entre tarjetas: tambien mantiene los anuncios lejos del boton «Ver oferta». */
  --separacion: 24px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--blanco);
  color: var(--azul);
  font-family: var(--f-texto);
  line-height: 1.45;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.contenedor { width: min(1180px, 100%); margin-inline: auto; padding-inline: 16px; }

/* ---------- Logo: etiqueta de precio ---------- */
.logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: var(--amarillo);
  color: var(--azul);
  font-family: var(--f-cartel);
  font-size: 28px;
  line-height: 1;
  letter-spacing: .03em;
  text-decoration: none;
  padding: 8px 18px 8px 32px;
  clip-path: polygon(17px 0, 100% 0, 100% 100%, 17px 100%, 0 50%);
}
.logo::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--azul);
}
.logo:focus-visible { outline: 3px solid var(--blanco); outline-offset: 3px; }

/* ---------- Cabecera ---------- */
.cabecera { background: var(--azul); }
.cabecera__fila {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding-block: 14px;
}
.cabecera__lema { margin: 0; color: #c9d2ee; font-size: 15px; }
.cabecera__lema b { color: var(--amarillo); font-weight: 700; }

.principal { padding-bottom: 12px; }

/* ---------- Filtros ---------- */
.filtros { display: flex; flex-direction: column; gap: 10px; padding-block: 22px 6px; }
.filtros__grupo { display: flex; flex-wrap: wrap; gap: 8px; }
.filtros__grupo:empty { display: none; }
.chip {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 4px;
  border: 1px solid var(--borde);
  background: var(--suave);
  color: var(--azul);
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.chip:hover { border-color: var(--azul); }
.chip--activo { background: var(--azul); border-color: var(--azul); color: var(--amarillo); }
.filtros__grupo--categorias .chip { font-weight: 600; background: var(--blanco); }
.filtros__grupo--categorias .chip--activo { background: var(--amarillo); border-color: var(--amarillo); color: var(--azul); font-weight: 800; }
.chip:focus-visible, .boton:focus-visible, .oferta__boton:focus-visible { outline: 3px solid var(--rojo); outline-offset: 2px; }

.titular { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding-top: 18px; }
.titular h1 { margin: 0; font-family: var(--f-cartel); font-weight: 400; font-size: 34px; letter-spacing: .01em; text-transform: uppercase; line-height: 1.1; }
.titular p { margin: 0; color: var(--gris); font-size: 14px; }

.estado { color: var(--gris); margin: 10px 0; min-height: 1.4em; }
.estado:empty { margin: 0; min-height: 0; }

/* ---------- Rejilla ---------- */
.rejilla {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: var(--separacion);
  padding-top: 8px;
}

/* ---------- Tarjeta ---------- */
.oferta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
}
.oferta__foto {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 100%;
  padding: 20px 20px 42px;
  border-bottom: 1px solid var(--borde);
}
.oferta__imagen { width: 100%; height: 100%; object-fit: contain; }

/* Sello rojo del descuento. */
.oferta__sello {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--rojo);
  color: var(--blanco);
  font-family: var(--f-cartel);
  font-size: 18px;
  letter-spacing: .02em;
  transform: rotate(-12deg);
}
.oferta__sello:empty { display: none; }

/* El precio es una etiqueta amarilla que cuelga sobre el borde de la foto. */
.oferta__precio {
  position: absolute;
  left: -1px;
  bottom: -20px;
  max-width: calc(100% + 1px);
  background: var(--amarillo);
  color: var(--azul);
  font-family: var(--f-cartel);
  font-size: 30px;
  line-height: 1;
  padding: 8px 16px 8px 28px;
  clip-path: polygon(15px 0, 100% 0, 100% 100%, 15px 100%, 0 50%);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.oferta__precio::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--blanco);
}

.oferta__texto { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 32px 16px 16px; }
.oferta__texto p { margin: 0; }
.oferta__antes { font-size: 14px; color: var(--gris); }
.oferta__antes s { color: var(--rojo); font-weight: 700; }
.oferta__antes:empty { display: none; }
/* Una sola linea para que las filas queden alineadas; el texto completo sale al pasar el mouse. */
.oferta__tienda { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gris); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Los titulos de Amazon llegan a 7 lineas y descuadran la fila: se muestran 3 y el completo al pasar el mouse. */
.oferta__titulo {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.oferta__nota {
  font-size: 14px;
  line-height: 1.45;
  background: var(--suave);
  border-left: 3px solid var(--amarillo);
  padding: 8px 10px;
  overflow-wrap: anywhere;
}
.oferta__nota strong { color: var(--azul); }
.oferta__envio { font-size: 13px; font-weight: 700; color: var(--verde); }
.oferta__fecha { font-size: 12px; color: var(--gris); }
.oferta__boton {
  margin-top: auto;
  font: 800 16px/1 var(--f-texto);
  border: 0;
  border-radius: 4px;
  padding: 13px;
  background: var(--azul);
  color: var(--blanco);
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
/* El boton baja al fondo de la tarjeta, pero nunca queda pegado al texto. */
.oferta__texto > :nth-last-child(2) { margin-bottom: 8px; }
.oferta__boton:hover { background: var(--amarillo); color: var(--azul); }
a.oferta__boton { display: block; text-align: center; text-decoration: none; }
.oferta__enlace { color: inherit; text-decoration: none; }
.oferta__enlace:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.oferta__enlace:focus-visible { outline: 3px solid var(--rojo); outline-offset: 2px; }

/* ---------- Botones ---------- */
.boton {
  font: 800 16px/1 var(--f-texto);
  border-radius: 4px;
  padding: 13px 22px;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.boton--secundario { background: var(--blanco); color: var(--azul); border: 2px solid var(--azul); }
.boton--secundario:hover { background: var(--azul); color: var(--amarillo); }
.mas { display: flex; justify-content: center; padding-block: 28px 8px; }

/* ---------- Anuncios ---------- */
.anuncio { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.anuncio__etiqueta { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gris); }
.anuncio--integrado { border: 1px solid var(--borde); border-radius: var(--radio); padding: 12px; }
.anuncio--integrado .anuncio__bloque { display: block; width: 100%; min-height: 300px; flex: 1; }
.anuncio--franja, .anuncio--pie { grid-column: 1 / -1; align-items: center; }
/* Tamanos fijos por ancho de pantalla: Google los respeta y la pagina no salta al cargar. */
.anuncio--franja .anuncio__bloque { width: 728px; height: 90px; }
.anuncio--pie { padding-block: 24px 8px; }
.anuncio--pie .anuncio__bloque { width: 728px; height: 90px; }
@media (max-width: 759px) {
  .anuncio--franja .anuncio__bloque { width: 300px; height: 250px; }
  .anuncio--pie .anuncio__bloque { width: 320px; height: 100px; }
}
.anuncio__muestra {
  display: grid;
  place-items: center;
  max-width: 100%;
  padding: 8px;
  text-align: center;
  font-size: 13px;
  color: var(--gris);
  background: repeating-linear-gradient(135deg, var(--suave) 0 8px, var(--blanco) 8px 16px);
  border: 1px dashed #b9c1d6;
}

/* ---------- Pagina de una oferta ---------- */
.migas { padding-block: 18px 4px; font-size: 14px; color: var(--gris); }
.migas ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.migas li + li::before { content: "›"; margin-right: 8px; color: var(--gris); }
.migas a { color: var(--azul); font-weight: 600; }

.detalle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 32px;
  align-items: start;
  padding-block: 18px 8px;
}
.detalle__foto {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 100%;
  padding: 28px 28px 52px;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  background: var(--blanco);
}
.detalle__foto .oferta__sello { width: 72px; height: 72px; font-size: 24px; top: 14px; right: 14px; }
.detalle__foto .oferta__precio { font-size: 40px; bottom: 20px; padding: 10px 20px 10px 34px; }
.detalle--terminada .detalle__foto { filter: grayscale(1); opacity: .75; }
.detalle__info { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.detalle__info p { margin: 0; }
.detalle__tienda { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gris); }
.detalle__tienda a { color: var(--azul); }
.detalle__titulo { margin: 0; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.25; font-weight: 800; text-wrap: balance; overflow-wrap: anywhere; }
.detalle__terminada { background: #fdecee; color: #8f1020; border-left: 4px solid var(--rojo); padding: 10px 14px; font-weight: 700; }
.detalle__precios { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.detalle__precio { font-family: var(--f-cartel); font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.detalle__antes { color: var(--gris); }
.detalle__antes s { color: var(--rojo); font-weight: 700; }
.detalle__ahorro { font-size: 14px; font-weight: 800; color: var(--verde); background: #e3f4ea; padding: 3px 10px; border-radius: 999px; }
.detalle__nota { font-size: 16px; padding: 12px 14px; }
.detalle__datos { margin: 0; padding-left: 18px; display: grid; gap: 4px; color: var(--gris); font-size: 15px; }
.detalle__boton { font-size: 18px; padding: 16px; }
.detalle__aviso { font-size: 13px; color: var(--gris); }

.relacionadas { padding-top: 40px; }
.relacionadas h2 { margin: 0 0 8px; font-family: var(--f-cartel); font-weight: 400; font-size: 28px; text-transform: uppercase; letter-spacing: .01em; }

.aviso-pagina { padding-block: 60px; display: grid; gap: 10px; }
.aviso-pagina h1 { margin: 0; font-family: var(--f-cartel); font-weight: 400; font-size: 36px; text-transform: uppercase; }
.aviso-pagina p { margin: 0; }
.aviso-pagina a, .texto a { color: var(--azul); font-weight: 700; }

/* ---------- Paginas de texto (quienes somos, privacidad...) ---------- */
.texto { max-width: 68ch; padding-block: 36px 16px; font-size: 17px; line-height: 1.65; }
.texto h1 { margin: 0 0 12px; font-family: var(--f-cartel); font-weight: 400; font-size: clamp(32px, 4.5vw, 44px); line-height: 1.1; text-transform: uppercase; letter-spacing: .01em; text-wrap: balance; }
.texto h2 { margin: 32px 0 8px; font-size: 21px; font-weight: 800; line-height: 1.3; }
.texto p, .texto ul { margin: 0 0 12px; }
.texto ul { padding-left: 22px; }
.texto li { margin-bottom: 6px; }
.texto__entrada { font-size: 19px; color: var(--gris); }
.pendiente { background: var(--amarillo); color: var(--azul); padding: 0 4px; font-weight: 700; }

/* ---------- Pie ---------- */
.pie { margin-top: 36px; background: var(--azul); color: #c9d2ee; font-size: 13px; }
.pie__fila { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; padding-block: 26px 34px; }
.logo--pie { font-size: 22px; flex: none; }
.pie__textos { flex: 1 1 320px; display: grid; gap: 4px; }
.pie__textos p { margin: 0; }
.pie__enlaces { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 6px; font-size: 14px; }
.pie__enlaces a { color: var(--blanco); font-weight: 700; text-decoration: none; }
.pie__enlaces a:hover { color: var(--amarillo); text-decoration: underline; }
.pie__enlaces a:focus-visible { outline: 2px solid var(--amarillo); outline-offset: 2px; }

@media (max-width: 759px) {
  .detalle { grid-template-columns: 1fr; gap: 20px; }
  .detalle__foto .oferta__precio { font-size: 32px; }
  .detalle__precio { font-size: 38px; }
}

@media (max-width: 559px) {
  /* En celular los filtros se deslizan de lado en vez de ocupar media pantalla. */
  .filtros__grupo { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding-inline: 16px; padding-bottom: 2px; scrollbar-width: none; }
  .filtros__grupo::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .oferta__foto { aspect-ratio: 4 / 3; }
  .titular h1 { font-size: 28px; }
  .cabecera__lema { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
