/* =========================================================
   Cerámica gres artesanal · Caimanes, Los Vilos
   Hoja de estilos principal
   ========================================================= */

:root {
  --arena: #F4EFE6;
  --arena-2: #EADFCB;
  --papel: #FBF8F2;
  --linea: #E6DCCB;
  --tinta: #2B2622;
  --texto: #4A423B;
  --suave: #6E655D;
  --arcilla: #8C4A2F;
  --arcilla-osc: #5F3220;
  --terracota-clara: #D9A47E;
  --crema-osc: #D9C8B0;
  --radio: 8px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--arena);
  color: var(--tinta);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; height: auto; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -0.01em; line-height: 1.1; }
h2 { font-size: clamp(32px, 4vw, 46px); margin-bottom: 18px; }
h3 { font-size: 22px; }
p { margin: 0 0 16px; }
a { color: var(--arcilla); text-decoration: none; }
a:hover { color: var(--arcilla-osc); }
:focus-visible { outline: 2px solid var(--arcilla); outline-offset: 3px; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--tinta); color: var(--arena); padding: 10px 16px; border-radius: 6px; z-index: 100; }
.skip-link:focus { left: 8px; color: var(--arena); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 40px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.align-start { align-items: start; }

.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--arcilla); margin-bottom: 14px; }
.eyebrow-light { color: var(--terracota-clara); }
.section { padding: 100px 0; }
.section-sand { background: var(--arena-2); }
.section-dark { background: var(--tinta); color: var(--arena); }
.section-dark p { color: var(--crema-osc); font-size: 17px; line-height: 1.7; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 48px; }
.section-head > div:first-child { max-width: 600px; }
.section-lead { font-size: 17px; line-height: 1.7; color: var(--texto); }
.note { font-size: 14px; color: var(--suave); margin-top: 24px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 13px 26px; border-radius: 999px;
  font: 500 15px/1 var(--sans);
  background: var(--arcilla); color: #FBF6EE; border: 1.5px solid var(--arcilla);
  cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { background: var(--arcilla-osc); border-color: var(--arcilla-osc); color: #FBF6EE; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--tinta); border-color: var(--tinta); }
.btn-ghost:hover { background: var(--tinta); border-color: var(--tinta); color: var(--arena); }
.btn-light { background: var(--terracota-clara); border-color: var(--terracota-clara); color: var(--tinta); margin-top: 8px; }
.btn-light:hover { background: var(--arena); border-color: var(--arena); color: var(--tinta); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Encabezado ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(244, 239, 230, .92); backdrop-filter: blur(8px); border-bottom: 1px solid transparent; transition: border-color .3s, box-shadow .3s; }
.site-header.is-scrolled { border-color: var(--linea); box-shadow: 0 4px 20px rgba(43, 38, 34, .06); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--serif); font-size: 23px; color: var(--tinta); }
.brand svg { color: var(--arcilla); }
.nav { display: flex; align-items: center; gap: 30px; }
.nav a { color: var(--tinta); font-size: 14px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; padding: 12px 0; position: relative; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 1.5px; background: var(--arcilla); transform: scaleX(0); transition: transform .25s; }
.nav a:hover::after, .nav a.is-current::after { transform: scaleX(1); }
.nav .nav-cta { padding: 10px 20px; border: 1.5px solid var(--tinta); border-radius: 999px; }
.nav .nav-cta::after { display: none; }
.nav .nav-cta:hover { background: var(--tinta); color: var(--arena); }
.nav-toggle { display: none; width: 48px; height: 48px; background: none; border: 0; cursor: pointer; padding: 12px; flex-direction: column; justify-content: center; gap: 5px; }
.nav-toggle span { display: block; height: 2px; background: var(--tinta); border-radius: 2px; transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Portada ---------- */
.hero { padding: 80px 0 100px; }
.hero h1 { font-size: clamp(44px, 6vw, 70px); line-height: 1.03; margin-bottom: 28px; }
.hero h1 em { color: var(--arcilla); }
.lead { font-size: 19px; line-height: 1.65; color: var(--texto); max-width: 520px; margin-bottom: 32px; }
.hero-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto; gap: 16px; }
.hp { width: 100%; object-fit: cover; border-radius: var(--radio); box-shadow: 0 20px 40px -20px rgba(43, 38, 34, .35); }
.hp-1 { grid-row: span 2; height: 100%; min-height: 520px; }
.hp-2, .hp-3 { aspect-ratio: 4 / 5; }

/* ---------- Franja de valor ---------- */
.values { background: var(--tinta); color: var(--arena); padding: 36px 0; }
.value { display: flex; gap: 14px; align-items: flex-start; }
.value svg { color: var(--terracota-clara); flex-shrink: 0; margin-top: 2px; }
.value p { margin: 0; font-size: 15px; line-height: 1.55; }
.value strong { font-weight: 600; }

/* ---------- Galería ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter { min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--linea); background: var(--papel); color: var(--tinta); font: 500 14px var(--sans); cursor: pointer; transition: all .2s; }
.filter:hover { border-color: var(--arcilla); }
.filter.is-active { background: var(--tinta); border-color: var(--tinta); color: var(--arena); }
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.piece { display: flex; flex-direction: column; gap: 16px; }
.piece[hidden] { display: none; }
.piece-img { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: var(--radio); overflow: hidden; display: block; width: 100%; }
.piece-img img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; transition: transform .6s ease; }
.piece-img:hover img { transform: scale(1.04); }
.piece-title { display: flex; flex-direction: column; gap: 6px; }
.piece-title h3 { font-size: 21px; }
.tag { align-self: flex-start; font-size: 12px; font-weight: 500; color: var(--arcilla); background: var(--arena-2); padding: 3px 10px; border-radius: 999px; }
.piece-info p { font-size: 15px; line-height: 1.55; color: var(--texto); margin: 10px 0 12px; }
.piece-link { font-size: 14px; font-weight: 600; display: inline-block; padding: 6px 0; }

/* ---------- Historia ---------- */
.story-photo, .origin-photo { margin: 0; }
.story-photo img, .origin-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radio); }
.story-text p { font-size: 17px; line-height: 1.75; color: var(--texto); }
blockquote { margin: 28px 0 0; padding-left: 20px; border-left: 2px solid var(--arcilla); font-family: var(--serif); font-style: italic; font-size: 23px; line-height: 1.4; color: var(--arcilla); }

