/* ═══════════════════════════════════════
   CeramicArt — Hoja de estilos compartida
   ceramicart.es
═══════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── VARIABLES GLOBALES ── */
:root {
  --arcilla:     #B5622A;
  --oro:         #C8963A;
  --crema:       #F5F0E8;
  --crema-dark:  #EDE7DA;
  --tierra:      #7A4A2A;
  --carbon:      #2A2320;
  --carbon-mid:  #3D2E28;
  --gris-medio:  #8C7E72;
  --blanco-roto: #FAF7F2;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Jost', sans-serif;

  --max-w:        1200px;
  --section-pad:  6rem clamp(2rem, 5vw, 5rem);
}

/* ── BASE ── */
html { scroll-behavior: smooth; }

body {
  background: var(--blanco-roto);
  color: var(--carbon);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.8;
  overflow-x: hidden;
}

/* Textura de fondo */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ── NAVEGACIÓN ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 1.25rem 2.5rem;
  background: rgba(250, 247, 242, 0.97);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(122,74,42,0.1);
  transition: box-shadow 0.4s;
}

nav.scrolled {
  box-shadow: 0 1px 0 rgba(122,74,42,0.18);
}

/* Logo siempre oscuro — nav siempre claro */
.nav-logo {
  font-family: var(--font-display);
  font-size: 3.4rem;
  font-weight: 600;
  color: var(--carbon);
  letter-spacing: 0.04em;
  text-decoration: none;
}

.nav-logo span { color: var(--arcilla); }

.nav-spacer { flex: 1; min-width: 3rem; }

.nav-links {
  display: flex;
  gap: 1.8rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--carbon);
  text-decoration: none;
  position: relative;
  transition: color 0.3s;
  white-space: nowrap;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--arcilla);
  transition: width 0.3s;
}

.nav-links a:hover { color: var(--arcilla); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--arcilla); }

.nav-cta {
  font-size: 0.75rem !important;
  letter-spacing: 0.12em !important;
  padding: 0.5rem 1.3rem;
  border: 1px solid var(--arcilla);
  color: var(--arcilla) !important;
  border-radius: 2px;
  transition: background 0.3s, color 0.3s !important;
}

.nav-cta:hover {
  background: var(--arcilla) !important;
  color: var(--blanco-roto) !important;
}

.nav-cta::after { display: none !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 10px;
  margin-right: -10px;
}

.nav-toggle span {
  display: block;
  width: 28px; height: 2px;
  background: var(--carbon);
  transition: transform 0.3s, opacity 0.3s;
}

/* Hamburger → X cuando el menú está abierto */
nav:has(.nav-links.open) .nav-toggle span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
nav:has(.nav-links.open) .nav-toggle span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
nav:has(.nav-links.open) .nav-toggle span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ── BOTONES ── */
.btn-primary {
  display: inline-block;
  padding: 0.9rem 2.2rem;
  background: var(--arcilla);
  color: var(--blanco-roto);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  transition: background 0.3s, transform 0.2s;
  border: none;
  cursor: pointer;
}

.btn-primary:hover { background: var(--tierra); transform: translateY(-1px); }

.btn-gold {
  display: inline-block;
  padding: 0.9rem 2.2rem;
  background: var(--oro);
  color: var(--carbon);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  transition: background 0.3s, transform 0.2s;
  cursor: pointer;
}

.btn-gold:hover { background: #b8832e; transform: translateY(-1px); }

.btn-outline {
  display: inline-block;
  padding: 0.9rem 2.2rem;
  border: 1px solid var(--carbon);
  color: var(--carbon);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  transition: border-color 0.3s, color 0.3s, transform 0.2s;
  cursor: pointer;
}

.btn-outline:hover { border-color: var(--arcilla); color: var(--arcilla); transform: translateY(-1px); }

.btn-outline-light {
  display: inline-block;
  padding: 0.9rem 2.2rem;
  border: 1px solid rgba(245,240,232,0.35);
  color: var(--crema);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  transition: border-color 0.3s, color 0.3s, transform 0.2s;
  cursor: pointer;
}

.btn-outline-light:hover { border-color: var(--oro); color: var(--oro); transform: translateY(-1px); }

/* ── ETIQUETAS Y TÍTULOS DE SECCIÓN ── */
.section-label {
  font-size: 0.9rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--arcilla);
  margin-bottom: 0.8rem;
  display: block;
}

.section-label-gold { color: var(--oro); }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 3.5vw, 3.2rem);
  font-weight: 300;
  line-height: 1.15;
  color: var(--carbon);
  margin-bottom: 1.2rem;
}

.section-title em { font-style: italic; color: var(--arcilla); }
.section-title-light { color: var(--crema); }
.section-title-light em { color: var(--oro); }

.section-body {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--gris-medio);
  line-height: 1.85;
}

/* ── FORMULARIOS ── */
.form-group { margin-bottom: 1.2rem; }

.form-group label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gris-medio);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--crema);
  border: 1px solid var(--crema-dark);
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  color: var(--carbon);
  transition: border-color 0.3s;
  outline: none;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--arcilla); }

.form-group textarea { resize: vertical; min-height: 120px; }

