/* ---------- Tema oscuro (por defecto) ---------- */
:root {
  color-scheme: dark;
  --bg: #0b0a09;
  --surface: #161412;
  --panel: #1d1a17;
  --media-bg: #120f0d;
  --header-bg: rgba(11, 10, 9, .84);
  --chip-bg: rgba(11, 10, 9, .75);
  --line: rgba(214, 178, 118, .22);
  --line-strong: rgba(214, 178, 118, .5);
  --gold: #d6b276;
  --gold-2: #b8925a;
  --rose: #d9a99a;
  --text: #ede6dc;
  --muted: #a89e92;
  --danger: #e07a6a;
  --ok: #8fc79a;
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
  --glow-1: rgba(214, 178, 118, .12);
  --glow-2: rgba(217, 169, 154, .10);
  --gold-grad: linear-gradient(135deg, #f3dca8 0%, #d6b276 35%, #a77d45 60%, #e9c98f 100%);
  --rose-grad: linear-gradient(135deg, #f1c9bb 0%, #d9a99a 45%, #b07c6e 100%);
  --gold-text: var(--gold-grad);
  --radius: 14px;
  --script: 'Pinyon Script', cursive;
  --caps: 'Cinzel', serif;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Jost', system-ui, sans-serif;
  --header-h: 72px;
}

/* ---------- Tema claro ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #faf6f1;
  --surface: #f3ebe1;
  --panel: #ffffff;
  --media-bg: #efe6da;
  --header-bg: rgba(250, 246, 241, .88);
  --chip-bg: rgba(255, 255, 255, .85);
  --line: rgba(150, 110, 55, .22);
  --line-strong: rgba(150, 110, 55, .5);
  --gold: #8e6428;
  --gold-2: #b08a52;
  --rose: #a5675a;
  --text: #2a221c;
  --muted: #6e6156;
  --danger: #b8473a;
  --ok: #3f8a52;
  --shadow: 0 18px 40px rgba(90, 60, 30, .14);
  --glow-1: rgba(214, 178, 118, .22);
  --glow-2: rgba(217, 169, 154, .22);
  --rose-grad: linear-gradient(135deg, #c98a7a 0%, #a5675a 50%, #84493d 100%);
  --gold-text: linear-gradient(135deg, #b8904f 0%, #8e6428 50%, #6f4b1a 100%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .3s, color .3s;
}
img { max-width: 100%; display: block; }
a { color: var(--gold); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* Logos según el tema */
.logo-light { display: none !important; }
:root[data-theme="light"] .logo-light { display: block !important; }
:root[data-theme="light"] .logo-dark { display: none !important; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); min-width: 0; }
.brand img { width: 48px; height: 48px; border-radius: 50%; flex: none; }
.brand span { font-family: var(--caps); letter-spacing: .12em; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-right { display: flex; align-items: center; gap: 20px; }
.nav { display: flex; gap: 26px; }
.nav a { color: var(--text); text-decoration: none; font-family: var(--caps); font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; opacity: .85; }
.nav a:hover { color: var(--gold); opacity: 1; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; color: var(--gold); cursor: pointer; font-size: .85rem; }

.tools { display: flex; align-items: center; gap: 8px; }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang-switch button { border: none; background: none; cursor: pointer; padding: 5px 10px; border-radius: 999px; font-size: .72rem; letter-spacing: .12em; color: var(--muted); font-weight: 500; }
.lang-switch button.active { background: var(--gold-grad); color: #1a140c; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--gold); cursor: pointer; padding: 0; }
.icon-btn:hover, .menu-btn:hover { border-color: var(--gold); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-sun { display: none; }
:root[data-theme="light"] .icon-sun { display: block; }
:root[data-theme="light"] .icon-moon { display: none; }

@media (max-width: 860px) {
  .menu-btn { display: block; }
  .header-right { gap: 8px; }
  .nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--surface); border-bottom: 1px solid var(--line); display: none; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { padding: 16px 24px; border-top: 1px solid var(--line); }
}
@media (max-width: 480px) {
  :root { --header-h: 64px; }
  .brand img { width: 40px; height: 40px; }
  .brand span { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 72px 0 88px;
  background:
    radial-gradient(ellipse 60% 50% at 70% 40%, var(--glow-1), transparent 70%),
    radial-gradient(ellipse 50% 60% at 15% 80%, var(--glow-2), transparent 70%),
    var(--bg);
}
.hero .container { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 48px; }
.hero h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1.1; margin: 0 0 18px; }
.hero h1 em, .section-head h2 em { font-family: var(--script); font-style: normal; font-weight: 400; font-size: 1.22em; }
.hero h1 em { background: var(--rose-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero h1 em, .service-art span { padding: 0 .12em .08em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hero p { font-size: 1.12rem; color: var(--muted); max-width: 46ch; margin: 0 0 32px; }
.hero-logo { justify-self: center; width: min(420px, 100%); height: auto; border-radius: 50%; filter: drop-shadow(0 30px 60px var(--glow-1)); animation: float 7s ease-in-out infinite; }
.eyebrow { font-family: var(--caps); letter-spacing: .3em; font-size: .72rem; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; display: block; }
@keyframes float { 50% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .hero-logo { animation: none; } html { scroll-behavior: auto; } }
@media (max-width: 860px) {
  .hero { padding: 36px 0 56px; }
  .hero .container { grid-template-columns: 1fr; text-align: center; gap: 28px; }
  .hero p { margin-inline: auto; }
  .hero-logo { width: min(300px, 75vw); grid-row: 1; }
  .hero .actions { justify-content: center; }
}

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.actions.center { justify-content: center; margin-top: 36px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--caps); font-size: .75rem; letter-spacing: .18em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s; text-align: center;
}
.btn-gold { background: var(--gold-grad); color: #1a140c; font-weight: 600; }
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(214, 178, 118, .3); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn-sm { padding: 9px 16px; font-size: .68rem; }
.btn:disabled { opacity: .5; cursor: wait; }
@media (max-width: 480px) { .hero .actions .btn, .contact-wrap .actions .btn { flex: 1 1 100%; } }

/* ---------- Sections ---------- */
section { padding: 88px 0; }
.section-head { text-align: center; margin-bottom: 44px; }
.section-head.left { text-align: left; margin-bottom: 16px; }
.section-head h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 4vw, 2.8rem); margin: 0; line-height: 1.15; }
.section-head h2 em { color: var(--rose); padding: 0 .06em 0 .14em; }
.section-head p { color: var(--muted); max-width: 60ch; margin: 12px auto 0; }
.divider { width: 120px; height: 1px; margin: 18px auto 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.alt { background: var(--surface); border-block: 1px solid var(--line); }
@media (max-width: 860px) { section { padding: 60px 0; } .section-head { margin-bottom: 30px; } }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 36px; }
.chip { padding: 8px 18px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: .85rem; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
.chip:hover { color: var(--text); border-color: var(--gold-2); }
.chip.active { background: var(--gold-grad); color: #1a140c; border-color: transparent; font-weight: 500; }
.search { display: block; width: min(420px, 100%); margin: 0 auto 20px; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 1rem; }
.search:focus { outline: none; border-color: var(--gold); }
@media (max-width: 560px) {
  /* En móvil los filtros se deslizan horizontalmente */
  .filters { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin-inline: -16px; padding: 2px 16px 6px; scrollbar-width: none; margin-bottom: 24px; }
  .filters::-webkit-scrollbar { display: none; }
}

/* ---------- Product grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 26px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; cursor: pointer; transition: transform .25s, border-color .25s, box-shadow .25s; }
.card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.card:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.card-media { position: relative; aspect-ratio: 1; background: var(--media-bg); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .card-media img { transform: scale(1.05); }
.badge { position: absolute; top: 12px; left: 12px; padding: 4px 10px; border-radius: 999px; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; background: var(--chip-bg); border: 1px solid var(--line); color: var(--gold); }
.badge.sold { left: auto; right: 12px; color: var(--rose); }
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h3 { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; margin: 0; line-height: 1.2; }
.meta { font-size: .8rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.price { margin-top: auto; padding-top: 10px; font-family: var(--caps); color: var(--gold); letter-spacing: .08em; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; grid-column: 1 / -1; }
@media (max-width: 560px) {
  /* Dos columnas en teléfonos */
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card-body { padding: 12px 12px 14px; gap: 4px; }
  .card-body h3 { font-size: 1.05rem; }
  .meta { font-size: .66rem; }
  .price { font-size: .78rem; padding-top: 6px; }
  .badge { top: 8px; left: 8px; font-size: .58rem; padding: 3px 7px; }
  .badge.sold { right: 8px; }
}

.ph { width: 100%; height: 100%; display: grid; place-items: center; font-family: var(--script); font-size: 3.4rem; color: rgba(255, 255, 255, .88); text-shadow: 0 2px 12px rgba(0, 0, 0, .3); }

/* ---------- Services ---------- */
.service { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.service-text p { color: var(--muted); font-size: 1.08rem; white-space: pre-line; }
.service-list { list-style: none; padding: 0; margin: 22px 0 30px; display: grid; gap: 10px; }
.service-list li { padding-left: 26px; position: relative; }
.service-list li::before { content: '✦'; position: absolute; left: 0; color: var(--gold); }
.service-art {
  aspect-ratio: 4 / 3; border-radius: var(--radius); border: 1px solid var(--line);
  background: radial-gradient(circle at 30% 30%, var(--glow-2), transparent 60%), radial-gradient(circle at 70% 70%, var(--glow-1), transparent 60%), var(--panel);
  display: grid; place-items: center; text-align: center; padding: 30px;
}
.service-art span { font-family: var(--script); font-size: clamp(2.4rem, 6vw, 4rem); background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.25; }
@media (max-width: 860px) { .service { grid-template-columns: 1fr; gap: 28px; } .service-art { order: -1; aspect-ratio: 16 / 9; padding: 20px; } }

/* ---------- Contact ---------- */
.contact-wrap { display: grid; grid-template-columns: .8fr 1.2fr; gap: 48px; }
.contact-info p { color: var(--muted); }
.contact-info a.mail { font-family: var(--serif); font-size: 1.4rem; text-decoration: none; overflow-wrap: anywhere; }
.form { display: grid; gap: 16px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
/* 16px evita el zoom automático de iOS al enfocar */
.field input, .field select, .field textarea { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-size: 1rem; }
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--glow-1); }
.hint { font-size: .82rem; color: var(--muted); }
@media (max-width: 860px) { .contact-wrap { grid-template-columns: 1fr; gap: 28px; } }
@media (max-width: 560px) { .form .row { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 calc(40px + env(safe-area-inset-bottom)); text-align: center; color: var(--muted); font-size: .9rem; }
.site-footer p { margin: 6px 0; }
.site-footer .script { font-family: var(--script); font-size: 2rem; color: var(--rose); display: block; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.credit { margin-top: 18px !important; font-size: .8rem; letter-spacing: .06em; }
.credit a { font-weight: 500; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal.open { display: flex; }
.modal-box { position: relative; width: min(920px, 100%); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.modal-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--chip-bg); color: var(--text); cursor: pointer; font-size: 1.3rem; line-height: 1; }
.detail { display: grid; grid-template-columns: 1fr 1fr; }
.gallery-main { aspect-ratio: 1; background: var(--media-bg); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
.thumbs:empty { display: none; }
.thumbs button { flex: 0 0 64px; height: 64px; padding: 0; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: none; cursor: pointer; }
.thumbs button.active { border-color: var(--gold); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { padding: 36px 32px; display: flex; flex-direction: column; gap: 12px; }
.detail-info h3 { font-family: var(--serif); font-size: 2rem; font-weight: 500; margin: 0; line-height: 1.15; padding-right: 36px; }
.detail-info p { color: var(--muted); white-space: pre-line; margin: 0; }
.detail-info .price { font-size: 1.2rem; margin: 0; padding: 0; }
.detail-info .actions { margin-top: 12px; }
@media (max-width: 720px) {
  /* En móvil la ficha ocupa toda la pantalla, como una hoja */
  .modal { padding: 0; align-items: flex-end; }
  .modal-box { max-height: 94dvh; border-radius: 18px 18px 0 0; border-bottom: none; padding-bottom: env(safe-area-inset-bottom); }
  .detail { grid-template-columns: 1fr; }
  .detail-info { padding: 22px 20px 28px; }
  .detail-info h3 { font-size: 1.6rem; padding-right: 0; }
  .detail-info .btn { width: 100%; }
}

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%) translateY(200%); z-index: 80; padding: 12px 22px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .3s; max-width: calc(100% - 32px); text-align: center; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--danger); color: var(--danger); }
.toast.ok { border-color: var(--ok); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
