/* =========================================================
   Web de material del estudio — estilos comunes
   Diseño claro y limpio (14/11/2026, petición de Joan: «más claro, que no se líe»):
   fondo blanco, cabecera blanca de una sola fila, una sola franja con la fecha,
   tarjetas sin cajas (foto + texto), fotos reales a sangre y botones oscuros.
   Móvil primero; tableta ≥700 px; ordenador ≥900/1100 px.
   ========================================================= */
:root {
  --ink: #1b1a17;          /* texto y botones principales */
  --ink-2: #3a3833;
  --paper: #ffffff;        /* fondo */
  --soft: #f4f3f0;         /* gris muy claro: cajas suaves, fondo de fotos */
  --card: #ffffff;
  --line: #e6e4df;
  --text: #1b1a17;
  --muted: #6e6a62;
  --gold: #c9962b;         /* acento de plato: solo detalles */
  --gold-2: #f1c24b;
  --gold-ink: #3a2a05;
  --ok: #1f8a4c;
  --ok-bg: #e7f5ec;
  --bad: #b3261e;
  --bad-bg: #fcebe9;
  --warn-bg: #fff6dc;
  --off: #9a958c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 18px rgba(0,0,0,.07);
  --header-h: 60px;        /* una sola fila en todos los tamaños */
  --side-w: 260px;
  --tap: 44px;             /* tamaño mínimo para el dedo */
  font-size: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 8px); }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-size: 16px; } /* evita el zoom automático del iPhone */
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
.h-caps { font-weight: 800; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 2px; border-radius: 6px; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  min-height: var(--tap); padding: .55em 1.1em; border-radius: 10px;
  border: 1px solid #d6d3cc; background: #fff; color: var(--text);
  font-weight: 650; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: #b9b5ac; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary, .btn.dark, .btn.cta { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover, .btn.dark:hover, .btn.cta:hover { background: #33312c; }
.btn.cta { border-radius: 99px; }
.btn.cta[disabled] { background: #c9c6bf; border-color: #c9c6bf; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; text-decoration: underline; padding-inline: .6em; }
.btn.big { font-size: 1.08rem; min-height: 54px; padding-inline: 1.4em; }
.btn.small { min-height: 36px; padding: .3em .8em; font-size: .9rem; }
.btn.block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: var(--tap); height: var(--tap);
  border-radius: 10px; border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1.35rem;
}
.icon-btn:hover { background: var(--soft); }
.link { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }

/* ---------- formularios ---------- */
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-weight: 650; margin-bottom: 4px; font-size: .95rem; }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea, .input {
  width: 100%; min-height: var(--tap); padding: .55em .75em; border: 1px solid #d6d3cc;
  border-radius: 10px; background: #fff;
}
.field textarea { min-height: 90px; resize: vertical; }
.field .err, .form-err { color: var(--bad); font-size: .9rem; margin-top: 4px; }
.field.has-err input, .field.has-err textarea { border-color: var(--bad); }
.row2 { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .row2 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; align-items: flex-start; gap: 10px; min-height: var(--tap); padding: 6px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 1px; flex: 0 0 auto; accent-color: var(--ink); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: var(--tap); user-select: none; }
.switch input { appearance: none; width: 46px; height: 26px; border-radius: 99px; background: #d6d3cc; position: relative; cursor: pointer; transition: background .15s; flex: 0 0 auto; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { left: 23px; }

/* ---------- cabecera: blanca, una sola fila ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 40; background: #fff; color: var(--text);
  height: var(--header-h); padding: 0 6px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 4px;
}
.site-header .brand { flex: 1 1 auto; min-width: 0; }
.site-header .search, .site-header .lang { display: none; }
@media (min-width: 900px) {
  .site-header { padding: 0 16px; gap: 12px; }
  .site-header .brand { flex: 0 0 auto; }
  .site-header .search { display: block; flex: 1 1 auto; max-width: 560px; margin: 0 auto; }
  .site-header .lang { display: inline-flex; }
}
@media (min-width: 1100px) { .site-header .burger { display: none; } }
.burger .sticks { display: block; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.12rem; letter-spacing: -.01em; }
.brand .brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .logo { font-size: 1.35rem; }
.search { position: relative; }
.search input {
  width: 100%; height: 44px; border-radius: 99px; border: 1px solid transparent; padding: 0 16px 0 42px;
  background: var(--soft); color: var(--text);
}
.search input:focus { background: #fff; border-color: #cfcbc3; outline: none; }
.search input::placeholder { color: #8d887f; }
.search::before { content: "🔍"; position: absolute; left: 15px; top: 50%; transform: translateY(-50%); font-size: .95rem; opacity: .65; pointer-events: none; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.lang button { border: 0; background: transparent; color: var(--muted); height: 34px; min-width: 40px; cursor: pointer; font-weight: 700; font-size: .85rem; }
.lang button[aria-pressed=true] { background: var(--ink); color: #fff; }
.cart-btn, .user-btn { position: relative; color: var(--text); }
.user-btn { width: auto; min-width: var(--tap); padding: 0 8px; gap: 6px; display: inline-flex; align-items: center; font-size: 1rem; font-weight: 650; }
.user-btn .user-label { display: none; }
@media (min-width: 900px) { .user-btn .user-label { display: inline; } }
.badge-count {
  position: absolute; top: 3px; right: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px;
  background: var(--gold-2); color: var(--gold-ink); font-size: .75rem; font-weight: 800; display: grid; place-items: center;
}
.user-menu { position: fixed; right: 8px; top: calc(var(--header-h) + 4px); background: #fff; color: var(--text); border-radius: 12px; box-shadow: var(--shadow); border: 1px solid var(--line); min-width: 230px; padding: 6px; z-index: 60; }
.user-menu a, .user-menu button { display: flex; width: 100%; min-height: var(--tap); align-items: center; padding: 0 12px; border: 0; background: none; text-decoration: none; cursor: pointer; border-radius: 8px; font-weight: 600; text-align: left; }
.user-menu a:hover, .user-menu button:hover { background: var(--soft); }

/* ---------- menú lateral (blanco) ---------- */
.side {
  position: fixed; top: var(--header-h); bottom: 0; left: 0; width: min(86vw, var(--side-w)); z-index: 50;
  background: #fff; color: var(--text); overflow-y: auto; padding: 10px 10px 28px; border-right: 1px solid var(--line);
  transform: translateX(-102%); transition: transform .2s ease;
}
.side.open { transform: none; box-shadow: 8px 0 30px rgba(0,0,0,.12); }
.side-overlay { position: fixed; inset: var(--header-h) 0 0 0; background: rgba(20,18,14,.35); z-index: 45; }
@media (min-width: 1100px) {
  .side { transform: none; width: var(--side-w); box-shadow: none !important; }
  .side-overlay { display: none !important; }
}
.side .side-lang { display: flex; justify-content: flex-start; padding: 4px 10px 8px; }
@media (min-width: 900px) { .side .side-lang { display: none; } }
.side h4 { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: .74rem; font-weight: 700; margin: 18px 12px 6px; }
.side a.nav { display: flex; justify-content: space-between; align-items: center; min-height: var(--tap); padding: 0 12px; border-radius: 10px; text-decoration: none; color: inherit; font-weight: 600; }
.side a.nav:hover { background: var(--soft); }
.side a.nav.active { background: var(--soft); font-weight: 800; box-shadow: inset 3px 0 0 var(--ink); }
.side a.nav .n { font-size: .8rem; color: var(--muted); font-weight: 600; }
.side .tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px; }
.side .tags a { font-size: .85rem; padding: 6px 11px; border-radius: 99px; background: var(--soft); text-decoration: none; }
.side .tags a:hover { background: #eae8e3; }
.side .contact { margin: 24px 12px 0; font-size: .88rem; color: var(--muted); }
.side .owner-box { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 4px; }
.side .owner-box h4 { color: var(--text); }
.side .owner-box .nav.new { color: var(--muted); }

/* ---------- contenido ---------- */
.main { padding: calc(var(--header-h) + 12px) 14px 90px; max-width: 1500px; }
@media (min-width: 700px) { .main { padding-inline: 22px; } }
@media (min-width: 1100px) { .main { margin-left: var(--side-w); padding-inline: 32px; padding-top: calc(var(--header-h) + 20px); } }
.msearch { margin-bottom: 10px; }
@media (min-width: 900px) { .msearch { display: none; } }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 14px; }
.page-head h1 { font-size: 1.45rem; margin: 0; }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }

