/* ════════════════════════════════════════════════════════════
   pueblo — estética noir / constructivista
   ════════════════════════════════════════════════════════════ */
:root {
  --negro: #0E0E0E;
  --carbon: #1A1A1A;
  --hueso: #F5F2EA;
  --gris: #9A9A9A;
  --rojo: #C8102E;
  --display: "Archivo Black", "Helvetica Neue", Arial, sans-serif;
  --texto: "Archivo", Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--negro); color: var(--hueso); font-family: var(--texto); line-height: 1.6; }
a { color: inherit; text-decoration: none; }

.cabecera {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; border-bottom: 1px solid #222;
}
.marca { display: inline-flex; align-items: center; gap: 9px; }
.marca-logo { height: 34px; width: auto; display: block; }
.marca-txt { font-family: var(--display); font-size: 1.3rem; letter-spacing: .02em; color: var(--hueso); }
.cabecera nav a { color: var(--gris); font-size: .95rem; }
.cabecera nav a:hover { color: var(--hueso); }

/* Ficha de producto */
.ficha {
  max-width: 1080px; margin: 0 auto; padding: 48px 28px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start;
}
/* Escritorio: el mapa se queda fijo a la izquierda mientras se configura a la derecha. */
.lienzo-col { position: sticky; top: 24px; align-self: start; }
.lienzo-envoltorio {
  background: var(--carbon); padding: 26px; border-radius: 6px;
  display: flex; justify-content: center; position: relative;
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
}
#lienzo { display: block; width: 100%; max-width: 520px; height: auto; box-shadow: 0 6px 24px rgba(0,0,0,.6); touch-action: none; }
.map-zoom {
  position: absolute; right: 36px; bottom: 36px;
  display: flex; flex-direction: column; gap: 6px; z-index: 2;
}
.map-zoom button {
  width: 36px; height: 36px; border-radius: 8px; cursor: pointer;
  background: rgba(20,20,20,.82); color: var(--hueso); border: 1px solid #3a3a3a;
  font-size: 1.2rem; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.map-zoom button:hover { background: rgba(45,45,45,.95); border-color: var(--hueso); }
.lienzo-hint { color: var(--gris); font-size: .82rem; text-align: center; margin-top: 12px; }
.evento-toggle {
  display: flex; align-items: center; gap: 10px; margin-top: 18px;
  color: var(--gris); font-size: .95rem; cursor: pointer; justify-content: center;
}
.evento-toggle input { width: 18px; height: 18px; accent-color: var(--rojo); }

.info-col { padding-top: 10px; }
.migas { color: var(--gris); text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; margin-bottom: 12px; }
.info-col h1 { font-family: var(--display); font-size: 2.6rem; line-height: 1.05; margin-bottom: 14px; }
.lema-info { color: var(--gris); margin-bottom: 26px; }
.precio { font-family: var(--display); font-size: 2rem; margin-bottom: 20px; }
.btn-comprar {
  font-family: var(--display); background: var(--rojo); color: #fff; border: none;
  padding: 16px 34px; font-size: 1.05rem; border-radius: 4px; cursor: pointer; letter-spacing: .02em;
}
.btn-comprar:hover { background: #a50d24; }
.btn-comprar:disabled { opacity: .6; cursor: default; }
.nota { color: var(--gris); font-size: .85rem; margin-top: 22px; max-width: 42ch; }

/* ── Selector premium de configuración ── */
.config { margin-top: 24px; display: flex; flex-direction: column; gap: 22px; }
.config-grupo { display: flex; flex-direction: column; gap: 11px; }
.config-tit { text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; color: var(--gris); }
.swatches, .thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch, .pill, .thumb {
  background: var(--carbon); border: 1px solid #2c2c2c; color: var(--hueso);
  cursor: pointer; font: inherit; transition: border-color .15s, box-shadow .15s, background .15s;
}
.swatch:hover, .pill:hover, .thumb:hover { border-color: #5a5a5a; }
.swatch {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 14px 7px 8px; border-radius: 999px; font-size: .85rem;
}
.swatch[aria-pressed="true"] { border-color: var(--hueso); box-shadow: 0 0 0 1px var(--hueso); }
.swatch-bola {
  width: 20px; height: 20px; border-radius: 50%; background: var(--bg);
  box-shadow: inset 0 0 0 4px var(--fg), inset 0 0 0 5px rgba(0,0,0,.2);
}
.pill { padding: 10px 18px; border-radius: 9px; font-size: .85rem; }
.pill[aria-pressed="true"] { background: var(--hueso); color: var(--negro); border-color: var(--hueso); font-weight: 700; }
.thumb {
  width: 66px; height: 66px; border-radius: 9px; overflow: hidden; padding: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--gris); font-size: .66rem; text-align: center; line-height: 1.15;
  background-color: var(--carbon);
  background-image: repeating-conic-gradient(#202020 0 25%, #262626 0 50%);
  background-size: 16px 16px;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb[aria-pressed="true"] { border-color: var(--hueso); box-shadow: 0 0 0 2px var(--hueso); }
.frase-input {
  width: 100%; max-width: 360px; padding: 11px 14px; font-size: .95rem;
  font-family: "EB Garamond", Georgia, serif; font-style: italic;
  background: var(--carbon); border: 1px solid #2c2c2c; color: var(--hueso); border-radius: 9px;
}
.frase-input::placeholder { color: #666; }
.frase-input:focus { outline: none; border-color: var(--hueso); }
.chk-solo { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: .92rem; color: var(--hueso); }
.chk-solo input { width: 17px; height: 17px; accent-color: var(--hueso); cursor: pointer; }
.chk-solo small { color: var(--gris); }
[data-texto-dep] { transition: opacity .15s; }

/* ── Modal de confirmación (vista previa antes de pagar) ── */
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-fondo { position: absolute; inset: 0; background: rgba(0,0,0,.72); }
.modal-caja {
  position: relative; background: var(--carbon); border: 1px solid #333; border-radius: 12px;
  padding: 26px; max-width: 460px; width: 100%; text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,.6);
}
.modal-tit { font-family: var(--display); font-size: 1.25rem; margin-bottom: 16px; }
.modal-img {
  display: block; max-width: 300px; width: 100%; height: auto; margin: 0 auto 14px;
  border-radius: 4px; box-shadow: 0 8px 30px rgba(0,0,0,.55);
}
.modal-nota { color: var(--gris); font-size: .82rem; margin-bottom: 20px; }
.modal-acciones { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-sec {
  font-family: var(--texto); background: transparent; color: var(--hueso);
  border: 1px solid #555; padding: 14px 24px; border-radius: 4px; cursor: pointer; font-size: 1rem;
}
.btn-sec:hover { border-color: var(--hueso); }

/* ── Carrito ── */
.cart-link {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px 8px 12px; border: 1.5px solid var(--rojo); border-radius: 999px;
  color: var(--hueso); font-weight: 600; letter-spacing: .01em;
  transition: background .15s, color .15s, transform .12s, box-shadow .15s;
}
.cart-link:hover {
  background: var(--rojo); color: #fff;
  transform: translateY(-1px); box-shadow: 0 6px 18px -6px var(--rojo);
}
.cart-link svg { width: 18px; height: 18px; stroke: currentColor; fill: none; flex: 0 0 auto; }
.cart-badge {
  position: absolute; top: -8px; right: -8px;
  min-width: 21px; height: 21px; padding: 0 6px;
  display: flex; align-items: center; justify-content: center;
  background: var(--rojo); color: #fff; border: 2px solid var(--negro);
  border-radius: 999px; font-size: .72rem; font-weight: 700; line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,.5);
}
@keyframes cartpop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.18); } 100% { transform: scale(1); opacity: 1; } }
.cart-badge.bump { animation: cartpop .35s ease; }

/* Cabecera en móvil: logo a la izquierda, carrito (solo icono) bien a la derecha */
@media (max-width: 480px) {
  .cabecera { padding: 13px 16px; }
  .marca-logo { height: 30px; }
  .marca-txt { font-size: 1.05rem; }
  .cart-link { padding: 8px 11px; }
  .cart-label { display: none; }
}

/* Bloque SEO "Sobre [pueblo]" (contenido único + enlazado interno) */
.seo-muni { max-width: 900px; margin: 0 auto; padding: 6px 28px 54px; color: var(--gris); line-height: 1.7; }
.seo-muni h2 { font-family: var(--display); color: var(--hueso); font-size: 1.4rem; margin: 26px 0 12px; }
.seo-muni h3 { color: var(--hueso); font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; margin: 26px 0 12px; }
.seo-muni p { margin-bottom: 12px; }
.seo-muni strong, .seo-muni em { color: var(--hueso); }
.seo-fuente { font-size: .85rem; opacity: .85; }
.seo-fuente a { color: var(--rojo); }
.seo-cercanos { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; }
.seo-cercanos a { display: inline-block; border: 1px solid #2a2a2a; border-radius: 999px; padding: 6px 14px; color: var(--hueso); font-size: .9rem; transition: border-color .15s, background .15s; }
.seo-cercanos a:hover { border-color: var(--rojo); background: rgba(200,16,46,.12); }

/* Hub de provincia (?prov=...) */
.prov-hub { max-width: 1080px; margin: 0 auto; padding: 40px 28px 70px; }
.prov-hub .migas { color: var(--gris); font-size: .85rem; margin-bottom: 10px; }
.prov-hub .migas a { color: var(--gris); }
.prov-hub .migas a:hover { color: var(--hueso); }
.prov-hub h1 { font-family: var(--display); font-size: 2rem; line-height: 1.1; margin-bottom: 12px; }
.prov-intro { color: var(--gris); max-width: 640px; margin-bottom: 30px; line-height: 1.6; }
.prov-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 18px; }
.prov-grid a { display: block; padding: 8px 6px; color: var(--hueso); border-bottom: 1px solid #1d1d1d; font-size: .95rem; transition: color .12s, padding-left .12s; }
.prov-grid a:hover { color: var(--rojo); padding-left: 10px; }
/* La miga de la ficha de municipio enlaza al hub de provincia */
.migas a { color: var(--gris); }
.migas a:hover { color: var(--rojo); }

/* Portada: índice de provincias (enlaces rastreables para SEO) */
.home-provincias { position: relative; z-index: 2; background: var(--negro); border-top: 1px solid #1d1d1d; padding: 46px 28px 60px; }
.home-provincias h2 { font-family: var(--display); color: var(--hueso); font-size: 1.3rem; text-align: center; margin-bottom: 24px; }
.prov-links { max-width: 980px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 6px 10px; justify-content: center; }
.prov-links a { color: var(--gris); font-size: .92rem; padding: 5px 12px; border: 1px solid #222; border-radius: 999px; transition: color .12s, border-color .12s; }
.prov-links a:hover { color: var(--hueso); border-color: var(--rojo); }

/* Botón de compartir (ficha de municipio) */
.share-wrap { position: relative; display: inline-block; margin-top: 10px; }
.btn-share { background: transparent; color: var(--hueso); border: 1px solid #333; border-radius: 10px; padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; transition: border-color .15s, color .15s; }
.btn-share:hover { border-color: var(--rojo); color: var(--rojo); }
.share-menu[hidden] { display: none; }
.share-menu { position: absolute; left: 0; bottom: calc(100% + 8px); background: var(--carbon); border: 1px solid #333; border-radius: 12px; padding: 6px; min-width: 180px; box-shadow: 0 14px 40px rgba(0,0,0,.5); z-index: 30; }
.share-menu a { display: block; padding: 9px 14px; color: var(--hueso); border-radius: 8px; font-size: .92rem; }
.share-menu a:hover { background: rgba(200,16,46,.14); color: var(--rojo); }
.toast[hidden] { display: none; }
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--carbon); color: var(--hueso); border: 1px solid #333; border-radius: 10px;
  padding: 13px 20px; box-shadow: 0 14px 40px rgba(0,0,0,.5); z-index: 60; opacity: 0; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast a { color: var(--rojo); font-weight: 600; }

.carrito-pag { max-width: 760px; margin: 0 auto; padding: 48px 24px 70px; }
.carrito-pag h1 { font-family: var(--display); font-size: 2rem; margin-bottom: 24px; }
.carrito-vacio { color: var(--gris); font-size: 1.05rem; text-align: center; padding: 40px 0; }
.carrito-vacio a { color: var(--rojo); }
.carrito-lista { display: flex; flex-direction: column; gap: 12px; }
.ci {
  display: grid; grid-template-columns: 64px 1fr auto auto auto; align-items: center; gap: 14px;
  background: var(--carbon); border: 1px solid #222; border-radius: 10px; padding: 12px 14px;
}
.ci-img { width: 64px; height: 64px; object-fit: contain; border-radius: 6px; background: #fff; }
.ci-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ci-info strong { font-size: .98rem; }
.ci-info span { color: var(--gris); font-size: .82rem; }
.ci-qty { display: flex; align-items: center; gap: 8px; }
.ci-qty button {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid #444; background: #1f1f1f; color: var(--hueso);
  cursor: pointer; font-size: 1rem; line-height: 1;
}
.ci-qty button:hover { border-color: var(--hueso); }
.ci-precio { font-family: var(--display); font-size: 1.05rem; white-space: nowrap; }
.ci-quitar { background: none; border: none; color: #777; cursor: pointer; font-size: 1.1rem; padding: 4px; }
.ci-quitar:hover { color: var(--rojo); }

/* ── Formulario de Envío (Carrito) ── */
.envio-form {
  margin-top: 36px; padding: 32px 28px;
  background: var(--carbon); border: 1px solid #2a2a2a; border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
}
.envio-form h2 {
  font-family: var(--display); font-size: 1.4rem; margin-bottom: 24px; color: var(--hueso);
}
.ef-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 16px;
}
.ef-grid label {
  display: flex; flex-direction: column; gap: 8px;
  font-size: .8rem; color: var(--gris); font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
}
.ef-grid label em { color: var(--rojo); font-style: normal; font-weight: 700; font-size: 1.1rem; line-height: 0; }
.ef-grid input, .ef-grid textarea {
  font-family: var(--texto); font-size: 1rem; text-transform: none; font-weight: 400; letter-spacing: normal;
  padding: 14px 16px; background: #0E0E0E; color: var(--hueso);
  border: 1px solid #333; border-radius: 8px;
  transition: all .2s ease;
  width: 100%; box-shadow: inset 0 2px 4px rgba(0,0,0,.2);
}
.ef-grid textarea { resize: vertical; min-height: 80px; }
.ef-grid input:focus, .ef-grid textarea:focus {
  outline: none; border-color: var(--rojo); box-shadow: inset 0 2px 4px rgba(0,0,0,.2), 0 0 0 1px var(--rojo);
}
.ef-grid input:hover, .ef-grid textarea:hover { border-color: #555; }
.ef-ancho { grid-column: 1 / -1; }
@media (max-width: 600px) {
  .ef-grid { grid-template-columns: 1fr; }
}

.carrito-resumen { margin-top: 36px; border-top: 1px solid #222; padding-top: 24px; max-width: 380px; margin-left: auto; }
.cr-linea { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--gris); }
.cr-total { color: var(--hueso); font-family: var(--display); font-size: 1.3rem; margin: 16px 0 4px; }
.carrito-resumen .btn-comprar { width: 100%; margin-top: 14px; }
.carrito-resumen .btn-sec { width: 100%; margin-top: 10px; }

@media (max-width: 560px) {
  .ci { grid-template-columns: 56px 1fr auto; grid-template-areas: "img info precio" "img qty quitar"; }
  .ci-img { grid-area: img; } .ci-info { grid-area: info; } .ci-qty { grid-area: qty; } .ci-precio { grid-area: precio; } .ci-quitar { grid-area: quitar; }
}

.pie { border-top: 1px solid #222; padding: 30px 28px; text-align: center; color: #555; font-size: .85rem; }
.pie-legal { margin-top: 10px; font-size: .8rem; color: #777; line-height: 1.9; }
.pie-legal a { color: #888; } .pie-legal a:hover { color: var(--hueso); }

/* ── Portada Premium Hero ── */
.home-body {
  margin: 0; padding: 0; min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--negro); position: relative;
  overflow-x: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background-position: center; background-size: cover; background-repeat: no-repeat;
  opacity: 0.85; filter: contrast(1.1) brightness(0.9);
}
.hero-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to bottom, rgba(14,14,14,0.4) 0%, rgba(14,14,14,0.85) 60%, rgba(14,14,14,1) 100%);
}

.hero-cabecera {
  position: relative; z-index: 10; border-bottom: 1px solid rgba(255,255,255,0.08);
  background: transparent;
}
.hero-main {
  position: relative; z-index: 10; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  max-width: 800px; margin: 0 auto; padding: 40px 24px 100px; text-align: center;
}
.hero-title {
  font-family: var(--display); font-size: 4.5rem; line-height: 1.1; margin-bottom: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #dcd8cd 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  color: var(--hueso); text-shadow: 0 4px 20px rgba(0,0,0,0.4);
  letter-spacing: -0.02em;
}
.hero-sub {
  color: #ccc; margin-bottom: 48px; font-size: 1.25rem; font-weight: 300;
  max-width: 600px; line-height: 1.6; text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.buscador-container {
  width: 100%; max-width: 560px; position: relative; margin: 0 auto;
}
.buscador-wrapper {
  position: relative; display: flex; align-items: center;
  background: rgba(255, 255, 255, 0.04); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.15); border-radius: 12px;
  transition: all 0.3s ease; box-shadow: 0 10px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
}
.buscador-wrapper:focus-within {
  background: rgba(255, 255, 255, 0.08); border-color: rgba(255,255,255,0.3);
  box-shadow: 0 15px 50px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.2);
}
.buscador-icon {
  position: absolute; left: 20px; width: 20px; height: 20px; color: rgba(255,255,255,0.5); pointer-events: none;
}
#buscador {
  width: 100%; padding: 20px 20px 20px 54px; font-size: 1.15rem; font-family: var(--texto);
  background: transparent; border: none; color: var(--hueso); outline: none;
}
#buscador::placeholder { color: rgba(255,255,255,0.4); }

.hero-lista {
  list-style: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: rgba(18, 18, 18, 0.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.7); max-height: 380px; overflow-y: auto;
  text-align: left; z-index: 20;
}
.hero-lista:empty { display: none; border: none; }
.hero-lista li { border-bottom: 1px solid rgba(255,255,255,0.05); }
.hero-lista li:last-child { border-bottom: none; }
.hero-lista a {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 16px 20px; color: var(--hueso); transition: background 0.2s;
}
.hero-lista a:hover { background: rgba(255,255,255,0.08); }
.hero-lista span { color: var(--gris); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

.hero-pie {
  position: relative; z-index: 10; border-top: none; padding: 24px;
  background: transparent; color: rgba(255,255,255,0.4);
}

.hero-trust {
  display: flex; gap: 16px; justify-content: center; margin-top: 40px;
  font-family: var(--texto); font-size: 0.8rem; color: rgba(255,255,255,0.6);
  flex-wrap: wrap; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;
}
.hero-trust span {
  background: rgba(255,255,255,0.04); padding: 6px 14px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

@media (max-width: 820px) {
  .ficha { grid-template-columns: 1fr; gap: 30px; }
  .lienzo-col { position: static; } /* apilado en móvil: el mapa no se fija */
  .info-col h1 { font-size: 2.1rem; }
  .hero-title { font-size: 3rem; }
  .hero-sub { font-size: 1.1rem; padding: 0 10px; }
}

/* ── Bloque SEO Portada ── */
.seo-home {
  background: var(--carbon); border-top: 1px solid #1d1d1d; padding: 60px 28px; text-align: center; color: var(--gris); line-height: 1.7; position: relative; z-index: 2;
}
.seo-home-inner {
  max-width: 800px; margin: 0 auto;
}
.seo-home h2 {
  font-family: var(--display); color: var(--hueso); font-size: 1.8rem; margin-bottom: 24px;
}
.seo-home p {
  margin-bottom: 16px; font-size: 0.95rem;
}
.seo-home strong {
  color: var(--hueso); font-weight: 600;
}
