/* =========================
   BASE
========================= */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f8f9fa;
  color: #333;
}

/* =========================
   CABECERA
========================= */
header {
  background: linear-gradient(90deg, #e63946, #2a9d8f, #457b9d);
  color: white;
  padding: 30px;
  text-align: center;
}

.cabecera {
  text-align: center;
  padding: 20px 10px;
}

.logo img {
  max-width: 250px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 10px;
}

.cabecera p {
  font-size: 1rem;
  color: #666;
}

/* =========================
   NAVEGACIÓN
========================= */
nav {
  background: #c9a227;
  padding: 10px;
  text-align: center;
}

nav a {
  color: white;
  margin: 0 12px;
  font-weight: bold;
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
}

nav .activo {
  color: inherit;
  cursor: default;
  text-decoration: none;
}

/* =========================
   CONTENIDO PRINCIPAL
========================= */
main {
  max-width: 900px;
  margin: auto;
  padding: 20px;
}

/* =========================
   POSTS (HOME Y GUÍAS)
========================= */
.post {
  background: white;
  padding: 1.2rem;
  margin-bottom: 1.5rem;
  border-radius: 10px;
  border-left: 6px solid #e63946;
  box-shadow: 0 4px 10px rgba(0,0,0,.06);
  transition: transform .2s ease, box-shadow .2s ease;
}

.post:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
}

.post h2 a {
  color: #457b9d;
  text-decoration: none;
}

.post h2 a:hover {
  color: #e63946;
}

.fecha {
  font-size: 0.85em;
  color: #777;
}

/* =========================
   COLORES POR SISTEMA
========================= */
.post.rojo    { border-left-color: #d62828; }
.post.verde   { border-left-color: #2a9d8f; }
.post.azul    { border-left-color: #457b9d; }
.post.dorado  { border-left-color: #c9a227; }

/* Textos Nespresso */
.post.rojo,
.post.rojo h2,
.post.rojo h3,
.post.rojo p {
  color: #457b9d;
}

/* Textos Dolce Gusto */
.post.verde,
.post.verde h2,
.post.verde h3,
.post.verde p {
  color: #457b9d;
}

/* Textos Tassimo */
.post.azul,
.post.azul h2,
.post.azul h3,
.post.azul p {
  color: #457b9d;
}

/* Textos Tassimo */
.post.dorado,
.post.dorado h2,
.post.dorado h3,
.post.dorado p {
  color: #457b9d;
}

/* =========================
   DETALLE DE ARTÍCULO
========================= */
.post-detalle {
  max-width: 700px;
  margin: 2rem auto;
  color: #333;
}

.post-detalle p {
  line-height: 1.7;
  margin-bottom: 1rem;
}

.post-detalle h2,
.post-detalle h3 {
  color: #457b9d;
}

/* =========================
   BUSCADOR
========================= */
.buscador {
  max-width: 600px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.buscador input {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  border-radius: 25px;
  border: 2px solid #c97c5d;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.buscador input:focus {
  border-color: #953c36;
  box-shadow: 0 0 0 3px rgba(149,60,54,.15);
}

/* =========================
   FILTROS / BOTONES
========================= */
.filtro {
  padding: 8px 16px;
  border-radius: 20px;
  background: #ffffff;
  color: #457b9d;
  font-weight: bold;
  text-decoration: none;
  font-size: 0.9rem;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.filtro.rojo   { border-color: #d62828; }
.filtro.verde  { border-color: #2a9d8f; }
.filtro.azul   { border-color: #457b9d; }
.filtro.dorado { border-color: #c9a227; }

.filtro:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
  background-color: #ffffff;
}

/* =========================
   FABRICANTES
========================= */
.fabricante {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid #eaeaea;
  flex-wrap: wrap;
}

.fabricante .icono {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fabricante img {
  width: 24px;
  height: 24px;
}

.fabricante a {
  color: #457b9d;
  text-decoration: none;
  font-weight: 600;
}

.fabricante a:hover {
  text-decoration: underline;
}

.fabricante-btn {
  display: inline-block;
  padding: 7px 14px;
  margin: 8px 8px 8px 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #457b9d;
  background: #ffffff;
  border: 2px solid #457b9d;
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.fabricante-btn:hover {
  background: #457b9d;
  color: #ffffff;
}

/* =========================
   LAYOUT + SIDEBARS
========================= */
.layout {
  display: grid;
  grid-template-columns: 160px 1fr 160px;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sidebar {
  position: sticky;
  top: 20px;   /* distancia desde arriba al hacer scroll */
  align-self: flex-start;
}

/* =========================
   ANUNCIOS
========================= */
.anuncio {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  transition: transform .2s ease, box-shadow .2s ease;
  width: 180px;
  margin: 0 auto;
}

.anuncio:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

.anuncio img {
  width: 100%;
  display: block;
}

.anuncio span,
.anuncio p {
  display: block;
  padding: 8px;
  font-size: 0.85rem;
  color: #457b9d;
  text-align: center;
  background: #f8f5f2;
}

.anuncio a {
  text-decoration: none;
}
.anuncio a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.anuncio:hover img {
  transform: scale(1.03);
}

.anuncio img {
  transition: transform 0.25s ease, filter 0.25s ease;
}

.anuncio:hover span,
.anuncio:hover p {
  background-color: #457b9d;
  color: #ffffff;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* =========================
   FOOTER
========================= */
footer {
  background: #333;
  color: white;
  text-align: center;
  padding: 15px;
  margin-top: 30px;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1024px) {
  aside.sidebar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    justify-items: center;
  }
}

/* ============================
   FIX iOS / TABLET / MÓVIL
   ============================ */

@media (max-width: 1024px) {

  .layout {
    display: block;   /* 🔥 rompe el grid */
  }

  .sidebar {
    position: static !important;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 20px auto;
    max-width: 400px;
  }

  main {
    max-width: 100%;
  }
}


@media (max-width: 600px) {
  header {
    padding: 20px;
  }



  .fabricante {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .filtro {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
}
/* Fade suave de imágenes */
img.fade {
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

img.fade.loaded {
  opacity: 1;
}

/* ============================
   SIDEBARS: tablet vertical y móvil horizontal
   ============================ */

@media (max-width: 1024px) and (orientation: portrait),
       (max-width: 900px) and (orientation: landscape) {

  .sidebar {
    position: static !important;
    top: auto !important;
    align-self: stretch;
  }
}