.form-group input.invalid,
.form-group input.invalid:focus { border-color: #c0392b; }

.field-error {
  display: none;
  color: #c0392b;
  font-size: 0.85rem;
  margin-top: 0.3rem;
}
.field-error.visible { display: block; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-note {
  font-size: 0.82rem;
  color: var(--gris-medio);
  margin-top: 0.8rem;
  line-height: 1.5;
}

/* ── FOOTER ── */
footer {
  background: var(--carbon);
  color: var(--crema);
  padding: 4rem 2.5rem 2rem;
}

.footer-inner { max-width: var(--max-w); margin: 0 auto; }

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(245,240,232,0.1);
}

.footer-brand p {
  font-size: 0.95rem;
  color: rgba(245,240,232,0.45);
  margin-top: 0.8rem;
  line-height: 1.7;
  max-width: 260px;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--crema);
  margin-bottom: 0.5rem;
  text-decoration: none;
  display: inline-block;
}

.footer-logo span { color: var(--oro); }

.footer-col h4 {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.4);
  margin-bottom: 1.2rem;
  font-weight: 400;
}

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.7rem; }

.footer-col ul li a {
  font-size: 0.95rem;
  color: rgba(245,240,232,0.65);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-col ul li a:hover { color: var(--oro); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: rgba(245,240,232,0.3);
}

.social-links { display: flex; gap: 1rem; margin-top: 1.2rem; }

.social-link {
  width: 36px; height: 36px;
  border: 1px solid rgba(245,240,232,0.15);
  border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(245,240,232,0.5);
  text-decoration: none;
  transition: border-color 0.3s, color 0.3s;
}

.social-link:hover { border-color: var(--oro); color: var(--oro); }
.social-link svg { width: 16px; height: 16px; }

/* ── ANIMACIONES ── */
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s, transform 0.7s;
}

.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── UTILIDADES ── */
.divider-line { max-width: var(--max-w); margin: 0 auto; padding: 0 2.5rem; position: relative; z-index: 1; }
.divider-line hr { border: none; border-top: 1px solid var(--crema-dark); }

/* ── RESPONSIVE COMPARTIDO ── */
@media (max-width: 1024px) {
  :root { --section-pad: 5rem 2rem; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 768px) {
  :root { --section-pad: 4rem 1.5rem; }

  nav {
    padding: 1rem 1.5rem;
    flex-wrap: wrap;
    align-items: center;
  }

  /* Menú cerrado: oculto */
  .nav-links {
    display: none;
  }

  /* Menú abierto: el nav se expande a pantalla completa */
  nav:has(.nav-links.open) {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    height: 100dvh;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--blanco-roto);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    overflow: auto;
    z-index: 200;
  }

  /* Bloquear scroll del body cuando el menú está abierto */
  body:has(#navLinks.open) {
    overflow: hidden;
  }

  /* Ocultar logo y spacer cuando el menú está abierto */
  nav:has(.nav-links.open) .nav-logo,
  nav:has(.nav-links.open) .nav-spacer {
    display: none;
  }

  /* Toggle (X) fijo arriba a la derecha, fuera del flujo */
  nav:has(.nav-links.open) .nav-toggle {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.2rem;
    padding-top: 3rem;
  }

  .nav-toggle { display: flex; }

  /* Links del menú abierto */
  .nav-links.open a {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--carbon);
  }

  .nav-links.open .nav-cta {
    font-family: var(--font-display) !important;
    font-size: 2rem !important;
    font-weight: 400 !important;
    letter-spacing: 0.02em !important;
    text-transform: none !important;
    border: none;
    padding: 0;
    color: var(--arcilla) !important;
    background: none;
  }

  .form-row { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}

/* ── CONTENEDOR CENTRADO ESTÁNDAR ── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2.5rem;
}

/* Hero siempre ocupa el ancho completo menos el nav */
section, .section-full {
  position: relative;
  z-index: 1;
}
/* cambios para kintsugi */
.section-label--lg {
  font-size: clamp(0.78rem, 1vw, 0.9rem);
}

.section-title--sm {
  font-size: 2.2rem;
}

/* ═══════════════════════════════════════
   COMPARADOR ANTES/DESPUÉS
   Uso: <div class="comparador" style="--split:50%">
═══════════════════════════════════════ */
.comparador {
  position: relative;
  overflow: hidden;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
  background: rgba(245,240,232,0.05);
  aspect-ratio: 4/3;
}

.cmp-despues,
.cmp-antes {
  position: absolute;
  inset: 0;
}

.cmp-antes {
  clip-path: inset(0 calc(100% - var(--split, 50%)) 0 0);
  z-index: 2;
}

.cmp-despues img,
.cmp-antes img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.cmp-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: rgba(245,240,232,0.18);
  letter-spacing: 0.06em;
}

.cmp-label {
  position: absolute;
  top: 1rem;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border-radius: 2px;
  pointer-events: none;
  z-index: 4;
}

.cmp-label-antes {
  left: 1rem;
  background: rgba(42,35,32,0.55);
  color: rgba(245,240,232,0.85);
}

.cmp-label-despues {
  right: 1rem;
  background: rgba(181,98,42,0.65);
  color: var(--blanco-roto);
}

.cmp-label-kintsugi {
  right: 1rem;
  background: rgba(200,150,58,0.75);
  color: var(--blanco-roto);
}

.cmp-handle {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--split, 50%);
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.cmp-line {
  width: 2px;
  height: 100%;
  background: rgba(250,247,242,0.85);
}

.cmp-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--blanco-roto);
  border: 2px solid var(--arcilla);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  cursor: col-resize;
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}

.cmp-btn:hover {
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}

.cmp-btn svg {
  width: 16px; height: 16px;
  color: var(--arcilla);
}

.cmp-caption {
  background: rgba(245,240,232,0.04);
  padding: 1rem 1.2rem;
}

.cmp-caption-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--crema);
  margin-bottom: 0.2rem;
}

.cmp-caption-desc {
  font-size: 0.9rem;
  color: rgba(245,240,232,0.4);
}
