/* Mcon Relojes Vintage — estilos compartidos
   Layout: masthead tipo esfera + vitrina en cuadrícula; ficha del reloj en hoja superpuesta */
:root {
  --bg: #ECEEE8; --surface: #F8F9F5; --ink: #1A201D; --muted: #5C655F; --line: #CED3CA;
  --brass: #87621F; --brass-ink: #FFF9EC; --dial: #22302A; --dial-ink: #E9DDBF;
  --ok: #2E6A44; --warn: #94650F; --sold: #8C3A31; --shade: rgba(16, 22, 19, .55);
  --glow: 12%; --grain: .045;
  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101513; --surface: #18201C; --ink: #E8ECE5; --muted: #9AA49D; --line: #2C3731;
    --brass: #D5AB5E; --brass-ink: #1B1408; --dial: #0B0F0D; --dial-ink: #D9C89E;
    --ok: #7DC398; --warn: #E2B85C; --sold: #E3897E; --shade: rgba(0, 0, 0, .7);
    --glow: 16%; --grain: .07;
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.5 }
/* Fondo: luz cálida arriba, un toque verde abajo y grano muy leve */
body {
  background:
    radial-gradient(ellipse 80% 55% at 50% -15%, color-mix(in srgb, var(--brass) var(--glow), transparent), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 100%, color-mix(in srgb, var(--ok) 8%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.wrap { position: relative; z-index: 1 }
img { max-width: 100%; display: block }
[hidden] { display: none !important }
button, input, select, textarea { font: inherit; color: inherit }
button { cursor: pointer }
a { color: inherit }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 16px; padding-block: 0 48px }
.dial { color: var(--dial-ink) }

/* Botones y chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 13.5px; text-decoration: none; white-space: nowrap }
.btn:hover { border-color: var(--ink) }
.btn:disabled { opacity: .55; cursor: not-allowed }
.btn.pri { background: var(--brass); border-color: var(--brass); color: var(--brass-ink) }
.btn.danger { color: var(--sold); border-color: var(--sold); background: transparent }
.btn.ghost { background: transparent }
.btn.big { padding: 12px 20px; font-size: 15px }
.chips { display: flex; gap: 8px; flex-wrap: wrap }
@media (max-width: 520px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; max-width: calc(100% + 32px) }
  .chips::-webkit-scrollbar { display: none }
  .chip { flex: none }
}
.chip { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; color: var(--muted) }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg) }
.chip .n { font-family: var(--mono); font-weight: 500; opacity: .75; margin-left: 4px }
.eyebrow { margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--brass) }

/* Cabecera */
.mast { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; padding-block: 36px 22px; border-bottom: 1px solid var(--line) }
.mast .dial { width: 84px; height: 84px }
.mast h1 { margin: 2px 0 4px; font-family: var(--display); font-weight: 700; font-size: clamp(30px, 6vw, 52px); line-height: 1.02; letter-spacing: -.01em; text-wrap: balance }
.mast .tag { margin: 0; color: var(--muted); max-width: 60ch }
.mast .meta { margin: 8px 0 0; font-family: var(--mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums }
@media (max-width: 520px) {
  .mast { grid-template-columns: 34px 1fr; grid-template-areas: "dial eyebrow" "title title" "tag tag" "meta meta"; gap: 0 10px; align-items: center; padding-block: 22px 16px }
  .mast > div { display: contents }
  .mast .dial { grid-area: dial; width: 34px; height: 34px }
  .mast .eyebrow { grid-area: eyebrow }
  .mast h1 { grid-area: title; font-size: 34px; margin: 10px 0 6px }
  .mast .tag { grid-area: tag; font-size: 14.5px }
  .mast .meta { grid-area: meta; font-size: 11.5px }
}

.adminhint { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--brass); border-radius: 10px; background: var(--surface); font-size: 13px; color: var(--muted) }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding-block: 18px }

/* Vitrina */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 22px 16px }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)) } }
.card { display: flex; flex-direction: column; gap: 6px; text-align: left; background: none; border: 0; padding: 0; min-width: 0; color: inherit }
.ph { position: relative; aspect-ratio: 4/5; width: 100%; max-width: 100%; border-radius: 6px; overflow: hidden; background: var(--dial) }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease }
.card:hover .ph img { transform: scale(1.03) }
.ph-dial { width: 100%; height: 100%; display: grid; place-items: center }
.ph-dial .dial { width: 62% }
.card.is-sold .ph img, .card.is-sold .ph-dial { filter: grayscale(1) brightness(.75) }
.st { position: absolute; left: 8px; top: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--surface); color: var(--ok); font-weight: 500 }
.st.reservado { color: var(--warn) } .st.vendido { color: var(--sold) } .st.borrador { color: var(--muted) }
.card .brand { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--brass); margin-top: 4px }
.card .model { font-family: var(--display); font-size: 19px; line-height: 1.15; font-weight: 500; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden }
.card .sub { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden }
@media (max-width: 520px) { .card .model { font-size: 17px } .grid { gap: 20px 12px } }
.card .price { font-weight: 700; font-variant-numeric: tabular-nums }

.empty { grid-column: 1/-1; border: 1px dashed var(--line); border-radius: 10px; padding: 40px 20px; text-align: center; color: var(--muted) }
.empty h2 { font-family: var(--display); font-weight: 500; color: var(--ink); margin: 10px 0 6px; font-size: 24px }
.empty .dial { width: 64px; margin: 0 auto }