/* ---------- Proceso ---------- */
.steps { list-style: none; padding: 0; margin: 0; }
.card { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 32px; }
.steps .card h3 { font-size: 21px; margin: 14px 0 10px; }
.steps .card p { font-size: 15px; line-height: 1.6; color: var(--texto); margin: 0; }
.step-num { font-family: var(--serif); font-size: 42px; line-height: 1; color: var(--arcilla); }

/* ---------- Pedidos ---------- */
.how h3 { margin-bottom: 20px; }
.how ol { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-direction: column; gap: 18px; }
.how li { display: flex; gap: 16px; align-items: flex-start; }
.how li span { font-family: var(--serif); font-size: 26px; color: var(--arcilla); min-width: 28px; line-height: 1.1; }
.how li p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--texto); }
.how strong { color: var(--tinta); font-weight: 600; }

/* ---------- Contacto ---------- */
.contact-list { list-style: none; padding: 0; margin: 24px 0 0; }
.contact-list li { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid #D9CCB6; }
.contact-list li:last-child { border-bottom: 0; }
.contact-list small { display: block; font-size: 13px; color: var(--suave); }
.contact-list a, .contact-list span:not(.icon) { font-size: 17px; font-weight: 500; }
.contact-list span:not(.icon) { color: var(--tinta); }
.icon { width: 46px; height: 46px; border-radius: 50%; background: var(--papel); display: flex; align-items: center; justify-content: center; color: var(--arcilla); flex-shrink: 0; }
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.form-hint { font-size: 14px; color: var(--suave); margin: -6px 0 4px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; }
.field input, .field select, .field textarea {
  min-height: 48px; padding: 12px 14px; border: 1px solid #D5C8B4; border-radius: 6px;
  font: 15px var(--sans); background: #fff; color: var(--tinta); width: 100%;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--arcilla); box-shadow: 0 0 0 3px rgba(140, 74, 47, .15); }
.field.has-error input, .field.has-error textarea { border-color: #B3261E; }
.error { font-size: 13px; color: #B3261E; margin: 0; min-height: 0; }

/* ---------- Pie ---------- */
.site-footer { background: var(--tinta); color: var(--crema-osc); padding: 48px 0; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; }
.footer-inner p { margin: 0; font-size: 14px; }
.footer-brand { font-family: var(--serif); font-size: 22px !important; color: var(--arena); margin-bottom: 4px !important; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 24px; }
.footer-nav a { color: var(--crema-osc); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; padding: 8px 0; }
.footer-nav a:hover { color: var(--arena); }
.small { font-size: 13px !important; }

/* ---------- WhatsApp flotante ---------- */
.wa-float { position: fixed; right: 22px; bottom: 22px; width: 58px; height: 58px; border-radius: 50%; background: #1E7E4A; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 25px rgba(0, 0, 0, .25); z-index: 60; transition: transform .2s; }
.wa-float:hover { transform: scale(1.07); color: #fff; }

/* ---------- Lightbox ---------- */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(20, 17, 15, .92); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lightbox img { max-width: min(88vw, 900px); max-height: 82vh; object-fit: contain; border-radius: 6px; }
.lightbox figcaption { color: var(--arena); font-family: var(--serif); font-size: 20px; text-align: center; }
.lb-close, .lb-nav { position: absolute; background: rgba(255, 255, 255, .1); color: #fff; border: 0; border-radius: 50%; width: 52px; height: 52px; font-size: 30px; line-height: 1; cursor: pointer; transition: background .2s; }
.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, .22); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* ---------- Animación de aparición ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .piece-img img, .btn { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .wrap { padding: 0 22px; }
  .section { padding: 72px 0; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero { padding: 48px 0 72px; }
  .hp-1 { min-height: 380px; }
  .nav-toggle { display: flex; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--arena); border-bottom: 1px solid var(--linea);
    padding: 8px 22px 22px; display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--linea); }
  .nav a::after { display: none; }
  .nav .nav-cta { margin-top: 14px; text-align: center; border-bottom: 1.5px solid var(--tinta); }
  .story-photo { order: 2; }
}
@media (max-width: 560px) {
  .gallery, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .lb-prev, .lb-next { top: auto; bottom: 20px; transform: none; }
  .lb-prev { left: calc(50% - 64px); }
  .lb-next { right: calc(50% - 64px); }
}
