/* UrbanStore — Bodega (admin) */
:root {
  --ink: #0b0b0b;
  --ink-2: #141414;
  --ink-3: #1d1d1d;
  --ink-4: #2a2a2a;
  --bone: #ece9e2;
  --smoke: #8b8a85;
  --line: rgba(255, 255, 255, .1);
  --line-2: rgba(255, 255, 255, .18);
  --accent: #9d6bff;
  --sale: #ff3f81; /* descuentos: el mismo rosa de las ofertas en la tienda */
  --warn: #e0a54a;
  --red: #ff3b3b;
  --green: #3ddc84;
  --f-display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --f-body: 'Inter Tight', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --pad: clamp(16px, 3vw, 32px);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ink); color: var(--bone); font: 400 15px/1.5 var(--f-body); min-height: 100vh; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
h1, h2, h3, p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
::selection { background: var(--accent); color: var(--ink); }
.mono { font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.muted { color: var(--smoke); }
.link { color: var(--smoke); transition: color .2s; }
.link:hover { color: var(--bone); }

/* botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 20px; border-radius: 99px; font: 500 12px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; transition: transform .2s, background .2s, color .2s, border-color .2s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn--orange { background: var(--accent); color: var(--ink); }
.btn--orange:hover { background: #fff; }
.btn--ghost { border: 1px solid var(--line-2); }
.btn--ghost:hover { border-color: var(--bone); }
.btn--danger { border: 1px solid rgba(255, 59, 59, .4); color: var(--red); }
.btn--danger:hover { background: var(--red); color: var(--ink); }
.btn--sm { padding: 9px 14px; font-size: 11px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.chip { padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 99px; font: 500 11px var(--f-mono); letter-spacing: .04em; text-transform: uppercase; transition: all .2s; }
.chip:hover { border-color: var(--accent); color: var(--accent); }

/* campos */
.field { display: grid; gap: 7px; }
.field > span { color: var(--smoke); }
.field input, .field select, .field textarea, .search input, .toolbar select {
  width: 100%; padding: 12px 14px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 8px; outline: none; transition: border-color .2s, background .2s;
}
.field textarea { resize: vertical; min-height: 80px; }
.field input:focus, .field select:focus, .field textarea:focus, .search:focus-within, .toolbar select:focus { border-color: var(--accent); background: var(--ink-3); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--smoke) 50%), linear-gradient(135deg, var(--smoke) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px !important; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 > .field { align-content: start; } /* un campo al lado de otro más alto no se estira */
.span2 { grid-column: span 2; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } .span2 { grid-column: auto; } }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { position: relative; width: 38px; height: 22px; border-radius: 99px; background: var(--ink-4); transition: background .25s; flex: none; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--bone); transition: transform .3s var(--ease); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(16px); background: var(--ink); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggles { align-content: end; gap: 12px; padding-bottom: 6px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.2fr 1fr; }
.login__art { display: flex; flex-direction: column; justify-content: center; padding: var(--pad); overflow: hidden; background: var(--accent); color: var(--ink); font: 900 clamp(120px, 20vw, 300px)/.78 var(--f-display); letter-spacing: -.04em; }
.login__art span { display: block; animation: rise 1.1s var(--ease) both; }
.login__art span:nth-child(2) { animation-delay: .08s; padding-left: .4em; color: transparent; -webkit-text-stroke: 2px var(--ink); }
.login__art span:nth-child(3) { animation-delay: .16s; }
@keyframes rise { from { transform: translateY(100%); opacity: 0; } }
.login__card { align-self: center; justify-self: center; width: min(400px, 100% - 2 * var(--pad)); display: grid; gap: 18px; padding: 40px 0; animation: fade .9s .2s var(--ease) both; }
@keyframes fade { from { opacity: 0; transform: translateY(20px); } }
.login__brand { font: 800 22px/1 var(--f-display); letter-spacing: .22em; text-transform: uppercase; }
.login__title { font: 800 54px/.9 var(--f-display); text-transform: uppercase; }
.login__title em { font-style: normal; color: var(--smoke); }
.login__error { color: var(--red); min-height: 1em; }
.login__back { justify-self: start; }
.login.shake .login__card { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@media (max-width: 800px) { .login { grid-template-columns: 1fr; } .login__art { font-size: 30vw; padding-top: 40px; padding-bottom: 20px; } }

/* ---------- top ---------- */
.top { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 14px var(--pad); background: rgba(11, 11, 11, .85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top__brand { display: flex; align-items: center; gap: 12px; }
.top__brand img { width: 38px; height: 38px; border-radius: 8px; }
.top__brand b { display: block; font: 800 22px/1 var(--f-display); text-transform: uppercase; }
.top__brand small { color: var(--smoke); font-size: 9px; }
.top__tabs { display: flex; gap: 4px; padding: 4px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 99px; }
.tab { padding: 8px 16px; border-radius: 99px; font: 500 11px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--smoke); transition: all .25s; }
.tab.is-on { background: var(--bone); color: var(--ink); }
.top__actions { justify-self: end; display: flex; gap: 20px; }
@media (max-width: 700px) {
  .top { grid-template-columns: 1fr auto; }
  .top__tabs { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
  .tab { flex: 1; }
  .top__brand small { display: none; }
}

.panel { padding: 24px var(--pad) 80px; max-width: 1400px; margin: 0 auto; animation: fade .5s var(--ease) both; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { padding: 18px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px; text-align: left; transition: border-color .2s; }
button.stat:hover { border-color: var(--line-2); }
.stat.is-on { border-color: var(--accent); }
.stat b { display: block; font: 900 44px/1 var(--f-display); }
.stat span { color: var(--smoke); }
.stat--warn b { color: var(--warn); }
.stat--bad b { color: var(--red); }
@media (max-width: 700px) { .stats { grid-template-columns: 1fr 1fr; } .stat b { font-size: 34px; } }

/* toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; padding-left: 14px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 8px; color: var(--smoke); }
.search input { border: 0; background: none !important; padding-left: 0; }
.toolbar select { width: auto; flex: 0 0 auto; }
@media (max-width: 700px) { .toolbar select { flex: 1; } .toolbar .btn { width: 100%; } }

/* lista de prendas */
.list { display: grid; gap: 10px; }
.row {
  display: grid; grid-template-columns: 72px minmax(0, 1fr) auto auto; gap: 18px; align-items: center;
  padding: 12px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px; transition: border-color .2s, opacity .3s;
  animation: fade .45s var(--ease) both;
}
.row:hover { border-color: var(--line-2); }
.row.is-hidden .row__img, .row.is-hidden .row__main, .row.is-hidden .row__price { opacity: .45; }
.row__img { width: 72px; aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; background: var(--ink-3); cursor: pointer; }
.row__img img { width: 100%; height: 100%; object-fit: cover; }
.row__name { font: 700 20px/1.05 var(--f-display); text-transform: uppercase; cursor: pointer; }
.row__name:hover { color: #fff; }
.row__meta { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px; color: var(--smoke); }
.row__meta .badge { padding: 2px 6px; border-radius: 4px; background: var(--ink-4); color: var(--bone); }
.row__meta .badge--hot { background: var(--accent); color: var(--ink); }
.row__meta .badge--off { background: none; border: 1px solid var(--line-2); }
.row__meta .badge--sale { background: var(--sale); color: #fff; font-weight: 600; }

/* descuento en el editor */
.sale-switch .switch { min-height: 46px; }
.discount { gap: 12px; padding: 16px; border: 1px solid rgba(255, 63, 129, .5); border-radius: 12px; background: rgba(255, 63, 129, .06); }
.discount__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.discount__chips .chip.is-on { border-color: var(--sale); background: var(--sale); color: #fff; }
.discount__inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.discount__preview { font-size: 14px; line-height: 1.5; }
.discount__preview b { color: var(--sale); }
.discount__preview s { color: var(--smoke); }
.discount__preview.is-error { color: var(--red); }
@media (max-width: 640px) { .discount__inputs { grid-template-columns: 1fr; } }
.row__price { font: 800 24px/1 var(--f-display); text-align: right; white-space: nowrap; }
.row__price s { display: block; margin-top: 4px; font: 500 12px var(--f-mono); color: var(--smoke); }
.row__toggle { min-width: 178px; }
.row.is-hidden .row__toggle { border-color: var(--accent); color: var(--accent); }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--smoke); transition: all .2s; }
.icon-btn:hover { color: var(--bone); border-color: var(--line-2); }
.icon-btn--danger:hover { color: var(--red); border-color: var(--red); }
.row__actions { display: flex; gap: 6px; align-items: center; }
@media (max-width: 1000px) {
  .row { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; }
  .row__img { width: 64px; }
  .row__actions { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid var(--line); }
  .row__toggle { margin-right: auto; }
}
.empty { padding: 60px; text-align: center; color: var(--smoke); }

/* ---------- ajustes ---------- */
.settings { display: grid; gap: 16px; margin-bottom: 16px; }
.box { display: grid; gap: 16px; padding: clamp(18px, 3vw, 28px); background: var(--ink-2); border: 1px solid var(--line); border-radius: 14px; }
.box__title { font: 800 32px/1 var(--f-display); text-transform: uppercase; }
.box > .btn { justify-self: start; }
.cats { display: grid; gap: 8px; }
.cat { display: grid; grid-template-columns: 24px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 10px; background: var(--ink-3); border: 1px solid var(--line); border-radius: 8px; }
.cat.is-drag { opacity: .4; }
.cat.is-over { border-color: var(--accent); }
.cat__handle { cursor: grab; color: var(--smoke); text-align: center; letter-spacing: -2px; }
.cat input { padding: 8px 10px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 6px; outline: none; }
.cat input:focus { border-color: var(--accent); }
.cat__count { color: var(--smoke); }
.settings__save { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; }
.settings__save .btn { box-shadow: 0 10px 40px rgba(0, 0, 0, .6); }

/* ---------- editor ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; visibility: hidden; pointer-events: none; }
.sheet.is-open { visibility: visible; pointer-events: auto; }
.sheet__scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); opacity: 0; transition: opacity .4s; }
.sheet.is-open .sheet__scrim { opacity: 1; }
.sheet__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(720px, 100%); display: flex; flex-direction: column; background: var(--ink); border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .55s var(--ease); }
.sheet.is-open .sheet__panel { transform: none; }
.sheet__head { display: flex; justify-content: space-between; align-items: start; gap: 20px; padding: 22px var(--pad); border-bottom: 1px solid var(--line); }
.sheet__title { font: 800 34px/1 var(--f-display); text-transform: uppercase; margin-top: 4px; word-break: break-word; }
.sheet__body { flex: 1; overflow-y: auto; padding: 24px var(--pad); display: grid; gap: 30px; align-content: start; overscroll-behavior: contain; }
.sheet__foot { display: flex; gap: 10px; align-items: center; padding: 16px var(--pad); border-top: 1px solid var(--line); background: var(--ink-2); }
.spacer { flex: 1; }
.label { color: var(--smoke); margin-bottom: 12px; }

.images { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.img-tile { position: relative; width: 110px; aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; background: var(--ink-3); border: 1px solid var(--line); cursor: grab; }
.img-tile img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.img-tile:first-child::after { content: 'Portada'; position: absolute; left: 6px; bottom: 6px; padding: 2px 6px; border-radius: 4px; background: var(--accent); color: var(--ink); font: 500 9px var(--f-mono); text-transform: uppercase; }
.img-tile button { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0, 0, 0, .7); color: #fff; font-size: 12px; }
.img-tile button:hover { background: var(--red); }
.img-tile.is-loading { display: grid; place-items: center; cursor: default; }
.img-tile.is-loading::before { content: ''; width: 22px; height: 22px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.img-tile.is-over { border-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.drop-zone { display: grid; place-items: center; gap: 4px; padding: 26px; border: 1.5px dashed var(--line-2); border-radius: 12px; text-align: center; cursor: pointer; transition: all .2s; }
.drop-zone b { font: 700 20px var(--f-display); text-transform: uppercase; }
.drop-zone:hover, .drop-zone.is-over { border-color: var(--accent); background: rgba(243, 241, 236, .05); }

/* confirm */
.confirm { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, .7); animation: fade .25s both; }
.confirm__card { width: min(420px, 100%); padding: 26px; background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 14px; display: grid; gap: 22px; }
.confirm__card p { font-size: 17px; }
.confirm__actions { display: flex; justify-content: flex-end; gap: 10px; }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: 20px; z-index: 100; display: grid; gap: 8px; transform: translateX(-50%); pointer-events: none; }
.toast { padding: 12px 18px; border-radius: 99px; background: var(--bone); color: var(--ink); font: 500 12px var(--f-mono); letter-spacing: .04em; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: toast .4s var(--ease) both; white-space: nowrap; }
.toast--error { background: var(--red); color: #fff; }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toast { from { opacity: 0; transform: translateY(20px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

/* colores de la prenda */
.color-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.color-pick { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px 7px 8px; border: 1px solid var(--line-2); border-radius: 99px; font-size: 13px; transition: border-color .2s, background .2s; }
.color-pick span { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.color-pick:hover { border-color: var(--accent); }
.color-pick.is-on { border-color: var(--accent); background: rgba(157, 107, 255, .16); }

/* horario por día */
.schedule { display: grid; gap: 8px; }
.sched { display: grid; grid-template-columns: 170px auto auto auto; align-items: center; justify-content: start; gap: 10px; }
.sched input[type="time"] { padding: 9px 10px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 8px; color-scheme: dark; outline: none; }
.sched input[type="time"]:focus { border-color: var(--accent); }
.sched input[disabled] { opacity: .35; }
@media (max-width: 640px) { .sched { grid-template-columns: 1fr auto auto auto; } }

.saving-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 6px; }

/* Inventario grande: cuántas se ven y "Mostrar más" */
.list-count { margin: -6px 0 12px; }
.list-more { display: flex; justify-content: center; margin-top: 18px; }
.list-more .btn[hidden] { display: none; }
/* Tallas del editor: campo libre + atajos */
.size-sets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.size-sets .chip { padding: 6px 10px; font-size: 10px; }

/* Vitrina de Instagram */
[data-panel="vitrina"] { display: grid; gap: 18px; }
[data-panel="vitrina"][hidden] { display: none; }
.ig-list { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.ig-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink-3); }
.ig-item__media { position: relative; width: 72px; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 8px; background: var(--ink-4); }
.ig-item__media img, .ig-item__media video { width: 100%; height: 100%; object-fit: cover; }
.ig-item__media span { position: absolute; left: 4px; top: 4px; padding: 2px 5px; border-radius: 4px; background: rgba(0, 0, 0, .75); font: 500 9px var(--f-mono); text-transform: uppercase; color: #fff; }
.ig-item__fields { display: grid; grid-template-columns: 1fr 110px; gap: 8px; }
.ig-item__fields input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--ink-2); color: var(--bone); font: inherit; font-size: 14px; outline: none; }
.ig-item__fields input:focus { border-color: var(--accent); }
.ig-item__fields .ig-item__url { grid-column: 1 / -1; font-size: 12px; color: var(--smoke); }
.ig-item__actions { display: flex; gap: 6px; }
.ig-item__actions .icon-btn[disabled] { opacity: .3; pointer-events: none; }
.ig-save { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.ig-kind { display: flex; gap: 8px; }
.ig-kind label { position: relative; cursor: pointer; }
.ig-kind input { position: absolute; opacity: 0; pointer-events: none; }
.ig-kind span { display: inline-block; padding: 9px 14px; border: 1px solid var(--line-2); border-radius: 99px; font: 500 11px var(--f-mono); text-transform: uppercase; transition: all .2s; }
.ig-kind input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.ig-kind input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.ig-status { min-height: 1em; color: var(--smoke); }
.ig-status.is-error { color: var(--red); }
@media (max-width: 640px) {
  .ig-item { grid-template-columns: 60px 1fr; }
  .ig-item__media { width: 60px; }
  .ig-item__actions { grid-column: 1 / -1; justify-content: flex-end; }
  .ig-item__fields { grid-template-columns: 1fr; }
}