/* Esqueleto de carga */
.skel .ph { background: var(--line); animation: pulse 1.4s ease-in-out infinite }
.skel .bar { height: 12px; border-radius: 4px; background: var(--line); animation: pulse 1.4s ease-in-out infinite }
@keyframes pulse { 50% { opacity: .5 } }

/* Entrega de un reloj vendido */
.card .seen { color: var(--brass); font-weight: 600; font-size: 13px; margin-top: -2px }
.handoff { display: grid; gap: 10px; margin: 0 0 18px; padding: 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line) }
.handoff-ph { display: grid; gap: 8px }
.handoff-ph.multi { grid-template-columns: 1fr 1fr }
.handoff-ph button { padding: 0; border: 0; background: var(--dial); border-radius: 8px; overflow: hidden; display: block }
.handoff-ph img { width: 100%; aspect-ratio: 4/3; object-fit: cover; transition: transform .4s ease }
.handoff-ph button:hover img { transform: scale(1.03) }
.handoff-cap { margin: 0; font-family: var(--display); font-size: 18px; line-height: 1.25 }
.handoff-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 14px }
.handoff-meta dt { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-top: 2px }
.handoff-meta dd { margin: 0 }

.foot { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between }
.foot p { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 60ch }
@media (max-width: 520px) { .foot .btn { width: 100% } }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink) }

/* Hoja superpuesta */
.ov { position: fixed; inset: 0; background: var(--shade); display: flex; align-items: flex-end; justify-content: center; z-index: 20; padding-top: env(safe-area-inset-top, 0px) }
@media (min-width: 760px) { .ov { align-items: center; padding: 24px } }
.sheet { background: var(--bg); width: 100%; max-width: 980px; max-height: 94vh; max-height: 94dvh; overflow: auto; border-radius: 14px 14px 0 0; padding: 18px 16px calc(24px + env(safe-area-inset-bottom, 0px)) }
@media (min-width: 760px) { .sheet { border-radius: 14px; padding: 24px } }
.sheet-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px }
.x { border: 0; background: var(--surface); border-radius: 999px; width: 36px; height: 36px; font-size: 20px; line-height: 1; flex: none }
.sheet-h.sticky { position: sticky; top: -18px; z-index: 3; background: var(--bg); margin: -18px -16px 12px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line) }
@media (min-width: 760px) { .sheet-h.sticky { top: -24px; margin: -24px -24px 14px; padding: 16px 24px 12px; border-radius: 14px 14px 0 0 } }
.slides-wrap { position: relative }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; aspect-ratio: 4/5; max-width: 100%; border-radius: 8px; background: var(--dial); scrollbar-width: none; overscroll-behavior-x: contain }
.slides::-webkit-scrollbar { display: none }
.slide { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; display: grid; place-items: center; min-width: 0 }
.slide img { width: 100%; height: 100%; object-fit: contain }
.slide .ph-dial .dial { width: 50% }
.slide-count { position: absolute; right: 10px; bottom: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; background: rgba(10, 14, 12, .65); color: #fff; padding: 4px 10px; border-radius: 999px; pointer-events: none }
.det-cta { position: sticky; bottom: calc(-24px - env(safe-area-inset-bottom, 0px)); z-index: 3; display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin: 18px -16px calc(-24px - env(safe-area-inset-bottom, 0px)); padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--bg); border-top: 1px solid var(--line) }
@media (max-width: 759px) { .det-cta .btn { flex: 1 1 auto } .det-cta .btn.pri { flex-basis: 60% } }
@media (min-width: 760px) { .det-cta { margin-inline: -24px; padding-inline: 24px; bottom: -24px; margin-bottom: -24px; padding-bottom: 16px; border-radius: 0 0 14px 14px } }
.det { display: grid; gap: 22px }
@media (min-width: 760px) { .det { grid-template-columns: 1.1fr 1fr } }
.det > * { min-width: 0 }
.gal .main { aspect-ratio: 4/5; border-radius: 8px; overflow: hidden; background: var(--dial) }
.gal .main img { width: 100%; height: 100%; object-fit: contain }
.thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto }
.thumbs button { flex: 0 0 58px; height: 58px; border-radius: 6px; overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--dial) }
.thumbs button[aria-current="true"] { border-color: var(--brass) }
.thumbs img { width: 100%; height: 100%; object-fit: cover }
.det h2 { font-family: var(--display); font-weight: 500; font-size: clamp(26px, 4vw, 36px); line-height: 1.05; margin: 4px 0 6px; text-wrap: balance; overflow-wrap: anywhere }
.det .price { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 6px 0 14px }
.specs { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 18px; padding: 14px 0; border-block: 1px solid var(--line) }
.specs dt { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-top: 3px }
.specs dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere }
.svc { background: var(--surface); border-radius: 8px; padding: 12px 14px; margin-bottom: 16px }
.svc h3 { margin: 0 0 4px; font-size: 12px; font-family: var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--brass); font-weight: 500 }
.svc p { margin: 0; white-space: pre-wrap }
.notes { white-space: pre-wrap; color: var(--muted); margin: 0 0 16px }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center }

/* Formularios */
.f { display: flex; flex-direction: column; gap: 4px; min-width: 0 }
.f label { font-size: 12px; font-weight: 600; color: var(--muted) }
.f input, .f select, .f textarea { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 9px 11px; width: 100%; min-width: 0 }
.f textarea { min-height: 76px; resize: vertical }
.f small { color: var(--muted); font-size: 12px }
.err { color: var(--sold); font-size: 13px; margin: 8px 0 0 }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 13.5px; z-index: 60; max-width: calc(100% - 32px); text-align: center }
.toast.bad { background: var(--sold); color: #fff }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important } }
