/* ============================================================
   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: #06331a; 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: var(--verde-suave); color: var(--verde-osc); border: 1px solid #b5d4bd; }
.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: var(--verde-suave); border: 1px solid #b5d4bd; 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: #eeb877; 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: var(--crema); }
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; }
}
