/* =====================================================================
   Catálogo de Invitaciones Digitales — rediseño editorial 2026
   Tema claro · papel cálido · serif de display · tarjetas con sombra suave
   ===================================================================== */
:root {
  --paper:     #f7f2ea;   /* fondo crema cálido */
  --paper-2:   #fffdf9;   /* superficies / tarjetas */
  --ink:       #241f1b;   /* texto principal */
  --ink-soft:  #6c635a;   /* texto secundario */
  --line:      #e7ded1;   /* bordes finos */

  --accent:    #d7592f;   /* terracota */
  --accent-2:  #2f6f6a;   /* verde pino, secundario */
  --accent-3:  #c79a3a;   /* ámbar para detalles */

  --shadow-sm: 0 1px 2px rgba(36, 31, 27, .05);
  --shadow-md: 0 10px 30px -12px rgba(36, 31, 27, .25);
  --shadow-lg: 0 26px 60px -22px rgba(36, 31, 27, .38);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
  background-color: var(--paper);
  /* sutil grano/textura mediante gradientes radiales muy tenues */
  background-image:
    radial-gradient(60% 50% at 12% -5%, rgba(215, 89, 47, .07), transparent 60%),
    radial-gradient(50% 45% at 95% 0%, rgba(47, 111, 106, .08), transparent 60%);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 22px; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 26px 0 30px; }
.hero-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }

.brand {
  display: inline-flex; align-items: center; gap: 9px;
  text-decoration: none; color: var(--ink);
  font-weight: 800; font-size: 1.05rem; letter-spacing: .2px;
  margin-bottom: 38px;
}
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--ink); color: var(--paper-2);
}
.brand-text em { font-style: normal; color: var(--accent); }

.eyebrow {
  margin: 0 0 14px;
  font-size: .8rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent);
}
.display {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-weight: 600;
  font-size: clamp(2.1rem, 6vw, 3.9rem);
  line-height: 1.04;
  letter-spacing: -.5px;
  margin: 0 0 18px;
}
.display .ital { font-style: italic; font-weight: 500; color: var(--accent-2); }
.lead {
  max-width: 46ch;
  margin: 0 0 30px;
  font-size: 1.05rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ---------- Buscador ---------- */
.search-wrap {
  position: relative;
  display: flex; align-items: center;
  width: min(540px, 100%);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 8px 6px 16px;
  box-shadow: var(--shadow-md);
  transition: box-shadow .25s ease, border-color .25s ease;
}
.search-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), 0 0 0 4px rgba(215, 89, 47, .14);
}
.search-wrap .icon { color: var(--ink-soft); flex: 0 0 auto; }
.search {
  flex: 1; border: 0; outline: 0; background: transparent;
  color: var(--ink); font-size: 1.02rem; font-family: inherit;
  padding: 11px 12px;
}
.search::placeholder { color: #aaa093; }
.search::-webkit-search-cancel-button { display: none; }
.clear {
  border: 0; background: #efe7da; color: var(--ink-soft);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; flex: 0 0 auto;
  font-size: .85rem;
  transition: transform .18s ease, background .18s ease, color .18s ease, opacity .18s ease;
}
.clear:hover { color: #fff; background: var(--accent); transform: rotate(90deg); }
.search-wrap.is-empty .clear { opacity: 0; pointer-events: none; }

/* ---------- Chips de categoría ---------- */
.chips {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 9px;
  margin-top: 22px;
  max-width: 760px;
}
.chip {
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink-soft);
  font: inherit; font-size: .85rem; font-weight: 600;
  padding: 8px 15px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.chip:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }
.chip.active {
  background: var(--ink); border-color: var(--ink); color: var(--paper-2);
  box-shadow: var(--shadow-md);
}
.chip .count { opacity: .55; font-weight: 700; margin-left: 5px; }

/* ---------- Barra de resultados ---------- */
.results-bar { min-height: 30px; padding: 26px 0 4px; }
.result-info {
  font-size: .92rem; color: var(--ink-soft); font-weight: 600;
}
.result-info b { color: var(--ink); }

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  padding: 6px 0 64px;
}
@media (min-width: 620px)  { .grid { grid-template-columns: repeat(3, 1fr); gap: 26px; } }
@media (min-width: 920px)  { .grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Card ---------- */
.card {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s ease, border-color .3s ease;
  animation: cardIn .5s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: var(--d, 0s);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: #dccdb4;
}

.card .thumb {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 24%, #fff, #f1e8da);
}
.card .thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.card:hover .thumb img { transform: scale(1.06); }
.card .thumb img.is-fallback { object-fit: contain; padding: 18px; }

/* Insignia "Ver" que aparece sobre la imagen al pasar el cursor */
.card .thumb .peek {
  position: absolute; left: 50%; bottom: 12px;
  transform: translate(-50%, 14px);
  background: rgba(36, 31, 27, .9);
  color: #fff; font-size: .76rem; font-weight: 700;
  padding: 7px 14px; border-radius: 999px;
  opacity: 0; pointer-events: none;
  backdrop-filter: blur(4px);
  transition: opacity .25s ease, transform .25s ease;
}
.card:hover .thumb .peek { opacity: 1; transform: translate(-50%, 0); }

.card .title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.08rem;
  margin: 13px 4px 9px;
  line-height: 1.2;
  letter-spacing: -.2px;
}

.card .tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0 4px 14px;
  min-height: 1.6em;
  max-height: 3.4em;
  overflow: hidden;
}
.tag {
  font-size: .68rem; font-weight: 600; letter-spacing: .2px;
  color: var(--accent-2);
  padding: 3px 9px; border-radius: 7px;
  background: rgba(47, 111, 106, .08);
}

/* Acciones apiladas en vertical: el texto largo nunca se corta en columnas angostas */
.card .actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.btn {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 11px;
  padding: 11px 12px;
  font-size: .86rem; font-weight: 700; font-family: inherit;
  line-height: 1.1;
  cursor: pointer; text-decoration: none; text-align: center;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .15s ease, border-color .15s ease, filter .2s ease;
}
.btn svg { flex: 0 0 auto; }
/* Acción principal: encargar por WhatsApp */
.btn.order {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 18px -8px rgba(215, 89, 47, .8);
}
.btn.order:hover { transform: translateY(-2px); filter: brightness(1.04); box-shadow: 0 12px 24px -8px rgba(215, 89, 47, .85); }
.btn.order:active { transform: translateY(0); }
/* Acción secundaria: ver el diseño */
.btn.view {
  background: var(--paper-2);
  color: var(--ink);
  border-color: var(--line);
}
.btn.view:hover { background: #f3ece0; border-color: #d9cdb9; transform: translateY(-2px); }

/* ---------- Vacío ---------- */
.empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 60px 0 90px;
  font-size: 1.05rem;
  line-height: 1.6;
}
.empty .empty-emoji { display: block; font-size: 2.4rem; margin-bottom: 12px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 28px;
  transform: translate(-50%, 14px);
  background: var(--ink);
  color: #fff;
  padding: 13px 20px;
  border-radius: 13px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 9999;
  font-size: .92rem; font-weight: 600;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 0 40px;
}
.site-footer .container {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px;
  color: var(--ink-soft); font-size: .85rem;
}
.site-footer a {
  color: var(--ink-soft); text-decoration: none; font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.site-footer a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Accesibilidad: respeta "reducir movimiento" ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card:hover { transform: none; }
  html { scroll-behavior: auto; }
}
