/* ============================================================
   ESTILO RÚSTICO & ATÉRMICOS CORRIENTES — hoja de estilo
   Paleta: crema #fffaf2 · madera #6b4f3a · terracota #c8702c
           madera clara #a07c5c · verde #4a7c59 · borde #d8cfc1
   ============================================================ */

:root {
  --crema: #fffaf2;
  --crema-2: #f7efe2;
  --crema-3: #f1e6d4;
  --madera: #6b4f3a;
  --madera-osc: #4a3628;
  --madera-clara: #a07c5c;
  --terracota: #c8702c;
  --terracota-osc: #a85a1e;
  --terracota-suave: #f9e8d8;
  --verde: #4a7c59;
  --verde-osc: #2e5d3c;
  --verde-suave: #e8f5e9;
  --azul-mp: #009ee3;
  --borde: #d8cfc1;
  --borde-osc: #b8a990;
  --sombra: 0 2px 6px rgba(74, 54, 40, .12);
  --sombra-grande: 0 8px 28px rgba(74, 54, 40, .18);
  --radio-piedra: 10px 16px 12px 18px / 16px 10px 18px 12px;
  --radio-piedra-inv: 16px 10px 18px 12px / 10px 16px 12px 18px;
  --serif: 'Bitter', Georgia, 'Times New Roman', serif;
  --sans: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--madera-osc);
  background-color: var(--crema);
  background-image:
    repeating-linear-gradient(45deg, rgba(160, 124, 92, .035) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(-45deg, rgba(107, 79, 58, .025) 0 3px, transparent 3px 11px);
  font-size: 16px;
  line-height: 1.55;
}

h1, h2, h3, h4 { font-family: var(--serif); color: var(--madera); margin: 0 0 .4em; }
h2 { font-size: 1.6rem; }
a { color: var(--terracota-osc); }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 18px; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--crema);
  border-bottom: 3px solid var(--terracota);
  box-shadow: var(--sombra);
}
.topbar .fila { display: flex; align-items: center; gap: 14px; padding: 10px 0; }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.marca img { width: 46px; height: 46px; object-fit: contain; border-radius: 8px; background: var(--crema-3); }
.marca .nombre { font-family: var(--serif); font-weight: 700; color: var(--madera); font-size: 1.05rem; line-height: 1.15; }
.marca .nombre small { display: block; font-family: var(--sans); font-weight: 400; color: var(--madera-clara); font-size: .68rem; letter-spacing: .4px; text-transform: uppercase; }

.nav-principal { display: flex; gap: 4px; }
.nav-principal a {
  text-decoration: none; color: var(--madera); font-weight: 600; font-size: .92rem;
  padding: 8px 12px; border-radius: 8px; white-space: nowrap;
}
.nav-principal a:hover { background: var(--crema-3); }

.busqueda { position: relative; flex: 0 1 260px; }
.busqueda input {
  width: 100%; padding: 9px 12px 9px 36px;
  border: 2px solid var(--borde); border-radius: 999px;
  background: #fff; font-size: .95rem; color: var(--madera-osc);
}
.busqueda::before { content: '🔍'; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: .85rem; opacity: .6; }
.busqueda input:focus { outline: none; border-color: var(--terracota); }

.btn-carrito {
  position: relative; display: flex; align-items: center; gap: 8px;
  background: var(--terracota); color: #fff; border: none;
  padding: 10px 16px; border-radius: 999px; font-weight: 700; font-size: .95rem;
  box-shadow: var(--sombra);
}
.btn-carrito:hover { background: var(--terracota-osc); }
.btn-carrito .contador {
  background: #fff; color: var(--terracota-osc); border-radius: 999px;
  min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 800; padding: 0 5px;
}