/* franja de la fecha: el único sitio donde se ve y se cambia el día */
.datebar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; padding: 10px 14px; border-radius: var(--radius); background: var(--soft); }
.datebar .when { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 0; cursor: pointer; text-align: left; min-height: 36px; }
.datebar .when b { font-size: 1.02rem; }
.datebar .when u { color: var(--muted); font-size: .92rem; }
.datebar.empty { background: var(--warn-bg); }
.datebar.empty span { font-weight: 650; }

/* ---------- cuadrícula y tarjetas (sin cajas: foto + texto) ---------- */
.grid { display: grid; gap: 26px 20px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1500px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { position: relative; display: flex; flex-direction: column; }
.card .car { border-radius: var(--radius); }
.card .body { padding: 10px 2px 0; display: flex; flex-direction: column; gap: 2px; flex: 1; cursor: pointer; }
.card .name { font-weight: 750; font-size: 1.05rem; line-height: 1.3; text-decoration: none; }
.card .sub { color: var(--muted); font-size: .92rem; }
.card .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 0 2px; }
.card .price { font-weight: 800; font-size: 1.15rem; }
.card .price small { font-size: .82rem; font-weight: 600; color: var(--muted); }
.stock { display: flex; align-items: center; gap: 6px; font-size: .9rem; font-weight: 600; margin-top: 3px; }
.stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.stock.ok { color: var(--ok); } .stock.no { color: var(--off); } .stock.show { color: var(--muted); }
.add-btn { min-height: 40px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--ink); background: #fff; color: var(--ink); font-weight: 700; cursor: pointer; white-space: nowrap; }
.add-btn:hover { background: var(--ink); color: #fff; }
.add-btn.in { background: var(--ok); border-color: var(--ok); color: #fff; }
.card.off .car img { filter: grayscale(1); opacity: .45; }
.card.off .name, .card.off .price { color: var(--off); }
.card .car-wrap { position: relative; }

/* ---------- carrusel de fotos (deslizable) ---------- */
/* Fotos reales: llenan el recuadro (cover). */
.car { position: relative; background: var(--soft); aspect-ratio: 4 / 3; overflow: hidden; }
.car-track { display: flex; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.car-track::-webkit-scrollbar { display: none; }
.car-track > * { flex: 0 0 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.car-track img { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.car .nophoto { display: grid; place-items: center; font-size: 3.2rem; color: #c9c5bc; height: 100%; }
.car-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.car-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.65); box-shadow: 0 0 2px rgba(0,0,0,.45); }
.car-dots i.on { background: #fff; width: 18px; border-radius: 99px; }
.car-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.94); cursor: pointer; font-size: 1.3rem; display: none; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.car-btn.prev { left: 8px; } .car-btn.next { right: 8px; }
@media (hover: hover) and (pointer: fine) { .car:hover .car-btn { display: grid; place-items: center; } }

/* ---------- capas: ficha, carrito, ventanas ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20,18,14,.45); z-index: 70; display: flex; align-items: stretch; justify-content: center; }
.sheet { background: #fff; width: 100%; height: 100%; overflow-y: auto; position: relative; display: flex; flex-direction: column; }
.sheet-head { position: sticky; top: 0; z-index: 3; background: #fff; color: var(--text); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 6px 16px; min-height: 56px; }
.sheet-head h2 { margin: 0; font-size: 1.1rem; }
.sheet-body { padding: 16px; flex: 1; }
.sheet-foot { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) {
  .overlay.center { align-items: center; padding: 24px; }
  .overlay.center .sheet { height: auto; max-height: calc(100vh - 48px); max-width: 560px; border-radius: 16px; overflow: auto; }
  .overlay.center .sheet.wide { max-width: 1040px; }
  .overlay.right { justify-content: flex-end; }
  .overlay.right .sheet { max-width: 440px; box-shadow: -8px 0 30px rgba(0,0,0,.15); }
}

/* ficha de artículo */
.product { display: grid; gap: 18px; grid-template-columns: 1fr; }
.gallery { display: grid; gap: 10px; grid-template-columns: 1fr; }
.gallery .car { border-radius: var(--radius); }
.thumbs { display: none; }
@media (min-width: 900px) {
  .product { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; gap: 28px; }
  .gallery.has-thumbs { grid-template-columns: 1fr 84px; }
  .thumbs { display: flex; flex-direction: column; gap: 8px; max-height: 480px; overflow-y: auto; }
  .thumbs button { border: 2px solid transparent; border-radius: 8px; padding: 0; overflow: hidden; cursor: pointer; background: none; aspect-ratio: 4/3; }
  .thumbs button.on { border-color: var(--ink); }
  .thumbs img { width: 100%; height: 100%; object-fit: cover; }
}
.product .meta { color: var(--muted); }
.product .price-big { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; margin: 10px 0 2px; line-height: 1.1; }
.product .price-big small { font-size: 1rem; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.desc ul { margin: .4em 0; padding-left: 1.2em; }
.desc p { margin: .4em 0; }
.avail-line { padding: 10px 12px; border-radius: 10px; font-weight: 650; margin: 12px 0; }
.avail-line.ok { background: var(--ok-bg); color: var(--ok); }
.avail-line.no { background: var(--soft); color: #57524a; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; background: var(--soft); text-decoration: none; font-size: .9rem; font-weight: 600; border: 0; cursor: pointer; }
.chip.on { background: var(--ink); color: #fff; }
.qty { display: inline-flex; align-items: center; border: 1px solid #d6d3cc; border-radius: 99px; overflow: hidden; background: #fff; }
.qty button { width: var(--tap); height: var(--tap); border: 0; background: transparent; font-size: 1.3rem; cursor: pointer; }
.qty button[disabled] { opacity: .3; }
.qty output { min-width: 32px; text-align: center; font-weight: 800; }
.desc { white-space: pre-line; }
.owner-note { background: var(--soft); border-radius: 10px; padding: 10px 12px; margin: 12px 0; font-size: .95rem; }
/* fundas: opciones instrumento / pack / funda */
.case-hint { color: var(--muted); font-size: .86rem; margin-top: 2px; }
.opts { border: 0; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.opts legend { font-weight: 750; margin-bottom: 6px; padding: 0; }
.opt { display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--paper); }
.opt:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }
.opt input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--ink); margin: 0; }
.opt .ot { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.opt .ot small { color: var(--muted); font-size: .85rem; }
.opt .ot small.ok { color: var(--ok); font-weight: 600; } .opt .ot small.no { color: var(--off); font-weight: 600; }
.opt .op { font-weight: 800; white-space: nowrap; }
.opt .op small { color: var(--muted); font-weight: 600; font-size: .8rem; }
.opt.off { opacity: .55; cursor: default; }
.pack-tag { display: inline-block; font-size: .78rem; font-weight: 700; background: var(--soft); border-radius: 6px; padding: 1px 6px; vertical-align: 1px; }

/* carrito */
.cart-line { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.cart-line img, .cart-line .ph { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; background: var(--soft); display: grid; place-items: center; }
.cart-line .t { font-weight: 750; }
.cart-line .s { color: var(--muted); font-size: .88rem; }
.cart-line .ctrl { grid-column: 2 / 4; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cart-line.bad { border: 2px solid var(--bad); }
.cart-line.bad img { filter: grayscale(1); opacity: .6; }
.cart-line .warn { grid-column: 1 / 4; color: var(--bad); font-weight: 650; font-size: .9rem; }
.total { display: flex; justify-content: space-between; font-size: 1.15rem; font-weight: 800; margin: 12px 0; }
.note-box { background: var(--soft); border-radius: 10px; padding: 10px 12px; font-size: .92rem; margin: 10px 0; }
.success { text-align: center; padding: 30px 10px; }
.success .code { font-size: 2rem; font-weight: 900; letter-spacing: .08em; background: var(--soft); display: inline-block; padding: 8px 18px; border-radius: 12px; margin: 10px 0; }

/* bienvenida */
.welcome { background: #fff; color: var(--text); text-align: center; padding: 40px 22px; justify-content: center; }
.welcome h1 { font-size: 1.9rem; letter-spacing: -.01em; margin-top: 8px; }
.welcome p { color: var(--muted); font-size: 1.05rem; }
.welcome .actions { display: grid; gap: 12px; max-width: 420px; margin: 28px auto 0; }

/* ---------- zona del propietario: set y lista de cargado ---------- */
.set-top { display: grid; gap: 16px; grid-template-columns: 1fr; margin-bottom: 16px; }
@media (min-width: 900px) { .set-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.set-top .car { border-radius: var(--radius); }
.summary { border-radius: 12px; padding: 12px 14px; font-weight: 800; font-size: 1.05rem; margin: 12px 0; }
.summary.ok { background: var(--ok-bg); color: var(--ok); }
.summary.bad { background: var(--bad-bg); color: var(--bad); }
.progress { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; }
.bar { height: 10px; border-radius: 99px; background: #e8e6e1; overflow: hidden; flex: 1 1 160px; }
.bar i { display: block; height: 100%; background: var(--ok); transition: width .2s; }
.load-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.load-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; display: grid; grid-template-columns: 58px 56px 1fr; gap: 10px; align-items: center; padding: 8px 12px 8px 4px; }
.load-item .tick { width: 58px; height: 58px; display: grid; place-items: center; cursor: pointer; }
.load-item .tick input { width: 30px; height: 30px; accent-color: var(--ok); cursor: pointer; }
.load-item img, .load-item .ph { width: 56px; height: 42px; object-fit: cover; border-radius: 8px; background: var(--soft); display: grid; place-items: center; }
.load-item .nm { font-weight: 750; }
.load-item .nm a { text-decoration: none; }
.load-item .nm a:hover { text-decoration: underline; }
.load-item .q { color: var(--muted); font-size: .9rem; }
.load-item.done { background: #f3f9f5; border-color: #cfe8d8; }
.load-item.done .nm { text-decoration: line-through; text-decoration-color: rgba(0,0,0,.35); }
.load-item.bad { border: 2px solid var(--bad); }
.load-item .why { grid-column: 2 / 4; color: var(--bad); font-size: .9rem; font-weight: 650; }
.load-item .why div + div { margin-top: 2px; }
.blocks { margin-top: 26px; }
.block-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.sets-grid .card .body { cursor: pointer; }

/* ---------- avisos (uno cada vez) ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 600; text-align: center; }
.toast.bad { background: var(--bad); }
.toast.ok { background: var(--ok); }
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- página de aprobar (approve.php) ---------- */
body.approve { display: flex; justify-content: center; padding: 20px 12px; background: var(--soft); }
.approve-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 22px; width: 100%; max-width: 560px; }
.approve-card h1 { font-size: 1.5rem; }
.approve-card .note { background: var(--warn-bg); padding: 10px; border-radius: 8px; }
.approve-card .lines { list-style: none; padding: 0; margin: 14px 0; }
.approve-card .lines li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eee; }
.approve-card .lines li span:last-child { white-space: nowrap; }
.approve-card .total { font-size: 1.15rem; }
.approve-card .status { font-weight: 800; }
.approve-card .st-confirmada { color: var(--ok); } .approve-card .st-anulada { color: var(--bad); }
.approve-card .ok-msg { background: var(--ok-bg); color: var(--ok); padding: 10px; border-radius: 8px; font-weight: 700; }
.approve-card .err-msg { background: var(--bad-bg); color: var(--bad); padding: 10px; border-radius: 8px; font-weight: 700; }
.approve-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0; }

/* =========================================================
   Panel de administración (también claro)
   ========================================================= */
body.admin { padding-bottom: 60px; background: var(--soft); }
.adm-head { position: sticky; top: 0; z-index: 40; background: #fff; color: var(--text); border-bottom: 1px solid var(--line); }
.adm-head .bar1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; }
.adm-head .bar1 b { font-weight: 800; }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 0 8px 8px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 99px; text-decoration: none; color: var(--muted); font-weight: 700; }
.tabs a:hover { background: var(--soft); }
.tabs a.active { background: var(--ink); color: #fff; }
.tabs .pill { background: var(--bad); color: #fff; border-radius: 99px; font-size: .75rem; padding: 1px 7px; }
/* en el móvil las pestañas pasan a dos filas: así se ven todas (también «Correo») sin deslizar */
@media (max-width: 699px) { .tabs { flex-wrap: wrap; overflow: visible; } .tabs a { padding: 0 11px; min-height: 38px; } }
.adm-main { max-width: 1100px; margin: 0 auto; padding: 16px 12px; }
@media (min-width: 700px) { .adm-main { padding: 22px 20px; } }
.panel { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); padding: 16px; margin-bottom: 16px; }
.panel h2 { font-size: 1.15rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .input { flex: 1 1 200px; width: auto; min-width: 0; max-width: 100%; }
.list { display: grid; gap: 8px; }
.list-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-decoration: none; }
.list-item:hover { border-color: #cfcbc3; }
.list-item img, .list-item .ph { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; background: var(--soft); display: grid; place-items: center; }
.list-item .t { font-weight: 750; }
.list-item .s { color: var(--muted); font-size: .88rem; }
@media (max-width: 599px) {
  .list-item { grid-template-columns: 64px minmax(0, 1fr); align-items: start; }
  .list-item .flags { grid-column: 2; justify-content: flex-start; }
}
.flags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.flag { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--soft); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flags { min-width: 0; }
.flag.ok { background: var(--ok-bg); color: var(--ok); } .flag.bad { background: var(--bad-bg); color: var(--bad); } .flag.gold { background: var(--warn-bg); color: #7a5a00; }
.res-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.res-card .top { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: space-between; }
.res-card .code { font-weight: 900; letter-spacing: .04em; }
.res-card ul { margin: 8px 0; padding-left: 18px; }
.res-card .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.st { font-size: .78rem; font-weight: 800; padding: 3px 9px; border-radius: 99px; text-transform: uppercase; letter-spacing: .03em; }
.st-pendiente { background: var(--warn-bg); color: #7a5a00; } .st-confirmada { background: var(--ok-bg); color: var(--ok); }
.st-devuelta { background: #e7eef9; color: #234c8a; } .st-anulada { background: var(--bad-bg); color: var(--bad); }
.photos-edit { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.photos-edit .ph-item { position: relative; border-radius: 10px; overflow: hidden; background: var(--soft); aspect-ratio: 4/3; }
.photos-edit .ph-item img { width: 100%; height: 100%; object-fit: cover; }
.photos-edit .ph-item .bar2 { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; background: rgba(0,0,0,.55); }
.photos-edit .ph-item .bar2 button { color: #fff; width: 40px; height: 36px; }
.photos-edit .ph-item .main-tag { position: absolute; top: 6px; left: 6px; background: var(--ink); color: #fff; font-size: .72rem; font-weight: 800; padding: 2px 7px; border-radius: 99px; }
.upload-box { display: grid; place-items: center; border: 2px dashed #cfcbc3; border-radius: 10px; aspect-ratio: 4/3; cursor: pointer; color: var(--muted); font-weight: 700; text-align: center; padding: 8px; }
.items-edit .it { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.items-edit .it > :first-child { flex: 1; min-width: 0; }
/* artículos de un set: asa para arrastrar, nombre y controles (en el móvil los controles bajan a otra línea) */
.items-edit .set-it { flex-wrap: wrap; column-gap: 6px; row-gap: 2px; background: var(--card); }
.items-edit .set-it > :first-child { flex: 0 0 auto; }
.items-edit .set-it .it-main { flex: 1 1 200px; min-width: 0; }
.items-edit .set-it .it-ctl { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.items-edit .drag { width: 36px; height: var(--tap); border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 1.3rem; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.items-edit .drag:hover, .items-edit .drag:focus-visible { background: var(--line); color: inherit; }
.items-edit.sorting { user-select: none; -webkit-user-select: none; }
.items-edit.sorting .drag { cursor: grabbing; }
.items-edit .set-it.dragging { position: relative; z-index: 2; box-shadow: 0 6px 18px rgba(0,0,0,.18); border-radius: 10px; outline: 2px solid var(--ink); }
.case-box { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; margin-top: 12px; }
.case-box legend { font-weight: 650; padding: 0 4px; }

.picker { position: relative; }
.picker-results { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 300px; overflow-y: auto; }
.picker-results button { display: flex; justify-content: space-between; gap: 8px; width: 100%; min-height: var(--tap); padding: 6px 12px; border: 0; background: none; text-align: left; cursor: pointer; }
.picker-results button:hover { background: var(--soft); }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid #d6d3cc; border-radius: 10px; background: #fff; min-height: var(--tap); }
.tag-input input { border: 0 !important; outline: 0; flex: 1 1 120px; min-height: 34px !important; padding: 0 6px !important; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-top: 8px; }
.cat-row { display: grid; grid-template-columns: 1fr; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 700px) { .cat-row { grid-template-columns: 1fr 1fr 1fr auto; } }
.cat-group { border-bottom: 2px solid var(--line); padding-bottom: 4px; }
.cat-row.sub { padding-left: calc(6px + 12px * var(--d, 1)); border-left: 3px solid var(--line); margin-left: 4px; }
.cat-row.new { border-bottom: 0; margin-top: 8px; }
.cat-row .acts { display: flex; gap: 4px; justify-content: flex-end; }
.login-box { max-width: 420px; margin: 8vh auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* pasos numerados (pestaña Correo) */
.steps { margin: 8px 0 0; padding-left: 22px; } .steps li { margin: 4px 0; }

/* selector de 3 opciones (Funda: sin / lleva / es una funda) */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { flex: 1 1 auto; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 0 14px; border: 1.5px solid var(--line); border-radius: 10px; font-weight: 700; cursor: pointer; background: var(--paper); white-space: nowrap; }
.seg input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--gold-2); outline-offset: 2px; }

/* fotos desde el móvil: cámara en la lista y botones grandes en la ficha */
.th-wrap { position: relative; display: block; width: 64px; height: 48px; }
.cam-btn { position: absolute; right: -8px; bottom: -8px; width: 34px; height: 34px; min-width: 34px; min-height: 34px; max-height: 34px; padding: 0; margin: 0; border-radius: 50%; border: 2px solid var(--paper); background: var(--soft); font-size: 16px; line-height: 1; display: grid; place-items: center; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.cam-btn.empty { background: var(--gold-2); }
.cam-btn:disabled { font-size: 11px; font-weight: 800; }
.ph-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ph-actions .btn { flex: 1 1 180px; justify-content: center; position: relative; overflow: hidden; }
.up-msg { margin: 8px 0 0; font-weight: 700; }

/* subcategorías: en el menú, debajo de su categoría; en la página, accesos rápidos */
.side a.nav.sub { min-height: 38px; padding-left: calc(12px + 14px * var(--d, 1)); font-weight: 500; font-size: .95rem; }
.side a.nav.sub.hidden { display: none; }
.subcats { margin: 0 0 14px; }
.crumbs { margin: 14px 0 -10px; font-size: .92rem; color: var(--muted); }
.crumbs a { color: inherit; }
.subcats .chip { text-decoration: none; color: inherit; }
.subcats .chip.on { background: var(--ink); color: #fff; }
.subcats .chip .n { font-size: .78rem; opacity: .7; }

/* selección múltiple de artículos (mover de categoría de golpe) */
.head-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.sel-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; font-weight: 700; }
.list.sel-mode .list-item { padding-left: 46px; position: relative; }
.list.sel-mode .list-item::before { content: ''; position: absolute; left: 12px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border: 2px solid var(--line); border-radius: 6px; background: var(--paper); }
.list.sel-mode .list-item.picked { box-shadow: 0 0 0 2px var(--ink) inset; }
.list.sel-mode .list-item.picked::before { background: var(--ink); border-color: var(--ink); content: '✓'; color: #fff; font-weight: 900; font-size: 15px; line-height: 18px; text-align: center; }
.list.sel-mode .cam-btn { display: none; }
.bulk-bar { position: sticky; bottom: 0; z-index: 30; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); margin: 12px -12px 0; background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0,0,0,.08); }
.bulk-bar .bn { font-weight: 800; }
.bulk-bar select { flex: 1 1 180px; min-width: 0; }
/* − / + de las unidades */
.stepper { display: flex; align-items: stretch; gap: 6px; }
.stepper .btn { min-width: var(--tap); padding: 0; font-size: 1.4rem; font-weight: 700; }
.stepper input { flex: 1 1 auto; min-width: 0; text-align: center; font-weight: 700; }
/* ordenar la lista de sets */
.list.sorting-list .list-item { cursor: default; }
.list-item.sort-row { grid-template-columns: 36px 64px minmax(0, 1fr) auto; }
.list-item.sort-row .flags { grid-column: auto; flex-wrap: nowrap; justify-content: flex-end; }
.sort-row .drag, .items-edit .drag { width: 36px; height: var(--tap); border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 1.3rem; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; flex: 0 0 auto; }
.sort-row .drag:hover, .sort-row .drag:focus-visible { background: var(--line); color: inherit; }
.list.sorting { user-select: none; -webkit-user-select: none; }
.list .sort-row.dragging { position: relative; z-index: 2; box-shadow: 0 6px 18px rgba(0,0,0,.18); outline: 2px solid var(--ink); }
/* armarios */
.cat-row > * { min-width: 0; }
.cat-row select, .cat-row input { width: 100%; min-width: 0; }
.cat-row .acts input { width: 70px; }
/* armarios en el móvil: nombre arriba, tipo y «dentro de» lado a lado, botones abajo */
@media (max-width: 699px) {
  .loc-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  .loc-row > :first-child, .loc-row > .acts { grid-column: 1 / -1; }
  .loc-row .acts { flex-wrap: wrap; }
}
.loc-row .kind { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.list-item .where { color: var(--muted); }
/* fotos de los armarios */
.loc-photos { grid-column: 1 / -1; padding: 8px 0 4px; }
.ph-btn { gap: 6px; }
.ph-btn img { width: 32px; height: 24px; object-fit: cover; border-radius: 4px; display: block; }
.loc-pics { display: flex; gap: 8px; flex-wrap: wrap; margin: -6px 0 14px; }
.loc-pics:empty { display: none; }
.loc-pics a { display: flex; flex-direction: column; gap: 2px; width: 96px; text-decoration: none; color: var(--muted); font-size: .78rem; }
.loc-pics img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
/* qué va dentro de una funda: − n + pequeño */
.stepper.mini { gap: 4px; }
.stepper.mini .btn { min-width: 38px; min-height: 38px; font-size: 1.15rem; }
.stepper.mini input { width: 52px; flex: 0 0 52px; padding-left: 4px; padding-right: 4px; }

