/* =========================================================================
 * Identidad del panel del vendedor (spec 007; research RP-01 a RP-09).
 * Se carga después de seller.css: redefine tokens y componentes comunes con la identidad de la
 * página de inicio (spec 005) y añade las piezas nuevas. No afecta a la vista del comprador.
 * ========================================================================= */
.layout-seller, .layout-auth {
  --color-primary: #0B5CAD;
  --color-primary-hover: #094A8C;
  --color-focus: #FF8A3D;
  --panel-brand-deep: #083F78;
  --panel-accent: #FF8A3D;
  --panel-soft: #EEF4FB;
  --panel-ink: #14202E;
  --radius: 12px;
  --panel-radius-lg: 16px;
  --shadow: 0 10px 30px rgba(8, 63, 120, 0.10), 0 2px 6px rgba(8, 63, 120, 0.06);
  --panel-shadow-hover: 0 16px 36px rgba(8, 63, 120, 0.16);
  background: #F7FAFD;
  color: var(--panel-ink);
}
.panel-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.layout-seller h1, .layout-auth h1 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.layout-seller :focus-visible, .layout-auth :focus-visible { outline: 3px solid var(--panel-accent); outline-offset: 2px; }

/* ---------- Botones (FR-P04) ---------- */
.layout-seller .btn, .layout-auth .btn { border-radius: 999px; min-height: 44px; padding-inline: 18px; font-weight: 700; transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease; }
.layout-seller .btn--sm, .layout-auth .btn--sm { min-height: 36px; padding-inline: 14px; }
.layout-seller .btn--primary, .layout-auth .btn--primary { background: var(--color-primary); border-color: var(--color-primary); color: #fff; box-shadow: 0 8px 18px rgba(11, 92, 173, 0.28); }
.layout-seller .btn--primary:hover, .layout-auth .btn--primary:hover { background: var(--color-primary-hover); transform: translateY(-1px); box-shadow: 0 12px 24px rgba(11, 92, 173, 0.34); }
.btn--accent { background: var(--panel-accent); border-color: var(--panel-accent); color: var(--panel-ink); box-shadow: 0 8px 20px rgba(255, 138, 61, 0.38); }
.btn--accent:hover { background: #FF9B57; color: var(--panel-ink); transform: translateY(-1px); }
.btn--light { background: rgba(255, 255, 255, 0.95); border-color: transparent; color: var(--color-primary); }
.btn--light:hover { background: #fff; color: var(--panel-brand-deep); transform: translateY(-1px); }

/* ---------- Tarjetas, campos, insignias (FR-P01 y FR-P05) ---------- */
.layout-seller .card, .layout-auth .card { border: 0; border-radius: var(--panel-radius-lg); box-shadow: var(--shadow); background: #fff; }
.layout-seller a.card:hover, .layout-seller a.card:focus-visible { transform: translateY(-2px); box-shadow: var(--panel-shadow-hover); }
.layout-seller .field input:not([type="checkbox"]):not([type="radio"]), .layout-seller .field select, .layout-seller .field textarea,
.layout-auth .field input:not([type="checkbox"]):not([type="radio"]), .layout-auth .field select, .layout-auth .field textarea {
  border-radius: 12px; border-color: #C9D4E0; min-height: 44px; transition: border-color 150ms ease, box-shadow 150ms ease;
}
.layout-seller .field input:focus, .layout-seller .field select:focus, .layout-seller .field textarea:focus,
.layout-auth .field input:focus, .layout-auth .field select:focus, .layout-auth .field textarea:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(11, 92, 173, 0.15); outline: none; }
.layout-seller .badge { border-radius: 999px; padding: 2px 10px; font-weight: 700; }

/* ---------- Avisos y confirmaciones (FR-P10; RP-09) ---------- */
.layout-seller .notice, .layout-auth .notice { border-radius: 12px; border: 0; border-left: 4px solid currentColor; padding: 12px 14px; }
.layout-seller .notice--success::before, .layout-auth .notice--success::before { content: "✓"; margin-right: 8px; font-weight: 800; }
.layout-seller .notice--error::before, .layout-auth .notice--error::before { content: "⨯"; margin-right: 8px; font-weight: 800; }
.layout-seller .field__error:not(:empty)::before, .layout-auth .field__error:not(:empty)::before, .layout-auth .form__error:not(:empty)::before { content: "⚠ "; }
.layout-seller .saved-flash { background: var(--color-success); color: #fff; }
.layout-seller .saved-flash::before { content: "✓ "; font-weight: 800; }

/* ---------- Encabezado y navegación (FR-P02 y FR-P03; RP-02) ---------- */
.layout-seller .app-header { position: sticky; top: 0; z-index: 60; background: rgba(255, 255, 255, 0.92); backdrop-filter: saturate(160%) blur(8px); -webkit-backdrop-filter: saturate(160%) blur(8px); border-bottom: 1px solid rgba(20, 32, 46, 0.06); transition: box-shadow 200ms ease; }
.layout-seller .app-header.is-scrolled { box-shadow: 0 4px 16px rgba(20, 32, 46, 0.08); }
.layout-seller .brand, .layout-auth .brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--panel-ink); text-decoration: none; letter-spacing: -0.01em; }
.brand__mark { width: 28px; height: 28px; color: var(--color-primary); }
.layout-seller .nav a { border-radius: 999px; padding: 6px 12px; font-weight: 600; color: #3B4A5C; }
.layout-seller .nav a:hover { background: var(--panel-soft); color: var(--color-primary); }
.layout-seller .nav a[aria-current="page"] { background: var(--panel-soft); color: var(--color-primary); font-weight: 800; }
.layout-seller .badge--count { background: var(--panel-accent); color: var(--panel-ink); }
@media (max-width: 767.98px) {
  .layout-seller .bottom-nav a[aria-current="page"] svg { background: var(--panel-soft); border-radius: 999px; padding: 2px 10px; box-sizing: content-box; color: var(--color-primary); }
  .layout-seller .bottom-nav a[aria-current="page"], .layout-seller .bottom-nav [aria-current="page"] { color: var(--color-primary); font-weight: 800; }
}

/* ---------- Encabezados de página (FR-P06) ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head__lead { margin: 4px 0 0; color: #4A5868; }

/* ---------- Inicio del panel (FR-P07; RP-03) ---------- */
.panel-hero {
  position: relative; overflow: hidden; margin: 8px 0 24px; padding: 28px 24px; border-radius: 20px; color: #fff;
  background: linear-gradient(135deg, var(--panel-brand-deep), var(--color-primary) 65%, #1673C9);
}
.panel-hero::before, .panel-hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.panel-hero::before { width: 300px; height: 300px; right: -90px; top: -110px; background: radial-gradient(circle, rgba(255, 138, 61, 0.5), rgba(255, 138, 61, 0) 70%); }
.panel-hero::after { width: 260px; height: 260px; left: -110px; bottom: -150px; background: radial-gradient(circle, rgba(120, 190, 255, 0.4), rgba(120, 190, 255, 0) 70%); }
.panel-hero > * { position: relative; }
.panel-hero__greeting { margin: 0; font-weight: 600; opacity: 0.9; }
.panel-hero h1 { margin: 2px 0 6px; color: #fff; overflow-wrap: anywhere; }
.panel-hero__lead { margin: 0; opacity: 0.92; }
.panel-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
@media (min-width: 768px) { .panel-hero { padding: 36px 40px; } }
.layout-seller .stat-grid { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 24px; }
@media (min-width: 640px) { .layout-seller .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat-card { display: grid; gap: 4px; padding: 18px 20px; border-radius: var(--panel-radius-lg); background: #fff; box-shadow: var(--shadow); color: var(--panel-ink); text-decoration: none; transition: transform 150ms ease, box-shadow 150ms ease; }
.stat-card:hover, .stat-card:focus-visible { transform: translateY(-2px); box-shadow: var(--panel-shadow-hover); color: var(--panel-ink); }
.stat-card__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--panel-soft); color: var(--color-primary); margin-bottom: 6px; }
.stat-card__icon svg { width: 24px; height: 24px; }
.stat-card--accent .stat-card__icon { background: #FFE9DA; color: #B4520F; }
.stat-card .stat__value { font-size: 2.25rem; font-weight: 800; line-height: 1.05; overflow-wrap: anywhere; }
.stat-card .stat__label { color: #4A5868; font-weight: 600; }
.stat-card__more { margin-top: 6px; color: var(--color-primary); font-weight: 700; font-size: 0.875rem; }

/* ---------- Estado vacío (FR-P08; RP-05) ---------- */
.empty-state { display: grid; justify-items: center; gap: 10px; padding: 32px 20px; text-align: center; border-radius: var(--panel-radius-lg); background: #fff; box-shadow: var(--shadow); }
.empty-state[hidden] { display: none; }
.empty-state__art { width: 140px; height: 105px; }
.empty-state__title { margin: 4px 0 0; font-size: 1.25rem; font-weight: 800; color: var(--panel-ink); }
.empty-state__text { margin: 0; max-width: 44ch; color: #4A5868; }
.empty-state .btn { margin-top: 6px; }

/* ---------- Celebración (FR-P09; RP-06) ---------- */
.celebration {
  position: fixed; z-index: 120; left: 50%; bottom: calc(24px + var(--nav-h, 0px) + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  display: grid; grid-template-columns: 56px 1fr; gap: 6px 14px; align-items: center; width: min(420px, calc(100vw - 32px));
  padding: 16px 18px; border-radius: var(--panel-radius-lg); background: #fff; box-shadow: 0 20px 50px rgba(8, 63, 120, 0.25); animation: celebrate-in 300ms ease;
}
.celebration__art { grid-row: span 2; width: 56px; height: 42px; }
.celebration__title { font-size: 1.0625rem; font-weight: 800; }
.celebration__text { margin: 0; color: #4A5868; }
.celebration__actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.celebration__bit { position: fixed; z-index: 121; left: 50%; bottom: 120px; width: 7px; height: 11px; border-radius: 2px; background: var(--c); opacity: 0; pointer-events: none; animation: celebrate-bit 1.2s ease-out var(--delay, 0ms) forwards; }
@keyframes celebrate-in { from { transform: translate(-50%, 16px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes celebrate-bit { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; } }
@media (max-width: 767.98px) { .celebration { --nav-h: 64px; } }
.share-sheet__celebrate { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.share-sheet__celebrate svg { width: 56px; height: 42px; flex: 0 0 56px; }
.share-sheet__celebrate strong { font-size: 1.125rem; }

/* ---------- Esqueletos (FR-P11; RP-07) ---------- */
.skeleton, .skeleton-row > span { background: linear-gradient(90deg, #E8EEF5 0%, #F4F7FB 50%, #E8EEF5 100%); background-size: 200% 100%; animation: skeleton-shine 1.2s linear infinite; border-radius: 8px; }
.skeleton-row { display: grid; grid-template-columns: 56px 1fr 96px; gap: 12px; align-items: center; padding: 10px 4px; list-style: none; }
.skeleton-row > span:nth-child(1) { height: 56px; border-radius: 12px; }
.skeleton-row > span:nth-child(2) { height: 14px; }
.skeleton-row > span:nth-child(3) { height: 36px; border-radius: 999px; }
@keyframes skeleton-shine { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Acceso (FR-P12 y FR-P13; RP-08) ---------- */
.layout-auth { min-height: 100dvh; }
.auth-shell { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.auth-brand {
  position: relative; overflow: hidden; padding: 18px 20px; color: #fff;
  background: linear-gradient(135deg, var(--panel-brand-deep), var(--color-primary) 65%, #1673C9);
}
.auth-brand::before { content: ""; position: absolute; width: 320px; height: 320px; right: -120px; top: -140px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 138, 61, 0.5), rgba(255, 138, 61, 0) 70%); pointer-events: none; }
.auth-brand > * { position: relative; }
.auth-brand .brand { color: #fff; }
.auth-brand .brand__mark { color: var(--panel-accent); }
.auth-brand__title { margin: 8px 0 0; font-size: 1.375rem; font-weight: 800; line-height: 1.2; color: #fff; }
.auth-brand__text, .auth-brand__list, .auth-brand__art { display: none; }
.auth-panel { display: grid; align-content: start; justify-items: center; padding: 24px 16px 40px; }
.auth-panel > * { width: 100%; max-width: 440px; }
.layout-auth .auth-card { padding: 24px; }
.auth-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; background: var(--panel-soft); color: var(--panel-brand-deep); font-weight: 600; font-size: 0.9375rem; }
@media (min-width: 900px) {
  .auth-shell { grid-template-rows: none; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); }
  .auth-brand { display: grid; align-content: center; gap: 14px; padding: 56px 48px; }
  .auth-brand__title { font-size: 2.5rem; letter-spacing: -0.02em; max-width: 14ch; }
  .auth-brand__text { display: block; margin: 0; max-width: 40ch; opacity: 0.92; font-size: 1.0625rem; }
  .auth-brand__list { display: grid; gap: 10px; margin: 8px 0 0; padding: 0; list-style: none; }
  .auth-brand__list li { display: flex; align-items: center; gap: 10px; }
  .auth-brand__list svg { width: 22px; height: 22px; color: var(--panel-accent); flex: 0 0 22px; }
  .auth-brand__art { display: block; width: 220px; height: 165px; margin-top: 12px; }
  .auth-panel { align-content: center; padding: 48px 24px; }
}

/* ---------- Movimiento reducido (FR-P16) ---------- */
@media (prefers-reduced-motion: reduce) {
  .layout-seller *, .layout-auth * { transition: none !important; }
  .celebration { animation: none; }
  .celebration__bit { display: none; }
  .skeleton, .skeleton-row > span { animation: none; }
}
.skeleton-list { margin: 0; padding: 0; }
.card .empty-state { box-shadow: none; background: var(--panel-soft); }

/* ------------------------------------------------------------------ Spec 008 (FR-L01 a FR-L03; RL-01)
   Vista previa de "Mi tienda": barra fija con "Cerrar" siempre visible y panel lateral por encima
   del encabezado del panel (z-index 60). */
.preview-dialog__head { position: sticky; top: 0; z-index: 1; background: var(--color-bg); min-height: 56px; }
.preview-dialog__close { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; }
.preview-dialog__close svg { width: 18px; height: 18px; flex: none; }
@media (min-width: 1024px) {
  .preview-dialog { z-index: 110; top: 0; height: 100vh; max-height: 100vh; box-shadow: -12px 0 32px rgba(20, 32, 46, 0.18); }
}

/* ------------------------------------------------------------------ Spec 008 (FR-L05 a FR-L17; RL-04)
   Zona de carga con edición en el mismo lugar. El estado vive en data-state. */
.image-zone { display: grid; gap: var(--space-2); }
.image-zone__drop {
  display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 160px; padding: var(--space-4);
  border: 2px dashed #B9CBE0; border-radius: 16px; background: #F7FAFE; color: #14202E; text-align: center; cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.image-zone__drop:hover { border-color: #0B5CAD; background: #EEF4FB; }
.image-zone__file:focus-visible + .image-zone__drop { outline: 3px solid #0B5CAD; outline-offset: 3px; }
.image-zone__icon { width: 40px; height: 40px; color: #0B5CAD; }
.image-zone__prompt { font-size: var(--text-md, 1rem); }
.image-zone__drop-text { display: none; font-weight: 700; color: #0B5CAD; }
.image-zone[data-state="dragging"] .image-zone__drop { border-color: #0B5CAD; border-style: solid; background: #E3EEFA; }
.image-zone[data-state="dragging"] .image-zone__prompt { display: none; }
.image-zone[data-state="dragging"] .image-zone__drop-text { display: block; }
.image-zone[data-state="editing"] .image-zone__drop,
.image-zone[data-state="uploading"] .image-zone__drop { display: none; }
.image-zone[data-state="empty"] > .image-zone__editor,
.image-zone[data-state="dragging"] > .image-zone__editor,
.image-zone[data-state="error"] > .image-zone__editor { display: none; }
.image-zone__editor { display: grid; gap: var(--space-3); padding: var(--space-3); border: 1px solid #DCE7F4; border-radius: 16px; background: #fff; }
.image-zone__help { margin: 0; }
.image-zone__work { display: grid; gap: var(--space-3); justify-items: center; }
.image-zone__stage { display: grid; gap: var(--space-2); justify-items: center; width: 100%; }
.image-zone__canvas { width: min(100%, 360px); aspect-ratio: 1 / 1; display: block; border-radius: 12px; background: #1B2430; cursor: grab; touch-action: none; }
.image-zone__canvas:active { cursor: grabbing; }
.image-zone__canvas:focus-visible { outline: 3px solid #0B5CAD; outline-offset: 3px; }
.image-zone__zoom { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-2); width: min(100%, 420px); }
.image-zone__zoom input[type="range"] { flex: 1 1 140px; min-width: 0; min-height: 44px; }
.image-zone__pct { min-width: 3.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.image-zone__warn { width: min(100%, 420px); margin: 0; }
.image-zone__preview { display: flex; align-items: center; gap: var(--space-2); margin: 0; max-width: 100%; }
.image-zone__preview canvas { width: 72px; height: 72px; flex: none; border-radius: 10px; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); }
.image-zone__preview--logo canvas { border-radius: 16px; }
.image-zone__warn[hidden], .image-zone [hidden] { display: none !important; }
.image-zone__preview figcaption { display: grid; gap: 2px; min-width: 0; font-size: 0.875rem; overflow-wrap: anywhere; }
.image-zone__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.image-zone__actions .btn { min-height: 44px; }
.image-zone__progress { flex: 1 1 100%; width: 100%; height: 6px; }
.image-zone__error:empty { display: none; }
@media (min-width: 768px) {
  .image-zone__work { grid-template-columns: minmax(0, 1fr) 200px; align-items: start; justify-items: stretch; }
  .image-zone__preview { flex-direction: column; align-items: flex-start; }
  .image-zone__preview canvas { width: 160px; height: 160px; }
}
/* "Editar encuadre" en el lugar de la foto (FR-L13): la foto ocupa la fila completa mientras se edita. */
.photos__item.is-editing { grid-column: 1 / -1; }
.photos__item.is-editing > img, .photos__item.is-editing > .photos__actions { display: none; }
.image-zone--inline { width: 100%; }
@media (prefers-reduced-motion: reduce) { .image-zone__drop { transition: none; } }

/* Spec 008: la zona de carga del logo ocupa el espacio disponible junto a la vista actual. */
.logo-row__zone { flex: 1 1 280px; min-width: 0; }
.logo-row__zone .field__label { margin: 0 0 var(--space-1); font-weight: 600; }
