@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600&family=Jost:wght@300;400&display=swap");
:root {
  --bg: #f7f3ed;
  --paper: #fffdf9;
  --ink: #2a2622;
  --muted: #5d554d;
  --line: #e4dccf;
  --accent: #c9a98a;
  --accent-dark: #a8835f;
  --accent-text: #7f5f3b; /* dorado oscuro para texto chico (contraste 5,3:1) */
  --ok: #3f7d4e;
  --warn: #b0701f;
  --bad: #a94438;
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 460px; margin: 0 auto; padding: 0 20px; }
main { min-height: 60vh; padding-bottom: 60px; }

/* Header */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 84px; }
.brand img { height: 60px; width: auto; max-width: 62vw; mix-blend-mode: multiply; }
.nav { display: flex; align-items: center; gap: 22px; font-size: .95rem; }
.nav a { text-decoration: none; color: var(--muted); padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.active { color: var(--ink); border-color: var(--accent); }
.nav .btn { color: var(--ink); border: 0; }
.nav button.link { background: none; border: 0; cursor: pointer; color: var(--muted); font: inherit; padding: 4px 0; }
.nav button.link:hover { color: var(--ink); }
@media (max-width: 960px) {
  .site-header .wrap { flex-direction: column; justify-content: center; height: auto; padding-top: 10px; padding-bottom: 8px; gap: 4px; }
  .brand img { height: 54px; max-width: 80vw; }
  .nav { flex-wrap: wrap; justify-content: center; gap: 4px 18px; font-size: .92rem; }
}

/* Botones y formularios */
.btn { display: inline-block; background: var(--accent); color: #2a2118; border: 0; border-radius: 999px; padding: 10px 22px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s; }
.btn:hover { background: #bd9976; }
.btn.secondary { background: transparent; border: 1px solid var(--accent-dark); color: var(--ink); }
.btn.secondary:hover { background: #efe6d9; }
.btn.small { padding: 5px 14px; font-size: .85rem; }
.btn.danger { background: var(--bad); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
label { display: block; font-size: .875rem; font-weight: 600; margin: 14px 0 4px; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; color: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: auto; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.msg { padding: 10px 14px; border-radius: 8px; margin: 12px 0; font-size: .92rem; }
.msg.err { background: #f8e4e0; color: var(--bad); }
.msg.ok { background: #e3f0e6; color: var(--ok); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }

/* Hero y secciones */
.hero { text-align: center; padding: 28px 0 8px; }
.banner { position: relative; width: min(100%, max(50%, 320px)); aspect-ratio: 3 / 2; margin: 0 auto 28px; border-radius: var(--radius); overflow: hidden; background: #e9e0d3; }
.banner .slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease-in-out; }
.banner .slide.on { opacity: 1; }
.banner .slide img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.banner .slide .bg { object-fit: cover; filter: blur(22px) brightness(.85); transform: scale(1.15); }
/* Foto entera, sin recortar. Zoom lento mientras está a la vista; al salir mantiene el zoom hasta apagarse y recién ahí vuelve. */
.banner .slide .fg { object-fit: contain; transform: scale(1); transition: transform 0s 1.4s; }
.banner .slide.on .fg { transform: scale(1.06); transition: transform 7s ease-out; }
@media (prefers-reduced-motion: reduce) { .banner .slide.on .fg { transform: none; transition: none; } }
.hero .logo-big { height: 80px; max-width: 90%; width: auto; margin: 0 auto 14px; mix-blend-mode: multiply; }
.hero p.lead { max-width: 620px; margin: 0 auto 18px; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin: 34px 0; }
.cards .card h3 { margin-top: 4px; }
.eyebrow { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); font-weight: 700; }
.page-title { padding: 34px 0 10px; }

/* Grillas de fotos */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.thumb { position: relative; aspect-ratio: 3/2; background: #e9e0d3; border-radius: 8px; overflow: hidden; cursor: pointer; border: 0; padding: 0; }
.thumb img { width: 100%; height: 100%; object-fit: contain; transition: transform .25s; }
.thumb:hover img { transform: scale(1.02); }
.thumb .tag { position: absolute; top: 6px; right: 6px; background: var(--ink); color: #fff; font-size: .75rem; padding: 2px 8px; border-radius: 999px; }
.thumb .tag.dp { background: var(--accent-dark); }
.thumb .tag.own { background: var(--ok); }
.thumb .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 4px; background: linear-gradient(transparent, rgba(0,0,0,.55)); color: #fff; font-size: .75rem; }
.masonry { columns: 3 260px; column-gap: 12px; }
.masonry img { width: 100%; margin-bottom: 12px; border-radius: 8px; cursor: zoom-in; background: #e9e0d3; }
.gcard { text-decoration: none; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: block; }
.gcard .cover { aspect-ratio: 3/2; background: #e9e0d3; }
.gcard .cover img { width: 100%; height: 100%; object-fit: contain; }
.gcard .body { padding: 12px 14px; }
.gcard .body h3 { margin: 0 0 2px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 20px; }
.chip { padding: 4px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: .88rem; background: var(--paper); }
.chip.on { background: var(--accent); border-color: var(--accent); }

/* Lightbox / modal */
.overlay { position: fixed; inset: 0; background: rgba(20,16,12,.86); z-index: 50; display: none; align-items: center; justify-content: center; padding: 16px; }
.overlay.open { display: flex; }
.lightbox { max-width: 980px; width: 100%; max-height: 100%; display: flex; flex-direction: column; gap: 12px; }
.lightbox img { max-height: 70vh; width: auto; margin: 0 auto; object-fit: contain; border-radius: 6px; }
.lightbox .bar { background: var(--paper); border-radius: var(--radius); padding: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: center; }
.lightbox .nav-btn { position: absolute; top: 50%; background: rgba(255,255,255,.85); border: 0; border-radius: 50%; width: 42px; height: 42px; font-size: 1.2rem; cursor: pointer; }
.close-x { position: absolute; top: 12px; right: 16px; background: none; border: 0; color: #fff; font-size: 2rem; cursor: pointer; }
.modal { background: var(--paper); border-radius: var(--radius); padding: 24px; width: min(560px, 100%); max-height: 90vh; overflow: auto; }

/* Barra inferior de galería */
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--paper); border-top: 1px solid var(--line); padding: 12px 20px; z-index: 30; display: flex; justify-content: center; gap: 18px; align-items: center; }

/* Tablas */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
td input, td select { padding: 6px 8px; }
.table-wrap { overflow-x: auto; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #eee; }
.badge.pago_pendiente { background: #fbefd9; color: var(--warn); }
.badge.pagado { background: #e3f0e6; color: var(--ok); }
.badge.entregado { background: #dfe9f5; color: #2f5d8f; }
.badge.cancelado { background: #f8e4e0; color: var(--bad); }

/* Imprimir */
.sizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.size { text-align: left; background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; font: inherit; color: inherit; }
.size:hover { border-color: var(--accent); }
.size.on { border-color: var(--accent-dark); background: #f4ebde; }
.size strong { font-family: var(--serif); font-size: 1.3rem; display: block; }
.print-row { display: grid; grid-template-columns: 64px 1fr 120px 90px 28px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.print-row img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; }
.print-row .x { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 1.1rem; }
@media (max-width: 600px) {
  .print-row { grid-template-columns: 56px minmax(0, 1fr) 92px 62px 24px; gap: 8px; }
  .print-row .small { overflow-wrap: anywhere; }
  .print-row select, .print-row input { padding: 8px 6px; }
  .print-opts > .grow { flex-basis: 100%; }
}

/* Admin */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0 22px; flex-wrap: wrap; }
.tab { background: none; border: 0; padding: 10px 16px; cursor: pointer; font: inherit; color: var(--muted); border-bottom: 3px solid transparent; }
.tab.on { color: var(--ink); border-color: var(--accent-dark); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat b { display: block; font-family: var(--serif); font-size: 1.6rem; }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; background: var(--accent-dark); width: 0; transition: width .2s; }

.site-footer { border-top: 1px solid var(--line); background: var(--paper); padding: 38px 0 34px; color: var(--muted); }
.site-footer .foot { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.foot-name { font-family: "Cormorant Garamond", var(--serif); font-size: 1.9rem; font-weight: 600; color: var(--ink); letter-spacing: .01em; line-height: 1.1; }
.foot-contact, .foot-addr { font-family: "Jost", var(--sans); font-weight: 300; font-size: 1.02rem; letter-spacing: .04em; }
.foot-contact { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 12px; }
.foot-contact a { text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--accent); padding-bottom: 1px; }
.foot-contact a:hover { color: var(--accent-dark); }
.foot-contact .dot { color: var(--accent-dark); }
.hidden { display: none !important; }

/* Páginas privadas: no se muestran hasta confirmar la sesión */
body.auth-pending main, body.auth-pending .cartbar { visibility: hidden; }

/* Botón flotante de WhatsApp */
.wa-float { position: fixed; right: 18px; bottom: 18px; width: 58px; height: 58px; border-radius: 50%; background: #25D366; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0,0,0,.28); z-index: 40; transition: transform .15s, box-shadow .15s; }
.wa-float:hover { transform: scale(1.07); box-shadow: 0 6px 18px rgba(0,0,0,.34); }
body:has(.cartbar:not(.hidden)) .wa-float { bottom: 84px; } /* no tapar la barra de compra de la galería */
@media (max-width: 600px) { .wa-float { right: 14px; bottom: 14px; width: 54px; height: 54px; } }

/* Protección de fotos (disuasiva) */
body.protect { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.protect input, body.protect textarea, body.protect select { -webkit-user-select: text; user-select: text; }
body.protect img { -webkit-user-drag: none; user-drag: none; -webkit-touch-callout: none; }
body.protect.shield img, body.protect.shield .thumb, body.protect.shield .lightbox img { filter: blur(28px) brightness(.7); }
@media print { body.protect * { display: none !important; } body.protect { background: #fff; } }

/* Inicio: la foto principal se "revela" como una copia en el cuarto oscuro (una sola vez, al cargar) */
@keyframes develop {
  0%   { opacity: 0; filter: brightness(.4) saturate(.5) blur(12px); transform: scale(1.05); }
  55%  { opacity: 1; filter: brightness(.85) saturate(.9) blur(2px); }
  100% { opacity: 1; filter: none; transform: scale(1); }
}
@keyframes develop-soft { from { opacity: 0; } to { opacity: 1; } }
.banner.reveal {
  animation: develop 1.6s cubic-bezier(.16, 1, .3, 1) both;
  will-change: opacity, filter, transform; /* solo mientras dura la animación (la clase se quita al terminar) */
}
@media (prefers-reduced-motion: reduce) {
  .banner.reveal { animation: develop-soft .4s ease both; will-change: opacity; }
}

/* El lugar de la foto principal se abre suavemente al cargar (sin saltos de contenido) */
.hero-slot { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 1.15s cubic-bezier(.45, 0, .15, 1); }
.hero-slot.open { grid-template-rows: 1fr; }
.hero-slot-inner { overflow: hidden; min-height: 0; border-radius: var(--radius); }
@media (prefers-reduced-motion: reduce) { .hero-slot { transition: none; } }

/* Inicio: los títulos de las tarjetas son h2 (jerarquía correcta) con el mismo tamaño de antes */
.cards h2 { font-size: 1.15rem; margin: 0 0 .5em; }

/* Página Ayuda */
.help-index { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 26px; }
.help-sec { margin-bottom: 20px; scroll-margin-top: 100px; }
.help-sec h2 { margin-bottom: 14px; }
.help-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 900px) { .help-cols:has(.help-fig) { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); } }
.steps { list-style: none; counter-reset: paso; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { counter-increment: paso; position: relative; padding-left: 40px; line-height: 1.55; }
.steps li::before { content: counter(paso); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #2a2118; font-weight: 700; font-size: .9rem; display: flex; align-items: center; justify-content: center; }
.help-fig { margin: 0; text-align: center; }
.help-fig img { width: 100%; max-width: 380px; margin: 0 auto; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 8px 26px rgba(60, 40, 20, .14); }
.help-fig figcaption { margin-top: 8px; }
.faq { margin: 0; display: grid; gap: 4px; }
.faq dt { font-weight: 700; margin-top: 12px; }
.faq dd { margin: 2px 0 0; color: var(--muted); }
@media (max-width: 960px) { .help-sec { scroll-margin-top: 200px; } }
.cards .card p { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
