/* Anima Argentea — un solo tema, oscuro, plata envejecida. */
:root {
  --bg: #15171b;
  --surface: #1d2025;
  --surface-2: #24282e;
  --line: #333941;
  --text: #eae6dd;
  --muted: #9c978b;
  --silver: #c9c3b5;
  --bronze: #b48a54;
  --bronze-soft: #6b5638;
  --ok: #6e9e6c;
  --warn: #c79b4a;
  --sold: #b36a60;
  --hidden: #7c828b;
  --r: 10px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* si no, .drawer/.bulk (display:flex) ganan al atributo hidden */
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--bronze); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; text-wrap: balance; margin: 0; }
:focus-visible { outline: 2px solid var(--bronze); outline-offset: 2px; }
.no-scroll { overflow: hidden; }

/* ---------------- public: shell ---------------- */
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-family: var(--serif); font-size: 1.05rem; }
.brand img { width: 34px; height: 34px; object-fit: contain; border-radius: 7px; }

main { max-width: 1120px; margin: 0 auto; padding: 32px 24px 80px; }

.hero { text-align: center; padding: 56px 0 40px; }
.hero-logo { width: 376px; max-width: 72%; height: auto; margin: 0 auto 22px; border-radius: 12px; } /* 50% de 752px, recortado sin la frase */
.hero h1 { font-size: clamp(2.4rem, 6vw, 3.8rem); color: var(--silver); }
.hero p { color: var(--muted); margin: 14px auto 0; max-width: 44ch; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.chip {
  font-size: 0.82rem; text-transform: capitalize; padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: var(--surface);
}
.chip:hover { text-decoration: none; color: var(--text); }
.chip.on { color: var(--bg); background: var(--silver); border-color: var(--silver); }
.chip-dl { border-color: var(--bronze); color: var(--bronze); text-transform: none; }
.chip-dl:hover { background: var(--bronze); color: #1a1108; text-decoration: none; }
.filters input[type=search] {
  margin-left: auto; padding: 8px 12px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}

/* ---------------- public: grid ---------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.card { color: var(--text); display: flex; flex-direction: column; }
.card:hover { text-decoration: none; }
.card-img {
  position: relative; aspect-ratio: 3 / 4; border-radius: var(--r); overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line);
}
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-img img { transform: scale(1.04); }
.card-img.sold img { filter: grayscale(0.7) brightness(0.7); }
.noimg { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 0.85rem; }
.noimg.big { aspect-ratio: 3/4; border: 1px solid var(--line); border-radius: var(--r); }
.tag {
  position: absolute; top: 10px; left: 10px; font-size: 0.7rem; letter-spacing: .04em;
  text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: var(--bg); color: var(--text);
}
.tag-vendido { background: var(--sold); color: #1b1210; }
.tag-reservado { background: var(--warn); color: #1b1508; }
.tag-feat { background: var(--bronze); color: #1a1108; }
.card-body { padding: 12px 2px 0; }
.card-body h3 { font-size: 1.15rem; }
.card-meta { color: var(--muted); font-size: 0.82rem; text-transform: capitalize; margin: 2px 0 0; }
.card-price { color: var(--silver); font-size: 0.9rem; margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* ---------------- public: piece ---------------- */
.piece { display: grid; grid-template-columns: 1.1fr 1fr; gap: 44px; padding-top: 40px; }
.piece-gallery img { border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2); }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumbs button { width: 64px; height: 80px; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: none; cursor: pointer; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.crumb { text-transform: capitalize; font-size: 0.85rem; margin: 0 0 6px; }
.piece-info h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); color: var(--silver); }
.state { display: inline-block; margin: 12px 0 0; padding: 4px 10px; border-radius: 999px; font-size: 0.8rem; }
.state-vendido { background: var(--sold); color: #1b1210; }
.state-reservado { background: var(--warn); color: #1b1508; }
.price { font-size: 1.3rem; color: var(--silver); margin: 14px 0; font-variant-numeric: tabular-nums; }
.desc { color: var(--text); }
.specs { display: grid; gap: 0; margin: 22px 0; border-top: 1px solid var(--line); }
.specs > div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.specs dt { color: var(--muted); margin: 0; }
.specs dd { margin: 0; color: var(--text); }
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 999px; border: 1px solid var(--bronze);
  background: var(--bronze); color: #1a1108; font-weight: 600; font-size: 0.92rem; cursor: pointer;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.care { color: var(--muted); font-size: 0.82rem; margin-top: 22px; max-width: 46ch; }

.site-foot { border-top: 1px solid var(--line); padding: 36px 24px; text-align: center; color: var(--muted); }
.site-foot p { max-width: 100ch; margin: 0 auto; text-wrap: pretty; }
.foot-meta { margin-top: 12px; font-size: 0.82rem; }

@media (max-width: 720px) {
  .piece { grid-template-columns: 1fr; gap: 22px; }
}

/* ================ ADMIN ================ */
body.admin { background: var(--bg); }
.admin-head {
  display: flex; align-items: center; gap: 20px; padding: 12px 20px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.admin-head .brand { font-size: 1.05rem; gap: 8px; }
.tabs { display: flex; gap: 4px; }
.tabs button {
  background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.9rem;
  padding: 7px 12px; border-radius: 8px; cursor: pointer;
}
.tabs button.on { color: var(--text); background: var(--surface-2); }
.admin-head .ghost { margin-left: auto; }

.tab-panel { max-width: 1100px; margin: 0 auto; padding: 22px 20px 80px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select, .form input, .form select, .form textarea {
  padding: 8px 11px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit;
}
.toolbar input[type=search] { min-width: 230px; }
.count { color: var(--muted); font-size: 0.85rem; margin-left: auto; }

.btn.small { padding: 7px 12px; font-size: 0.82rem; }
button.ghost, .ghost {
  background: none; border: 1px solid var(--line); color: var(--muted);
  padding: 7px 12px; border-radius: 8px; font: inherit; font-size: 0.85rem; cursor: pointer;
}
button.ghost:hover { color: var(--text); text-decoration: none; }
button.danger, .danger {
  background: none; border: 1px solid var(--sold); color: var(--sold);
  padding: 7px 12px; border-radius: 8px; font: inherit; font-size: 0.85rem; cursor: pointer;
}
.toolbar .btn, .btn { border: 0; }

.bulk {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 14px;
}
.bulk span { color: var(--silver); font-size: 0.87rem; margin-right: 6px; }
.bulk button { background: none; border: 1px solid var(--line); color: var(--text); padding: 6px 11px; border-radius: 7px; font: inherit; font-size: 0.83rem; cursor: pointer; }
.bulk select { padding: 6px 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }

/* list */
.list { display: flex; flex-direction: column; gap: 6px; }
.row-item {
  display: grid; align-items: center; gap: 12px;
  grid-template-columns: 28px 46px 1fr auto 32px 130px auto;
  padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.row-item.dim { opacity: 0.55; }
.pick { display: grid; place-items: center; }
.thumb { width: 46px; height: 58px; border-radius: 6px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-main { min-width: 0; }
.row-main b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { color: var(--muted); font-size: 0.8rem; text-transform: capitalize; }
.row-price { color: var(--silver); font-size: 0.86rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.star { background: none; border: 0; color: var(--line); font-size: 1.15rem; cursor: pointer; line-height: 1; }
.star.on { color: var(--bronze); }
.row-status { padding: 5px 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-size: 0.8rem; }
.row-status.st-disponible { border-color: var(--ok); }
.row-status.st-reservado { border-color: var(--warn); }
.row-status.st-vendido { border-color: var(--sold); }
.row-status.st-oculto { border-color: var(--hidden); }
.row-actions { display: flex; gap: 8px; font-size: 0.83rem; }
.row-actions button { background: none; border: 0; color: var(--bronze); font: inherit; cursor: pointer; padding: 0; }
.row-actions a { color: var(--muted); }

@media (max-width: 780px) {
  .row-item { grid-template-columns: 24px 40px 1fr auto; grid-auto-rows: auto; }
  .row-price, .star, .row-status, .row-actions { grid-column: 3 / -1; justify-self: start; }
}

/* drawer / form */
.drawer { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); display: flex; justify-content: flex-end; z-index: 50; }
.drawer-panel { width: min(620px, 100%); height: 100%; overflow-y: auto; background: var(--bg); border-left: 1px solid var(--line); padding: 20px 24px 60px; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.drawer-head h2 { font-size: 1.5rem; color: var(--silver); }

.form { display: flex; flex-direction: column; gap: 14px; }
.form.narrow { max-width: 440px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 0.83rem; color: var(--muted); }
.form label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 0.9rem; }
.form input, .form select, .form textarea { color: var(--text); }
.form textarea { resize: vertical; font-family: inherit; }
.row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr 1fr; } }

.photos { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.photos-head { display: flex; justify-content: space-between; align-items: center; }
.photos-head h3 { font-size: 1.1rem; }
.hint { color: var(--muted); font-size: 0.8rem; margin: 6px 0 10px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.ptile { position: relative; aspect-ratio: 3/4; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); cursor: grab; }
.ptile img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ptile.drag { opacity: 0.4; }
.ptile .cover { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; font-size: 0.68rem; text-transform: uppercase; letter-spacing: .04em; padding: 3px; background: var(--bronze); color: #1a1108; }
.ptile .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; font-size: 0.75rem; line-height: 1; }

.drawer-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 6px; }
.form-msg { color: var(--ok); font-size: 0.85rem; }
.form-msg.err { color: var(--sold); }