/* ---------- hero ---------- */
.hero {
  background:
    linear-gradient(rgba(74, 54, 40, .74), rgba(74, 54, 40, .52)),
    url('../assets/img/hero.jpg') center 45% / cover no-repeat,
    var(--madera);
  color: var(--crema);
  padding: 72px 0 66px;
  text-align: center;
}
.hero h1 {
  color: var(--crema); font-size: clamp(1.7rem, 4.5vw, 2.9rem);
  max-width: 820px; margin: 0 auto .35em; text-shadow: 0 2px 4px rgba(0,0,0,.35);
}
.hero h1 em { color: #eeb877; font-style: normal; }
.hero p { max-width: 640px; margin: 0 auto 1.6em; font-size: 1.05rem; opacity: .95; }
.hero .sello {
  display: inline-block; background: rgba(255,250,242,.14); border: 1px solid rgba(255,250,242,.35);
  border-radius: 999px; padding: 6px 16px; font-size: .85rem; letter-spacing: .5px; margin-bottom: 1.1em;
}
.hero .ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: none; border-radius: 999px; padding: 12px 22px;
  font-weight: 700; font-size: 1rem; text-decoration: none; line-height: 1.2;
  transition: transform .06s ease;
}
.btn:active { transform: translateY(1px); }
.btn-terracota { background: var(--terracota); color: #fff; box-shadow: var(--sombra); }
.btn-terracota:hover { background: var(--terracota-osc); }
.btn-verde { background: #25d366; color: #04220f; box-shadow: var(--sombra); }
.btn-verde:hover { background: #1fb457; }
.btn-borde { background: transparent; color: var(--crema); border: 2px solid rgba(255,250,242,.6); }
.btn-borde:hover { background: rgba(255,250,242,.12); }
.btn-chico { padding: 7px 14px; font-size: .85rem; }
.btn-bloque { width: 100%; }

/* ---------- secciones ---------- */
.seccion { padding: 46px 0 30px; }
.seccion > .wrap > .titulo-seccion { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.titulo-seccion .icono { font-size: 1.7rem; }
.titulo-seccion p { margin: 0; color: var(--madera-clara); font-size: .95rem; width: 100%; }
.seccion + .seccion { border-top: 1px dashed var(--borde-osc); }

/* ---------- chips de categorías ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 22px; }
.chip {
  background: #fff; border: 2px solid var(--borde); color: var(--madera);
  border-radius: 999px; padding: 7px 14px; font-size: .9rem; font-weight: 600;
}
.chip:hover { border-color: var(--madera-clara); }
.chip.activo { background: var(--madera); border-color: var(--madera); color: var(--crema); }
.chip .cant { opacity: .6; font-weight: 500; font-size: .8rem; }

/* ---------- grid de productos ---------- */
.grid-productos {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.card-producto {
  background: #fff; border: 2px solid var(--borde); border-radius: var(--radio-piedra);
  padding: 12px; display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--sombra); position: relative;
  transition: box-shadow .15s ease, transform .15s ease;
}
.card-producto:hover { box-shadow: var(--sombra-grande); transform: translateY(-2px); }
.card-producto .foto {
  aspect-ratio: 1 / .82; border-radius: 8px; overflow: hidden; cursor: pointer;
  background: var(--crema-3);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.card-producto .foto img { width: 100%; height: 100%; object-fit: cover; }
.card-producto .foto video { width: 100%; height: 100%; object-fit: cover; background: #000; display: block; }
.card-producto .foto .placeholder {
  font-family: var(--serif); font-weight: 700; font-size: 2rem; color: var(--madera-clara);
  opacity: .55; letter-spacing: 2px;
}
.card-producto .foto::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(45deg, rgba(107,79,58,.04) 0 6px, transparent 6px 18px);
}
.badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 6px; z-index: 2; }
.badge {
  font-size: .68rem; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
}
.badge-at { background: #d8ecdb; color: #102b18; border: 1px solid #9dc4a5; }
.badge-caja { background: var(--terracota-suave); color: var(--terracota-osc); border: 1px solid #e5c4a3; }

.card-producto .nombre { font-weight: 700; font-size: 1rem; color: var(--madera-osc); line-height: 1.25; min-height: 2.5em; }
.card-producto .medidas { font-size: .8rem; color: var(--madera-clara); }
.card-producto .medio { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.precio { font-family: var(--serif); font-weight: 800; color: var(--terracota); font-size: 1.25rem; }
.precio small { font-size: .65rem; display: block; color: var(--madera-clara); font-weight: 400; }
.precio .precio-ho { font-size: .8rem; color: var(--madera-clara); font-weight: 600; }

.selector-color { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--madera-clara); flex-wrap: wrap; }
.swatches { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.swatch {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px var(--borde-osc); cursor: pointer; padding: 0;
}
.swatch.seleccionado { box-shadow: 0 0 0 2.5px var(--terracota); }
.nombre-color { font-style: normal; font-weight: 600; color: var(--madera); font-size: .74rem; }

.fila-agregar { display: flex; gap: 8px; }
.stepper {
  display: inline-flex; align-items: center; border: 2px solid var(--borde); border-radius: 999px; overflow: hidden; background: #fff;
}
.stepper button { width: 34px; height: 38px; border: none; background: none; font-size: 1.15rem; color: var(--madera); font-weight: 700; }
.stepper button:hover { background: var(--crema-3); }
.stepper input { width: 44px; text-align: center; border: none; font-size: 1rem; font-weight: 700; color: var(--madera-osc); background: transparent; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.btn-agregar {
  flex: 1; background: var(--terracota); color: #fff; border: none; border-radius: 999px;
  font-weight: 700; font-size: .9rem;
}
.btn-agregar:hover { background: var(--terracota-osc); }
.nota-card { font-size: .72rem; color: var(--madera-clara); font-style: italic; }

.subcat-titulo {
  font-family: var(--serif); color: var(--madera-clara); font-size: 1.02rem; font-style: italic;
  margin: 26px 0 10px; padding-bottom: 4px; border-bottom: 1px solid var(--borde);
  grid-column: 1 / -1;
}

/* ---------- calculadora ---------- */
.panel {
  background: #fff; border: 2px solid var(--borde); border-radius: var(--radio-piedra-inv);
  box-shadow: var(--sombra); padding: 22px;
}
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  border: 2px solid var(--borde); background: var(--crema-2); color: var(--madera);
  padding: 9px 18px; border-radius: 999px; font-weight: 700; font-size: .92rem;
}
.tab.activo { background: var(--madera); border-color: var(--madera); color: var(--crema); }

.form-fila { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.campo { display: flex; flex-direction: column; gap: 4px; flex: 1 1 170px; }
.campo label { font-size: .8rem; font-weight: 700; color: var(--madera); }
.campo input, .campo select {
  padding: 10px 12px; border: 2px solid var(--borde); border-radius: 8px;
  font-size: .95rem; background: #fff; color: var(--madera-osc); font-family: inherit;
}
.campo input:focus, .campo select:focus { outline: none; border-color: var(--terracota); }
.campo-chico { flex: 0 1 110px; }
#pileta-campos { display: contents; }

.checks { display: flex; flex-wrap: wrap; gap: 12px 20px; margin: 6px 0 14px; }
.checks label { display: flex; align-items: center; gap: 7px; font-size: .88rem; font-weight: 600; color: var(--madera); cursor: pointer; }
.checks input { width: 17px; height: 17px; accent-color: var(--terracota); }

.resultado-calc { background: var(--crema-2); border: 2px dashed var(--borde-osc); border-radius: 12px; padding: 16px; }
.resultado-calc h4 { margin-bottom: 8px; }
.tabla-res { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 8px 0; }
.tabla-res th {
  text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px;
  color: var(--madera-clara); border-bottom: 2px solid var(--borde); padding: 6px 8px;
}
.tabla-res td { padding: 8px; border-bottom: 1px solid var(--borde); vertical-align: top; }
.tabla-res td.detalle { font-size: .74rem; color: var(--madera-clara); }
.tabla-res td.num { text-align: right; white-space: nowrap; font-weight: 700; }
.tabla-res tr.total td { border-top: 2px solid var(--madera); border-bottom: none; font-size: 1.02rem; color: var(--terracota); }
.aviso-calc { font-size: .74rem; color: var(--madera-clara); font-style: italic; margin: 6px 0 0; }
.advertencia { color: #a85a1e; font-size: .76rem; }

/* ---------- info fábrica ---------- */
.info-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.info-card {
  background: #fff; border: 2px solid var(--borde); border-radius: var(--radio-piedra);
  padding: 18px; box-shadow: var(--sombra);
}
.info-card .icono { font-size: 1.6rem; margin-bottom: 6px; }
.info-card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.info-card p { margin: 0; font-size: .9rem; color: var(--madera); }
.info-card .destacado { background: #d8ecdb; color: #102b18; border: 1px solid #9dc4a5; border-radius: 8px; padding: 8px 10px; font-size: .84rem; margin-top: 8px; }

/* ---------- footer ---------- */
footer {
  background: var(--madera-osc); color: var(--crema-3);
  margin-top: 40px; padding: 34px 0 90px;
  background-image: repeating-linear-gradient(90deg, rgba(200,112,44,.08) 0 10px, transparent 10px 70px);
}
footer h4 { color: #fff6ec; font-size: 1rem; margin-bottom: 8px; }
footer .pie-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
footer a { color: #f2e9d8; }
footer .legal { font-size: .74rem; opacity: .7; margin-top: 22px; border-top: 1px solid rgba(255,250,242,.2); padding-top: 14px; }

/* ---------- botón flotante WhatsApp ---------- */
.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  width: 58px; height: 58px; border-radius: 50%;
  background: #25d366; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.3); text-decoration: none;
}
.wa-float svg { width: 30px; height: 30px; fill: #fff; }
.wa-float:hover { transform: scale(1.06); }

/* ---------- drawer carrito ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(43, 30, 20, .55); z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.overlay.abierto { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: -420px; width: min(420px, 100vw); max-height: 100vh; max-height: 100dvh;
  background: var(--crema); z-index: 100;
  transition: right .22s ease; box-shadow: -8px 0 30px rgba(0,0,0,.25);
  overflow-y: auto; overscroll-behavior: contain;
}
.drawer.abierto { right: 0; }
.drawer-cab { padding: 16px 18px; border-bottom: 3px solid var(--terracota); display: flex; align-items: center; justify-content: space-between; background: #fff; position: sticky; top: 0; z-index: 2; }
.drawer-cab h3 { margin: 0; }
.btn-cerrar { background: none; border: none; font-size: 1.5rem; color: var(--madera); line-height: 1; }
.drawer-cuerpo { padding: 14px 18px; }
.drawer-pie { padding: 16px 18px; border-top: 2px solid var(--borde); background: #fff; display: flex; flex-direction: column; gap: 10px; position: sticky; bottom: 0; }

.item-carrito {
  display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--borde);
}
.item-carrito .mini-foto {
  width: 52px; height: 52px; border-radius: 8px; background: var(--crema-3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 700; color: var(--madera-clara); font-size: 1.05rem; flex-shrink: 0; overflow: hidden;
}
.item-carrito .mini-foto img { width: 100%; height: 100%; object-fit: cover; }
.item-carrito .datos { flex: 1; min-width: 0; }
.item-carrito .nombre-item { font-weight: 700; font-size: .88rem; line-height: 1.2; }
.item-carrito .detalle-item { font-size: .72rem; color: var(--madera-clara); }
.item-carrito .fila-item { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.item-carrito .subtotal-item { font-weight: 800; color: var(--terracota); font-size: .92rem; }
.btn-quitar { background: none; border: none; color: #b0483a; font-size: .76rem; text-decoration: underline; padding: 0; }
.carrito-vacio { text-align: center; color: var(--madera-clara); padding: 40px 10px; }
.carrito-vacio .icono { font-size: 2.6rem; margin-bottom: 8px; }

.total-carrito { display: flex; justify-content: space-between; align-items: baseline; }
.total-carrito .monto { font-family: var(--serif); font-weight: 800; font-size: 1.5rem; color: var(--terracota); }
.nota-pie { font-size: .7rem; color: var(--madera-clara); text-align: center; margin: 0; }

/* ---------- modales ---------- */
.modal {
  position: fixed; inset: 0; z-index: 110; display: none;
  align-items: flex-end; justify-content: center; background: rgba(43, 30, 20, .6);
}
.modal.abierto { display: flex; }
.modal-caja {
  background: var(--crema); width: min(720px, 100vw); max-height: 92vh;
  border-radius: 18px 18px 0 0; overflow-y: auto; position: relative;
  padding: 22px; box-shadow: var(--sombra-grande);
}
@media (min-width: 720px) {
  .modal { align-items: center; padding: 20px; }
  .modal-caja { border-radius: var(--radio-piedra-inv); }
}
.modal-cerrar { position: absolute; top: 10px; right: 12px; }
.modal-caja h3 { padding-right: 40px; }
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px);
  background: var(--madera-osc); color: var(--crema); padding: 12px 22px; border-radius: 999px;
  font-weight: 700; font-size: .92rem; z-index: 130; opacity: 0; pointer-events: none;
  transition: all .25s ease; box-shadow: var(--sombra-grande); max-width: 92vw; text-align: center;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- ficha de producto (modal) ---------- */
.ficha { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .ficha { grid-template-columns: 1fr 1fr; } }
.ficha .foto-grande {
  aspect-ratio: 1 / .9; border-radius: 12px; background: var(--crema-3);
  display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative;
}
.ficha .foto-grande img { width: 100%; height: 100%; object-fit: cover; }
.ficha .foto-grande video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.ficha .foto-grande .placeholder { font-family: var(--serif); font-size: 3rem; color: var(--madera-clara); opacity: .5; }
.mini-calc { background: var(--crema-2); border: 2px dashed var(--borde-osc); border-radius: 12px; padding: 14px; margin-top: 12px; }
.mini-calc h4 { font-size: .95rem; }
.mini-calc .res { font-size: .9rem; margin: 8px 0; }
.mini-calc .res strong { color: var(--terracota); font-size: 1.05rem; }

/* ---------- producción ---------- */
#produccion { display: none; }
#produccion.visible { display: block; }
.pin-caja { max-width: 380px; margin: 0 auto; text-align: center; }
.paleta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.color-card { border: 2px solid var(--borde); border-radius: 10px; overflow: hidden; background: #fff; cursor: pointer; }
.color-card .muestra { height: 46px; }
.color-card .etq { padding: 6px 8px; font-size: .74rem; font-weight: 700; color: var(--madera); }
.color-card.seleccionado { border-color: var(--terracota); box-shadow: 0 0 0 2px var(--terracota); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .nav-principal { display: none; }
  .busqueda { flex: 1 1 140px; order: 3; }
  .topbar .fila { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .grid-productos { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
  .card-producto .nombre { font-size: .9rem; }
  .precio { font-size: 1.1rem; }
  .hero { padding: 44px 0 40px; }
  .btn-carrito .txt { display: none; }
  .seccion { padding: 34px 0 20px; }
}

/* ---------- panel admin (#admin) ---------- */
.adm-lista { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.adm-item {
  text-align: left; background: var(--crema-2); border: 1.5px solid var(--borde);
  border-radius: 8px; padding: 9px 12px; font-size: .88rem; color: var(--madera);
  cursor: pointer; font-family: var(--sans);
}
.adm-item:hover { border-color: var(--terracota); }
.fila-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .fila-edit { grid-template-columns: 1fr; } }


/* ---------- galeria de fotos (ficha) ---------- */
.gal { display: flex; flex-direction: column; gap: 8px; height: auto; position: relative; }
/* flechas grandes a los costados del recuadro: se entiende al toque que hay más fotos */
.gal-flecha { position: absolute; top: 42%; transform: translateY(-50%); z-index: 6;
  width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--borde-osc);
  background: var(--crema-2); color: var(--madera); font-size: 1.7rem; font-weight: 700; line-height: 1;
  cursor: pointer; box-shadow: var(--sombra); display: flex; align-items: center; justify-content: center; padding: 0; }
.gal-flecha:hover { background: var(--terracota); border-color: var(--terracota); color: #fff6ec; }
html[data-tema="noche"] .gal-flecha:hover { color: #241a0d; }
.gal-flecha-ant { left: -12px; }
.gal-flecha-sig { right: -12px; }
.gal-viewer { aspect-ratio: 1 / .9; border-radius: 10px; overflow: hidden; background: var(--crema-3); display: flex; align-items: center; justify-content: center; }
.gal-viewer img { width: 100%; height: 100%; object-fit: contain; background: #fffaf2; }
.gal-viewer video { width: 100%; height: 100%; object-fit: contain; background: #000; }
/* en escritorio: el visor ocupa todo el alto de la ficha (la columna de info es
   la que manda) — sin espacio vacío abajo, foto más grande (dueño 10/09/2026).
   Piso moderado para que las miniaturas de las otras fotos queden siempre a la vista */
@media (min-width: 640px) {
  .ficha .gal { height: 100%; }
  .ficha .gal-viewer { aspect-ratio: auto; flex: 1; min-height: 300px; }
}
@media (max-width: 640px) {
  .gal-flecha { width: 36px; height: 36px; font-size: 1.4rem; }
  .gal-flecha-ant { left: -6px; }
  .gal-flecha-sig { right: -6px; }
}
.gal-bar { display: flex; align-items: center; justify-content: center; gap: 10px; }
.gal-btn { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--borde-osc); background: var(--crema-2); color: var(--madera); font-size: 1.2rem; cursor: pointer; line-height: 1; }
.gal-btn:hover { border-color: var(--terracota); }
.gal-count { font-size: .8rem; color: var(--madera-clara); font-weight: 600; min-width: 44px; text-align: center; }
.gal-play { border: 1.5px solid var(--terracota); background: var(--crema-2); color: var(--terracota-osc, #a85a1f); border-radius: 999px; padding: 6px 14px; font-size: .8rem; font-weight: 700; cursor: pointer; }
.gal-play.activo { background: var(--terracota); color: #fff; }
.gal-thumbs { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.gal-thumb { width: 80px; height: 80px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; font-size: .9rem; color: #fff; }
.gal-thumb.activo { border-color: var(--terracota); }

.adm-eliminado { opacity: .5; text-decoration: line-through; }

/* ---------- asistente de materiales ---------- */
#asistente-btn {
  position: fixed; bottom: 18px; left: 16px; z-index: 60;
  width: 54px; height: 54px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--madera); color: #fff; font-size: 1.5rem;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
#asistente-btn:hover { background: var(--madera-osc); }
#asistente-panel {
  position: fixed; bottom: 82px; left: 16px; z-index: 60;
  width: min(360px, calc(100vw - 32px)); max-height: 70vh;
  display: flex; flex-direction: column;
  background: #fff; border: 2px solid var(--borde); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2); overflow: hidden;
}
#asistente-panel[hidden] { display: none; }
.asistente-cab {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--madera); color: var(--crema); padding: 10px 14px; font-size: .95rem;
}
.asistente-cab button { background: none; border: none; color: var(--crema); font-size: 1rem; cursor: pointer; }
#asistente-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--crema); }
#asistente-msgs .msg { padding: 8px 12px; border-radius: 10px; font-size: .86rem; line-height: 1.45; max-width: 88%; }
#asistente-msgs .msg.bot { background: #fff; border: 1px solid var(--borde); align-self: flex-start; color: var(--madera-osc); }
#asistente-msgs .msg.yo { background: var(--terracota); color: #fff; align-self: flex-end; }
#asistente-msgs .msg em { color: var(--madera-clara); font-size: .8rem; }
.asistente-pie { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--borde); background: #fff; }
.asistente-pie input { flex: 1; }
#asistente-foto { border: 1.5px solid var(--borde); background: var(--crema-2); border-radius: 8px; cursor: pointer; font-size: 1rem; padding: 4px 8px; }
#asistente-foto:hover { background: var(--crema); }
#asistente-micro { border: 1.5px solid var(--borde); background: var(--crema-2); border-radius: 8px; cursor: pointer; font-size: 1rem; padding: 4px 8px; touch-action: none; }
#asistente-micro:hover { background: var(--crema); }
.asistente-pie button {
  background: var(--terracota); color: #fff; border: none; border-radius: 8px;
  padding: 8px 14px; font-weight: 700; cursor: pointer;
}

/* ---------- ofertas por fecha ---------- */
.badge-oferta { background: var(--terracota); color: #fff; font-weight: 800; letter-spacing: .5px; }
.card-oferta { border: 2px solid var(--terracota); }
#ofertas { background: linear-gradient(rgba(200,112,44,.08), transparent); }

/* ---------- flechas de navegacion entre productos (ficha) ---------- */
#modal-ficha-caja { position: relative; }
.ficha-nav {
  position: absolute; top: 46%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid var(--borde); background: rgba(255, 250, 242, .96);
  color: var(--madera); font-size: 1.9rem; line-height: 1; cursor: pointer; z-index: 6;
  box-shadow: 0 3px 10px rgba(0,0,0,.18); display: flex; align-items: center; justify-content: center;
}
.ficha-nav:hover { border-color: var(--terracota); color: var(--terracota); }
.ficha-prev { left: 10px; }
.ficha-next { right: 10px; }
@media (min-width: 900px) {
  .ficha-prev { left: -60px; }
  .ficha-next { right: -60px; }
}

/* ---------- modo seleccion en catalogo (solo admin) ---------- */
.card-producto { position: relative; }
.sel-x {
  position: absolute; top: 6px; right: 6px; z-index: 8;
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid #b0483a; background: rgba(255, 250, 242, .95);
  color: #b0483a; font-size: 1rem; font-weight: 800; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.2); display: none;
}
body.modo-sel .sel-x { display: flex; align-items: center; justify-content: center; }
body.modo-sel .sel-x:hover { background: #b0483a; color: #fff; }
#sel-bar {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  z-index: 70; display: flex; gap: 8px; align-items: center;
  background: var(--madera); padding: 8px 12px; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0,0,0,.3); font-size: .85rem;
}
#sel-bar button {
  border: none; border-radius: 999px; padding: 7px 14px; font-weight: 700;
  cursor: pointer; font-size: .82rem;
}
#sel-toggle { background: var(--terracota); color: #fff; }
#sel-wa { background: #25d366; color: #06331a; }
#sel-salir { background: var(--crema); color: var(--madera); }
#sel-bar-cont { color: var(--crema); font-weight: 600; padding: 0 4px; }

/* ---------- frase motivadora flotante ---------- */
#frase-flotante {
  position: fixed; z-index: 4;
  max-width: min(300px, 62vw);
  font-family: var(--serif); font-size: .92rem; line-height: 1.45;
  color: var(--madera); background: rgba(255, 250, 242, .93);
  border: 1.5px solid var(--borde); border-left: 4px solid var(--terracota);
  border-radius: 12px; padding: 10px 14px;
  box-shadow: 0 6px 18px rgba(74, 54, 40, .16);
  opacity: 0; transform: translateY(12px);
  transition: opacity 1.1s ease, transform 1.1s ease;
  pointer-events: none;
}
#frase-flotante.visible { opacity: 1; transform: translateY(0); }
#frase-flotante.zona-izq { left: 18px; bottom: 120px; }
#frase-flotante.zona-der { right: 18px; bottom: 120px; }
#frase-flotante.zona-izq-alta { left: 18px; top: 20%; }
#frase-flotante.zona-centro-baja { left: 50%; margin-left: calc(-150px + var(--desvio, 0px)); bottom: 84px; }
@media (max-width: 640px) {
  #frase-flotante { font-size: .82rem; max-width: 74vw; }
  #frase-flotante.zona-izq-alta { top: auto; bottom: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  #frase-flotante { transition: opacity .4s ease; transform: none; }
}


/* ---------- lista de precios (modal) ---------- */
.modal-precios {
  position: fixed; inset: 0; z-index: 50; display: none;
  background: rgba(74, 54, 40, .55); overflow-y: auto; padding: 20px;
}
.modal-precios.abierto { display: flex; align-items: flex-start; justify-content: center; }
.precios-caja {
  background: var(--crema); border-radius: 16px; padding: 24px;
  max-width: 900px; width: 100%; position: relative; margin: 20px 0;
  box-shadow: 0 10px 40px rgba(0,0,0,.3);
}
.precios-caja .btn-cerrar {
  position: absolute; top: 14px; right: 14px; width: 36px; height: 36px;
  border-radius: 50%; border: none; background: var(--crema-2);
  font-size: 1.1rem; cursor: pointer; color: var(--madera);
}
.precios-scroll { max-height: 60vh; overflow-y: auto; }
.grupo-precios h3 {
  font-family: var(--serif); color: var(--madera); font-size: 1.1rem;
  margin: 16px 0 6px; padding-bottom: 4px; border-bottom: 2px solid var(--terracota);
}
.tabla-precios { width: 100%; border-collapse: collapse; }
.tabla-precios th {
  background: var(--crema-2); color: var(--madera); font-size: .72rem;
  padding: 6px 8px; text-align: left; font-weight: 700; text-transform: uppercase;
}
.tabla-precios td { padding: 5px 8px; border-bottom: 1px solid var(--borde); font-size: .82rem; }
.tabla-precios .precio { text-align: right; white-space: nowrap; font-weight: 600; }
.tabla-precios .centro { text-align: center; font-size: .75rem; }

/* ---------- drag & drop fotos ---------- */
.card-producto.drop-activo { transform: scale(1.03); }
.drop-badge {
  position: absolute; top: 6px; left: 6px; z-index: 9;
  background: var(--verde); color: #fff; font-size: .72rem; font-weight: 700;
  border-radius: 8px; padding: 4px 8px; display: none; align-items: center; gap: 3px;
}
#fotos-bar {
  position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%);
  z-index: 71; display: flex; gap: 10px; align-items: center;
  background: var(--verde); padding: 8px 14px; border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0,0,0,.25); font-size: .85rem; color: #fff;
}
#fotos-bar[hidden] { display: none; }

/* ---------- comparador de bordes en ficha ---------- */
.comparador-bordes { margin-top: 18px; padding: 14px; background: var(--crema-2); border-radius: 12px; border: 1.5px dashed var(--borde-osc); grid-column: 1 / -1; }
.comp-grid { display: flex; gap: 6px; flex-wrap: wrap; }
.comp-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: #fff; border: 1.5px solid var(--borde); border-radius: 10px;
  padding: 8px 12px; cursor: pointer; min-width: 130px; flex: 1 1 130px;
  transition: border-color .15s, transform .1s;
}
.comp-item:hover { border-color: var(--terracota); transform: translateY(-1px); }
.comp-nombre { font-size: .78rem; font-weight: 700; color: var(--madera); }
.comp-precio { font-size: .72rem; color: var(--madera-clara); }

/* ---------- filtro principal atermico/hormigon ---------- */
.filtro-principal {
  display: flex; gap: 12px; margin: 0 0 16px; flex-wrap: wrap;
  justify-content: center;
}
.fp-btn {
  flex: 0 1 auto; min-width: 140px; max-width: 220px;
  padding: 14px 20px; border: 2px solid var(--borde);
  border-radius: 14px; cursor: pointer; font-size: .92rem; font-weight: 700;
  font-family: var(--serif); background: #fff; color: var(--madera);
  transition: all .18s ease; text-align: center; line-height: 1.35;
  box-shadow: 0 1px 4px rgba(74,54,40,.06);
}
.fp-btn small {
  display: block; font-size: .70rem; font-weight: 400;
  color: var(--madera-clara); margin-top: 2px;
}
.fp-btn:hover { border-color: var(--madera-clara); transform: translateY(-1px); }
.fp-btn.activo { font-weight: 800; transform: translateY(-2px); }

.fp-atermico.activo {
  background: #d8ecdb;
  border-color: #6b9a78; color: #102b18;
  box-shadow: 0 4px 14px rgba(74, 124, 89, .25);
}
.fp-atermico.activo small { color: #2e5d3c; }

.fp-hormigon.activo {
  background: linear-gradient(135deg, #f4f3f1, #e8e6e3);
  border-color: #7a7a7a; color: #4a4a4a;
  box-shadow: 0 4px 14px rgba(100,100,100,.15);
}
.fp-hormigon.activo small { color: #8a8a8a; }

.fp-todo.activo {
  background: var(--crema); border-color: var(--madera);
  box-shadow: 0 4px 14px rgba(107,79,58,.12);
}
.fp-todo.activo small { color: var(--madera-clara); }

@media (max-width: 640px) {
  .fp-btn { flex: 1 1 100%; max-width: none; padding: 12px; }
}

/* ===== ADMIN: gestion de fotos en la ficha ===== */
.gal-thumb { position: relative; }
.adm-fbtns { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 3px; background: rgba(15,15,25,.82); padding: 3px 0; border-radius: 0 0 8px 8px; z-index: 2; }
.adm-fbtns i { cursor: pointer; color: #fff; font-style: normal; font-size: 15px; line-height: 1; padding: 3px 5px; border-radius: 6px; user-select: none; }
.adm-fbtns i:hover { background: var(--terracota); }
.adm-fbtns i[data-fotoacc="ocultar"]:hover { background: #b0483a; }
.gal-adm-aviso { margin-top: 6px; font-size: .8rem; color: var(--madera-clara); text-align: center; }
.gal-adm-aviso button { background: none; border: none; color: var(--verde); cursor: pointer; font-size: .8rem; text-decoration: underline; padding: 0; }
#adm-toast { position: fixed; top: 76px; right: 16px; z-index: 600; background: #1f4d33; color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: .85rem; box-shadow: 0 4px 14px rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .25s; max-width: 320px; }
#adm-toast.visible { opacity: 1; }

/* ===== ADMIN: editor en la ficha + botón cámara + selector de pegado ===== */
.ficha-editar { margin-top: 14px; border: 2px dashed var(--terracota); border-radius: 12px; padding: 12px; background: rgba(201,169,97,.07); }
.ficha-editar h4 { font-family: var(--serif); color: var(--madera); margin: 0 0 10px; font-size: 1rem; }
.ficha-editar h4 small { font-size: .72rem; color: var(--madera-clara); }
.fe-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.adm-camara { position: absolute; top: 6px; right: 6px; z-index: 6; background: rgba(15,15,25,.82); color: #fff; border: none; border-radius: 8px; padding: 4px 9px; font-size: .8rem; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.adm-camara:hover { background: var(--terracota); }
#adm-picker { position: fixed; inset: 0; background: rgba(8,8,16,.62); z-index: 700; display: flex; align-items: center; justify-content: center; padding: 16px; }
.adm-picker-caja { background: #f7f2e7; color: var(--madera); border-radius: 14px; padding: 16px; width: min(480px, 94vw); box-shadow: 0 10px 40px rgba(0,0,0,.45); }
.adm-picker-caja .adm-item { display: block; width: 100%; text-align: left; }

/* ===== REDES EN HEADER + COMPARTIR ===== */
.redes-header { display: flex; gap: 10px; align-items: center; margin-left: 4px; }
.redes-header a { color: var(--madera); display: flex; padding: 4px; border-radius: 8px; transition: color .15s, background .15s; }
.redes-header a:hover { color: var(--terracota); background: rgba(201,169,97,.15); }
.btn-share { flex: 0 0 auto; width: 44px; font-size: 1.05rem; padding: 0; display: flex; align-items: center; justify-content: center; }
.btn-compartir { background: rgba(255,255,255,.14); }
.btn-compartir:hover { background: rgba(255,255,255,.24); }
#btn-compartir-pedido { background: none; border: 2px solid var(--borde); color: var(--madera); }
#btn-compartir-pedido:hover { border-color: var(--madera); }
@media (max-width: 900px) {
  .redes-header { gap: 6px; }
  .redes-header a { padding: 5px; }
}
@media (max-width: 640px) {
  .busqueda { display: none; }
  .redes-header { margin-left: auto; margin-right: 2px; }
}

/* ===== OBRAS + FAQ + MAPA + OPINIONES + CONSULTAR + LIGHTBOX ===== */
.obras-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.obra-thumb { aspect-ratio: 4/3; border-radius: 12px; border: none; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.obra-thumb:hover { transform: scale(1.04); box-shadow: 0 6px 18px rgba(0,0,0,.18); }
#lightbox { position: fixed; inset: 0; background: rgba(8,8,14,.92); z-index: 800; display: none; align-items: center; justify-content: center; flex-direction: column; padding: 30px; }
#lightbox.abierto { display: flex; }
#lightbox img { max-width: min(94vw, 1000px); max-height: 78vh; border-radius: 10px; box-shadow: 0 10px 50px rgba(0,0,0,.5); }
#lightbox .lb-titulo { color: #f1e8d8; margin-top: 12px; font-size: .95rem; }
#lightbox .lb-cerrar { position: absolute; top: 18px; right: 22px; background: none; border: none; color: #fff; font-size: 1.6rem; cursor: pointer; }
#lightbox .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.14); border: none; color: #fff; font-size: 2.6rem; width: 54px; height: 74px; border-radius: 12px; cursor: pointer; }
#lightbox .lb-nav:hover { background: var(--terracota); }
#lightbox .lb-ant { left: 14px; }
#lightbox .lb-sig { right: 14px; }
.faq-lista { display: flex; flex-direction: column; gap: 10px; max-width: 820px; margin: 0 auto; }
.faq-lista details { background: #fff; border: 1px solid var(--borde); border-radius: 12px; padding: 14px 18px; box-shadow: 0 2px 8px rgba(74,54,40,.06); }
.faq-lista summary { font-weight: 700; color: var(--madera); cursor: pointer; font-size: .98rem; }
.faq-lista summary:hover { color: var(--terracota); }
.faq-lista details[open] summary { margin-bottom: 8px; }
.faq-lista details p { margin: 0; font-size: .9rem; color: #4d4436; line-height: 1.55; }
.mapa-fabrica { margin-top: 22px; }
.mapa-fabrica iframe { width: 100%; height: 340px; border: 0; border-radius: 14px; box-shadow: 0 4px 18px rgba(74,54,40,.15); }
.opiniones-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.opinion { background: #fff; border-radius: 14px; padding: 18px; border: 1px solid var(--borde); }
.op-texto { font-size: .92rem; line-height: 1.5; color: #4d4436; font-style: italic; }
.op-nombre { margin-top: 10px; font-weight: 700; color: var(--madera); font-size: .85rem; }
.btn-consultar { background: #25d366; color: #fff; flex: 1 1 auto; }
.btn-consultar:hover { background: #1fbb5a; }
@media (max-width: 640px) {
  .obras-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  #lightbox .lb-nav { width: 40px; height: 60px; font-size: 2rem; }
}


/* ===== FABRICA EN ACCION (flotante + modal de videos) ===== */
.fabrica-float {
  position: fixed; left: 16px; bottom: 82px; z-index: 60;
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--madera), #4a3423);
  color: #fff; font-weight: 700; font-size: .8rem;
  border: none; border-radius: 999px; padding: 10px 16px;
  cursor: pointer; box-shadow: 0 8px 22px rgba(43, 30, 20, .5);
}
.fabrica-float:hover { transform: scale(1.05); }
.fabrica-float small { font-weight: 700; }
@media (max-width: 640px) {
  .fabrica-float { padding: 9px 12px; font-size: .72rem; left: 12px; bottom: 80px; }
}
.fab-videos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 12px; }
@media (max-width: 520px) { .fab-videos { grid-template-columns: 1fr; } }
.fab-videos video {
  width: 100%; max-height: 56vh; border-radius: 12px; background: #1c140d;
  display: block;
}
.fab-fecha { font-size: .72rem; color: var(--madera-clara); margin-top: 4px; text-align: center; }

/* ===== OFERTAS FLOTANTE ===== */
.ofertas-float {
  position: fixed; right: 18px; bottom: 86px; z-index: 60;
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--terracota), #c2542e);
  color: #fff; font-weight: 800; font-size: .95rem;
  border: none; border-radius: 999px; padding: 13px 20px;
  cursor: pointer; box-shadow: 0 8px 22px rgba(178, 84, 48, .45);
  animation: ofertas-pulse 2.2s infinite;
}
.ofertas-float:hover { transform: scale(1.05); }
.ofertas-float[hidden] { display: none; } /* sin ofertas vigentes, el boton no aparece (el display:flex de arriba pisaba el hidden) */
@keyframes ofertas-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 22px rgba(178, 84, 48, .45); }
  50% { transform: scale(1.06); box-shadow: 0 10px 30px rgba(178, 84, 48, .65); }
}
.oferta-modal-card { background: #fff; border-radius: 14px; padding: 12px; border: 1px solid var(--borde); }
@media (max-width: 640px) {
  .ofertas-float { padding: 11px 16px; font-size: .85rem; right: 12px; bottom: 80px; }
}


/* ===== ADMIN: arrastrar miniaturas para reordenar ===== */
.gal-thumbs.adm-drag .gal-thumb { cursor: grab; touch-action: none; }
.gal-thumbs.adm-drag .gal-thumb.arrastrando { opacity: .55; cursor: grabbing; transform: scale(1.12); border-color: var(--terracota); z-index: 5; }


/* ===== ADMIN: zoom del visor ===== */
#gal-viewer img, #gal-viewer video { transition: transform .08s linear; }

/* ===== ADMIN: seccion oculta para visitantes (el admin la ve tenue con cartel) ===== */
.sec-oculta { opacity: .45; }

/* ===== botones flotantes: navegar por modulo ===== */
#nav-modulos { position: fixed; right: 18px; bottom: 110px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
#nav-modulos button {
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--borde);
  background: rgba(255, 252, 245, .95); color: var(--madera);
  font-size: 1.25rem; line-height: 1; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.18);
}
#nav-modulos button:hover { border-color: var(--terracota); color: var(--terracota); }
#nav-modulos button[hidden] { display: none; }
@media (max-width: 640px) { #nav-modulos { bottom: 96px; right: 12px; } #nav-modulos button { width: 40px; height: 40px; } }

/* ===== PWA: boton instalar app ===== */
#btn-instalar-pwa {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px;
  display: inline-flex; align-items: center; z-index: 70;
  background: var(--madera); color: #fff; border: none; border-radius: 30px;
  padding: 12px 20px; font-size: .95rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
#btn-instalar-pwa:hover { background: var(--terracota); }

/* ===== carrito: sugerencias de insumos ===== */
.sugerencia-insumos {
  margin-top: 12px; padding: 12px; border: 2px dashed var(--verde);
  border-radius: 12px; background: rgba(74, 124, 89, .07); font-size: .85rem;
}
.sugerencia-insumos strong { color: var(--verde-osc); }
.sug-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; }
.sug-item small { opacity: .8; }
.sug-nombre { font-weight: 700; }

/* ===== buscador de productos en la calculadora ===== */
.buscador-prod { position: relative; }
.buscador-input {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--borde); border-radius: 10px;
  font: inherit; background: #fff; color: var(--madera);
}
.buscador-input:focus { outline: 2px solid var(--terracota); outline-offset: -1px; }
.buscador-lista {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60;
  background: #fff; border: 1.5px solid var(--borde); border-radius: 10px;
  max-height: 265px; overflow-y: auto; box-shadow: 0 10px 24px rgba(74,54,40,.18);
}
.buscador-op {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0;
  background: none; font: inherit; font-size: .92rem; color: var(--madera);
  cursor: pointer; border-bottom: 1px solid var(--crema-3);
}
.buscador-op:last-child { border-bottom: 0; }
.buscador-op:hover, .buscador-op.activa { background: var(--crema-2); }
.buscador-vacio { padding: 10px 12px; font-size: .88rem; color: var(--madera-clara); }
.badge-ho { background: #d8cfc1; color: #4a3628; }

/* ---- muestras de colores atérmicos: círculos con foto real de fábrica ----
   (c-swatch para NO chocar con .swatch del selector de color de las fichas) */
.colores-swatches { display: flex; gap: 16px; flex-wrap: wrap; margin: 14px 0 4px; }
.c-swatch { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 100px; }
.c-swatch img {
  width: 92px; height: 92px; border-radius: 50%; object-fit: cover;
  border: 3px solid #fff; box-shadow: var(--sombra);
  cursor: zoom-in; transition: transform .18s ease;
}
.c-swatch:hover img, .c-swatch:focus-within img { transform: scale(1.08); }
.c-swatch b { font-size: .85rem; color: var(--madera); }
.c-swatch span { font-size: .72rem; color: var(--madera-clara); text-align: center; line-height: 1.25; }
.colores-pie { font-size: .78rem; color: var(--madera-clara); margin: 6px 0 0; }

/* zoom de la muestra de color (tap en cel / clic en pc) */
.lupa-color {
  position: fixed; inset: 0; z-index: 1000; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: rgba(38, 26, 18, .85); padding: 24px;
}
.lupa-color.abierto { display: flex; }
.lupa-color img {
  width: min(72vw, 360px); height: min(72vw, 360px); border-radius: 50%;
  object-fit: cover; border: 5px solid #fff; box-shadow: var(--sombra-grande);
}
.lupa-color b { font-size: 1.35rem; color: #fff; font-family: var(--serif); }
.lupa-color span { font-size: .92rem; color: #ead9c0; text-align: center; }
.lupa-color .lupa-cerrar {
  position: absolute; top: 14px; right: 16px; width: 42px; height: 42px;
  border: 0; border-radius: 50%; background: rgba(255,255,255,.16);
  color: #fff; font-size: 1.2rem; cursor: pointer;
}

/* ---- páginas de manual: documento impreso, SIEMPRE paleta día (tipografía oscura) ----
   En modo noche las vars dan texto crema/dorado; acá se re-fijan al valor día
   para que los manuales se lean negro sobre crema como un documento. */
body.pagina-manual {
  color-scheme: light;
  --crema: #fffaf2; --crema-2: #f7efe2; --crema-3: #f1e6d4;
  --madera: #6b4f3a; --madera-osc: #4a3628; --madera-clara: #a07c5c;
  --terracota: #c8702c; --terracota-osc: #a85a1e; --terracota-suave: #f9e8d8;
  --verde: #4a7c59; --verde-osc: #2e5d3c; --verde-suave: #e8f5e9;
  --borde: #d8cfc1; --borde-osc: #b8a990;
  --sombra: 0 2px 6px rgba(74, 54, 40, .12);
  --sombra-grande: 0 8px 28px rgba(74, 54, 40, .18);
}
html[data-tema="noche"] body.pagina-manual {
  background-color: #fffaf2;
  background-image:
    repeating-linear-gradient(45deg, rgba(160, 124, 92, .035) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(-45deg, rgba(107, 79, 58, .025) 0 3px, transparent 3px 11px);
}
html[data-tema="noche"] body.pagina-manual::after { content: none; }
html[data-tema="noche"] body.pagina-manual .topbar { background: var(--crema); }
html[data-tema="noche"] body.pagina-manual a { color: var(--terracota-osc); }
