/* ==========================================================
   Ganado de Panamá — Design system PREMIUM
   Paleta de marca: café oscuro · negro cálido · café cuero
   beige arena · dorado mostaza · crema
   (Los nombres pine/emerald se conservan por compatibilidad)
   Tipografía bancaria: Plus Jakarta Sans + Inter
   ========================================================== */
:root {
  /* Cafés profundos (superficies serias / marca) */
  --pine-950: #211d19;
  --pine-900: #2a1e16;
  --pine-800: #39251b;
  --pine-700: #4b3325;

  /* Neutros cálidos */
  --graphite-900: #211d19;
  --graphite-700: #4a3f36;
  --stone-500: #7a6c5e;
  --stone-300: #cfc3b0;
  --line: #e6dac4;
  --ivory: #faf5ec;
  --surface: #ffffff;
  --surface-alt: #f3e8d3;

  /* Tierra (calidez) */
  --sand: #f3e8d3;
  --clay: #c9ac80;
  --clay-soft: #f6eedf;

  /* Acento café cuero / arena (nombres heredados) */
  --emerald-700: #7a4e2d;
  --emerald-600: #936039;
  --emerald-500: #c9ac80;
  --emerald-soft: #f5ebda;

  /* Dorados */
  --gold: #c9ac80;
  --gold-dark: #b08f5e;
  --amber: #e9b83d;

  /* Estados */
  --danger: #a23a2e;
  --ok: #1f7a57;
  --warn: #9a6b1e;

  /* Radios (sobrios) */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  /* Sombras (sutiles) */
  --shadow-sm: 0 1px 2px rgba(33,29,25,.05), 0 2px 8px rgba(33,29,25,.04);
  --shadow: 0 8px 24px rgba(33,29,25,.08);
  --shadow-lg: 0 20px 48px rgba(33,29,25,.16);

  /* Transiciones */
  --t-fast: .15s ease;
  --t: .22s ease;

  /* Tipografía */
  --font-display: 'Plus Jakarta Sans', 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* --- Alias de compatibilidad (nombres antiguos → nuevos tokens) --- */
  --forest-900: var(--pine-950);
  --forest-800: var(--pine-900);
  --forest-700: var(--pine-800);
  --forest-600: var(--pine-700);
  --moss: var(--emerald-500);
  --sage: var(--emerald-soft);
  --copper: var(--emerald-600);
  --copper-dark: var(--emerald-700);
  --copper-soft: var(--emerald-soft);
  --ink: var(--graphite-900);
  --muted: var(--stone-500);
  --white: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--graphite-900);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--emerald-700); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--emerald-600); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; color: var(--graphite-900); margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 4vw, 3.1rem); font-weight: 800; letter-spacing: -.022em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; letter-spacing: -.016em; }
h3 { font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; }
h4 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 1em; }
.muted { color: var(--stone-500); }
.container { width: min(var(--content-max, 1200px), 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); margin-inline: auto; }
.section { padding: 56px 0; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.right { margin-left: auto; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; font-weight: 700; color: var(--emerald-700); }
.hidden { display: none !important; }

/* ---------- Layout de 3 columnas (publicidad lateral) ---------- */
.page-shell { display: block; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(243,232,211,.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(57,37,27,.12);
  box-shadow: 0 2px 12px rgba(33,29,25,.06);
}
.site-header .inner { --content-max: 1440px; display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ivory); font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; }
.brand:hover { color: var(--white); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--emerald-600);
  display: grid; place-items: center; color: var(--ivory); font-weight: 800; font-size: 1.05rem;
}
.brand-logo { height: 50px; width: auto; display: block; box-sizing: border-box; padding: 6px 12px; background: var(--sand); border-radius: 10px; box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 2px 8px rgba(0,0,0,.25); }
/* En el header crema el logo va directo, sin placa (la placa queda para el footer oscuro) */
.site-header .brand-logo { padding: 4px 0; background: none; box-shadow: none; border-radius: 0; }

/* Header en dashboard (Panel/Admin): full-width, logo pegado a la izquierda */
@media (min-width: 1101px) {
  .header-dash .inner { width: 100%; max-width: none; margin: 0; padding: 0 24px 0 0; }
  .header-dash .brand { width: 260px; padding-left: 24px; flex: none; box-sizing: border-box; }
}
.main-nav { display: flex; gap: 2px; flex: 1; }
.main-nav a { color: var(--graphite-700); padding: 8px 14px; border-radius: var(--radius-pill); font-size: .92rem; font-weight: 500; transition: var(--t); }
.main-nav a:hover { color: var(--pine-800); background: rgba(57,37,27,.07); }
.main-nav a.active { color: var(--pine-800); font-weight: 600; background: rgba(57,37,27,.08); box-shadow: inset 0 -2px 0 var(--emerald-600); }
.nav-salir-movil { display: none; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; color: var(--graphite-900); font-size: .9rem; font-weight: 500; }
.user-chip:hover { color: var(--emerald-700); }
/* Botones del header sobre fondo crema */
.site-header .btn-ghost { background: transparent; color: var(--pine-800); border-color: rgba(57,37,27,.28); }
.site-header .btn-ghost:hover { background: rgba(57,37,27,.07); color: var(--pine-800); }
.site-header .btn-gold { background: var(--pine-800); color: var(--ivory); }
.site-header .btn-gold:hover { background: var(--pine-700); color: var(--white); }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--emerald-600); color: var(--ivory); display: grid; place-items: center; font-weight: 700; flex: none; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.4rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  font: 600 .93rem var(--font-body); cursor: pointer; transition: var(--t); text-align: center; line-height: 1.2;
}
.btn-primary { background: var(--pine-800); color: var(--ivory); }
.btn-primary:hover { background: var(--pine-700); color: var(--white); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-gold { background: var(--gold); color: var(--graphite-900); }
.btn-gold:hover { background: var(--gold-dark); color: var(--graphite-900); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-outline { background: transparent; border-color: var(--pine-700); color: var(--pine-800); }
.btn-outline:hover { background: var(--pine-800); color: var(--ivory); }
.btn-ghost { background: rgba(255,255,255,.08); color: var(--ivory); border-color: rgba(255,255,255,.2); }
.btn-ghost:hover { background: rgba(255,255,255,.15); color: var(--white); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: var(--white); }
.btn-sm { padding: 7px 16px; font-size: .84rem; border-radius: var(--radius-pill); }
.btn-lg { padding: 15px 32px; font-size: 1.02rem; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: var(--ivory); overflow: hidden;
  background:
    linear-gradient(105deg, rgba(33,29,25,.95) 8%, rgba(33,29,25,.74) 48%, rgba(33,29,25,.32) 100%),
    var(--hero-img, none) center/cover no-repeat, var(--pine-900);
}
.hero .container { padding: 110px 0 120px; max-width: 1200px; }
.hero h1 { color: var(--white); max-width: 16ch; font-size: clamp(2.4rem, 5.6vw, 4.2rem); font-weight: 800; letter-spacing: -.025em; }
.hero h1 em { font-style: normal; color: var(--emerald-500); }
.hero p.lead { max-width: 52ch; font-size: 1.15rem; color: rgba(250,245,236,.82); }
/* Botones del banner siempre del mismo ancho (el del más largo); en móvil angosto se apilan a todo el ancho */
.hero .actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: fit-content; max-width: 100%; gap: 14px; margin-top: 28px; }
@media (max-width: 520px) { .hero .actions { grid-auto-flow: row; width: 100%; } }
.hero-stats { display: flex; gap: 40px; margin-top: 56px; flex-wrap: wrap; }
.hero-stats b { display: block; font: 700 2rem var(--font-display); color: var(--emerald-500); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.hero-stats span { font-size: .85rem; color: rgba(250,245,236,.7); }
.hero-stat-ig { display: block; padding-left: 40px; border-left: 1px solid rgba(250,245,236,.18); transition: var(--t); }
.hero-stat-ig b { display: flex; align-items: center; gap: 10px; }
.hero-stat-ig svg { width: 26px; height: 26px; transition: var(--t); }
.hero-stat-ig span { text-decoration: underline; text-decoration-color: rgba(250,245,236,.3); text-underline-offset: 3px; }
.hero-stat-ig:hover b { color: var(--amber); }
.hero-stat-ig:hover svg { transform: scale(1.12) rotate(-6deg); }
.hero-stat-ig:hover span { color: var(--ivory); text-decoration-color: var(--amber); }
@media (max-width: 640px) { .hero-stat-ig { padding-left: 0; border-left: 0; } }

/* ---------- Buscador global (hero del inicio y página de resultados) ---------- */
.searchbox { position: relative; z-index: 5; max-width: 780px; margin: 26px 0 14px; }
.searchbox-form { display: flex; align-items: center; gap: 12px; background: var(--white); border-radius: 18px; padding: 8px 8px 8px 20px; box-shadow: 0 14px 40px rgba(0,0,0,.3); transition: box-shadow .2s; }
.searchbox-form:focus-within { box-shadow: 0 0 0 4px rgba(201,172,128,.5), 0 14px 40px rgba(0,0,0,.3); }
.searchbox-ico { width: 26px; height: 26px; flex: none; color: var(--emerald-600); }
.searchbox-form input[type=search] { flex: 1; min-width: 0; border: 0; background: transparent; box-shadow: none; outline: none; -webkit-appearance: none; appearance: none; font: 500 1.12rem var(--font-body); color: var(--graphite-900); padding: 14px 4px; }
.searchbox-form input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
.searchbox-form .btn { flex: none; padding: 14px 28px; border-radius: 12px; font-size: 1rem; }
.searchbox-panel { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: var(--white); color: var(--graphite-900); border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.4); max-height: min(70vh, 460px); overflow-y: auto; padding: 8px; text-align: left; }
.searchbox-panel[hidden] { display: none; }
.sb-group { font: 700 .7rem var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--emerald-700); padding: 10px 12px 4px; }
.sb-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; color: inherit; }
.sb-item:hover, .sb-item.is-active { background: var(--emerald-soft); }
.sb-thumb { flex: none; width: 48px; height: 48px; border-radius: 10px; background: var(--surface-alt) center/cover no-repeat; }
.sb-text { min-width: 0; display: flex; flex-direction: column; }
.sb-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-detail { font-size: .82rem; color: var(--stone-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-all { display: block; text-align: center; padding: 12px; margin-top: 4px; border-top: 1px solid var(--line); font-weight: 600; color: var(--emerald-700); border-radius: 0 0 12px 12px; }
.sb-all:hover, .sb-all.is-active { background: var(--emerald-soft); }
.sb-empty { padding: 18px 14px; color: var(--stone-500); }
.searchbox-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; max-width: 780px; font-size: .86rem; color: rgba(250,245,236,.7); }
.searchbox-chips a { color: var(--ivory); border: 1px solid rgba(255,255,255,.28); border-radius: 999px; padding: 4px 13px; font-weight: 500; transition: var(--t); }
.searchbox-chips a:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.5); }
@media (max-width: 640px) {
  .searchbox-form { padding-left: 14px; gap: 8px; }
  .searchbox-ico { width: 22px; height: 22px; }
  .searchbox-form input[type=search] { font-size: 1rem; }
  .searchbox-form .btn { padding: 12px 16px; }
}

/* ---------- Secciones y encabezados ---------- */
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.page-head { background: linear-gradient(180deg, var(--pine-900), var(--pine-800)); color: var(--ivory); padding: 48px 0 44px; }
.page-head h1 { color: var(--white); margin-bottom: .2em; }
.page-head p { color: rgba(250,245,236,.75); margin: 0; max-width: 62ch; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); }
.feature .ico { width: 46px; height: 46px; border-radius: 12px; background: var(--emerald-soft); color: var(--emerald-700); display: grid; place-items: center; font-size: 1.3rem; margin-bottom: 14px; }
.feature h3 { font-size: 1.12rem; }
.feature p { color: var(--stone-500); font-size: .94rem; margin: 0; }

/* ---------- Tarjetas ---------- */
.grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: var(--t); display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #dccbae; }
.card-img { position: relative; aspect-ratio: 4 / 3; background: var(--sand); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .card-img img { transform: scale(1.04); }
.card-img .badge { position: absolute; top: 12px; left: 12px; }
.card-img .badge.pago { top: auto; bottom: 12px; max-width: calc(100% - 24px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h3 { font-size: 1.1rem; margin: 0; }
.card-meta { font-size: .85rem; color: var(--stone-500); display: flex; gap: 12px; flex-wrap: wrap; }
.card-price { font: 700 1.4rem var(--font-display); color: var(--emerald-700); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.card-price small { font: 500 .8rem var(--font-body); color: var(--stone-500); }
.card-foot { margin-top: auto; padding-top: 12px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.card-seller { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--stone-500); }
.card-seller .avatar { width: 24px; height: 24px; font-size: .7rem; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--stone-500); font-size: .92rem; }

.card-agro .cover { height: 110px; background: var(--pine-800) center/cover; }
.card-agro .logo { width: 84px; height: 84px; border-radius: 18px; border: 4px solid var(--surface); object-fit: cover; margin: -42px 0 0 20px; background: var(--sand); box-shadow: var(--shadow-sm); position: relative; }
.card-agro .card-body { padding-top: 10px; }

.badge { display: inline-block; padding: 4px 12px; border-radius: var(--radius-pill); font-size: .74rem; font-weight: 600; background: var(--surface-alt); color: var(--graphite-700); }
.badge.gold { background: var(--emerald-soft); color: var(--emerald-700); }
.badge.dark { background: var(--pine-900); color: var(--ivory); }
.badge.ok { background: #dcefe4; color: var(--ok); }
.badge.warn { background: #f6ead0; color: var(--warn); }
.badge.danger { background: #f5dcd7; color: var(--danger); }
.badge.muted { background: var(--surface-alt); color: var(--stone-500); }

/* ---------- Filtros ---------- */
.filters { display: flex; gap: 12px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 28px; box-shadow: var(--shadow-sm); }
.filters input, .filters select { flex: 1 1 180px; }
.filters input.filter-ha { flex: 0 1 120px; min-width: 100px; }

/* ---------- Formularios ---------- */
label { display: block; font-size: .85rem; font-weight: 600; color: var(--graphite-700); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=tel], input[type=date], select, textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); font: 400 .97rem var(--font-body); color: var(--graphite-900); transition: var(--t-fast);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--emerald-600); box-shadow: 0 0 0 3px var(--emerald-soft); }
textarea { min-height: 130px; resize: vertical; }
.field { margin-bottom: 18px; }
.field .hint { font-size: .8rem; color: var(--stone-500); margin-top: 4px; }
.field-validation-error, .text-danger { color: var(--danger); font-size: .82rem; display: block; margin-top: 4px; }
.validation-summary-errors ul { margin: 0 0 16px; padding: 12px 18px 12px 34px; background: #f5dcd7; border-radius: var(--radius-sm); color: var(--danger); font-size: .9rem; }
.validation-summary-valid { display: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid .full { grid-column: 1 / -1; }
.panel-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); }
.panel-box + .panel-box { margin-top: 20px; }
.prefix-input { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.prefix-input span { padding: 0 12px; color: var(--stone-500); font-size: .9rem; background: var(--surface-alt); align-self: stretch; display: grid; place-items: center; }
.prefix-input input { border: 0; border-radius: 0; box-shadow: none !important; }

/* Toggle / switch de campo booleano */
.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--graphite-700); cursor: pointer; margin: 0; }
.switch input { width: auto; margin: 0; accent-color: var(--emerald-600); transform: scale(1.15); }

/* Formulario de publicidad (2 columnas: datos | imagen) */
.ad-form-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.ad-form-aside .panel-box { position: sticky; top: 92px; }
.ad-preview { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-alt); overflow: hidden; margin-bottom: 16px; display: grid; place-items: center; min-height: 160px; }
.ad-preview img { width: 100%; height: auto; display: block; }
.ad-preview-empty { color: var(--stone-500); font-size: .9rem; padding: 40px 0; }
@media (max-width: 860px) { .ad-form-grid { grid-template-columns: 1fr; } .ad-form-aside .panel-box { position: static; } }

/* selector de imágenes */
.img-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.img-slot { border: 2px dashed var(--line); border-radius: var(--radius-sm); padding: 10px; background: var(--ivory); text-align: center; font-size: .8rem; position: relative; }
.img-slot.main { border-color: var(--emerald-600); background: var(--emerald-soft); }
.img-slot .tag { display: block; font-weight: 700; color: var(--emerald-700); margin-bottom: 6px; }
.img-slot:not(.main) .tag { color: var(--stone-500); }
.img-slot .preview { aspect-ratio: 1; background: var(--surface) center/cover no-repeat; border-radius: 8px; margin-bottom: 8px; border: 1px solid var(--line); }
.img-slot input[type=file] { width: 100%; font-size: .75rem; }
.img-slot label.chk { display: flex; gap: 6px; align-items: center; justify-content: center; font-weight: 500; margin: 6px 0 0; }

/* ---------- Detalle ---------- */
.detail { display: grid; grid-template-columns: 1.15fr 1fr; gap: 44px; align-items: start; }
.gallery .main-img { position: relative; aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; background: var(--sand); box-shadow: var(--shadow); }
.gallery .main-img img { width: 100%; height: 100%; object-fit: cover; }
.gallery .main-img.zoomable { cursor: zoom-in; }
.gallery .main-img .zoom-hint {
  position: absolute; bottom: 12px; right: 12px; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(33,29,25,.55); color: #fff; display: grid; place-items: center; font-size: 1rem;
  opacity: 0; transition: var(--t); pointer-events: none;
}
.gallery .main-img.zoomable:hover .zoom-hint { opacity: 1; }

/* Lightbox / visor a pantalla completa */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(24,20,17,.92); display: none; align-items: center; justify-content: center; padding: 40px; }
.lightbox.open { display: flex; animation: adFade .2s; }
.lb-stage { margin: 0; max-width: 92vw; max-height: 88vh; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lb-stage img { max-width: 92vw; max-height: 82vh; width: auto; height: auto; object-fit: contain; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lb-counter { color: rgba(255,255,255,.8); font-size: .9rem; font-variant-numeric: tabular-nums; }
.lb-close, .lb-nav {
  position: absolute; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); color: #fff;
  cursor: pointer; display: grid; place-items: center; transition: var(--t); backdrop-filter: blur(4px);
}
.lb-close { top: 20px; right: 20px; width: 46px; height: 46px; border-radius: 50%; font-size: 1.2rem; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 54px; height: 54px; border-radius: 50%; font-size: 2rem; line-height: 1; }
.lb-prev { left: 24px; }
.lb-next { right: 24px; }
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,.24); }
@media (max-width: 640px) {
  .lightbox { padding: 16px; }
  .lb-nav { width: 44px; height: 44px; font-size: 1.6rem; }
  .lb-prev { left: 8px; } .lb-next { right: 8px; }
  .lb-close { top: 12px; right: 12px; }
}
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 12px; }
.thumbs button { padding: 0; border: 2px solid transparent; border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; aspect-ratio: 4/3; background: var(--sand); opacity: .72; transition: var(--t); }
.thumbs button.on, .thumbs button:hover { border-color: var(--emerald-600); opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.price-big { font: 700 2.5rem var(--font-display); color: var(--emerald-700); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.spec { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0; }
.spec div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; }
.spec small { display: block; color: var(--stone-500); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; }
.spec b { font-weight: 600; }

/* Organización del detalle: descripción, referencia, stock y metadatos con íconos */
.detail h1 { font-size: clamp(1.4rem, 2.2vw, 1.9rem); line-height: 1.2; letter-spacing: -.015em; }
.detail-desc { margin: 18px 0 0; color: var(--stone-500); font-size: .97rem; line-height: 1.7; white-space: pre-line; }
.detail-ref { margin: 16px 0 0; color: var(--stone-500); font-size: .78rem; letter-spacing: .1em; }
.detail-stock { margin: 14px 0 0; }
.detail-stock .stock-ok { color: var(--ok); font-weight: 600; font-size: .92rem; }
.detail-stock .stock-off { color: var(--warn); font-weight: 600; font-size: .92rem; }
.detail-meta { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.detail-meta li { display: inline-flex; align-items: center; gap: 7px; color: var(--stone-500); font-size: .88rem; font-variant-numeric: tabular-nums; }
.detail-meta .ico { font-size: 1rem; line-height: 1; opacity: .85; }
.buy-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); margin-top: 24px; }
.qty { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.qty input { width: 90px; text-align: center; }
.qty input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px #f5dcd7; }
.qty-error { flex-basis: 100%; color: var(--danger); font-size: .85rem; font-weight: 500; }

/* Compra protegida: sello junto al botón y desplegable con el flujo de la compra */
.compra-segura { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; font-size: .85rem; line-height: 1.45; color: var(--graphite-700); }
.compra-segura svg { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--emerald-600); }
.compra-segura b { color: var(--pine-800); }
.pay-dialog .compra-segura { margin: 0 0 16px; }
.flujo-compra { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--clay-soft); }
.flujo-compra summary { cursor: pointer; list-style: none; padding: 14px 18px; font-weight: 600; color: var(--pine-800); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.flujo-compra summary::-webkit-details-marker { display: none; }
.flujo-compra summary::after { content: "+"; font: 600 1.35rem/1 var(--font-body); color: var(--emerald-600); transition: transform var(--t); }
.flujo-compra[open] summary::after { transform: rotate(45deg); }
.flujo-compra > p { margin: 0 18px 4px !important; font-size: .88rem; line-height: 1.5; }
.precauciones-compra { background: #eef7f1; border-color: #cfe6d8; }
.precauciones-compra summary { color: var(--pine-800); }
.flujo-compra summary:focus-visible { outline: 2px solid var(--emerald-600); outline-offset: 2px; border-radius: var(--radius); }
.flujo-pasos { list-style: none; counter-reset: paso; margin: 0; padding: 4px 18px 4px; }
.flujo-pasos li { counter-increment: paso; position: relative; padding: 0 0 18px 42px; }
.flujo-pasos li::before { content: counter(paso); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--emerald-600); color: var(--ivory); display: grid; place-items: center; font: 700 .85rem var(--font-display); }
.flujo-pasos li::after { content: ""; position: absolute; left: 13px; top: 32px; bottom: 4px; width: 2px; background: var(--clay); border-radius: 2px; }
.flujo-pasos li:last-child { padding-bottom: 8px; }
.flujo-pasos li:last-child::after { display: none; }
.flujo-pasos .t { display: block; font-weight: 700; color: var(--graphite-900); font-size: .95rem; padding-top: 3px; }
.flujo-pasos .t + span { display: block; margin-top: 2px; font-size: .87rem; line-height: 1.5; color: var(--graphite-700); }
.flujo-porque { margin: 6px 18px 18px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.flujo-porque h4 { margin: 0 0 10px; font-size: .95rem; }
.flujo-porque ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .87rem; line-height: 1.5; color: var(--graphite-700); }
.flujo-porque li { position: relative; padding-left: 24px; }
.flujo-porque li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--emerald-600); font-weight: 700; }
.flujo-porque b { color: var(--graphite-900); }

/* Modal de condiciones de venta (al crear una publicación) */
.terminos-dialog { border: 0; padding: 0; width: min(680px, calc(100vw - 24px)); max-height: min(92vh, 860px); border-radius: 18px; background: var(--ivory); color: inherit; box-shadow: var(--shadow-lg); overflow: hidden; }
.terminos-dialog[open] { display: flex; flex-direction: column; animation: terminosIn .28s cubic-bezier(.2,.9,.3,1.1); }
.terminos-dialog::backdrop { background: rgba(24,20,17,.62); backdrop-filter: blur(4px); }
@keyframes terminosIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.terminos-head { display: flex; gap: 14px; align-items: flex-start; padding: 22px 24px; background: linear-gradient(135deg, var(--pine-800), var(--pine-950)); color: var(--ivory); flex: none; }
.terminos-head > svg { flex: none; width: 40px; height: 40px; padding: 8px; border-radius: 12px; background: rgba(201,172,128,.18); color: var(--gold); }
.terminos-head h3 { margin: 0 0 4px; color: var(--ivory); font-size: 1.15rem; line-height: 1.3; }
.terminos-head p { margin: 0; font-size: .86rem; color: rgba(250,245,236,.75); }
.terminos-close { flex: none; margin-left: auto; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,255,255,.1); color: var(--ivory); font-size: 1rem; cursor: pointer; transition: var(--t-fast); }
.terminos-close:hover { background: rgba(255,255,255,.2); }
.terminos-body { overflow-y: auto; padding: 22px 24px 8px; }
.terminos-body section { margin-bottom: 22px; }
.terminos-body h4 { margin: 0 0 10px; font-size: 1rem; color: var(--pine-800); }
.terminos-body p { font-size: .92rem; line-height: 1.55; color: var(--graphite-700); }
.terminos-body .flujo-pasos { padding: 4px 0 0; }
.terminos-ejemplo { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.terminos-ejemplo > div { display: flex; flex-direction: column; text-align: center; flex: 1; }
.terminos-ejemplo small { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--stone-500); font-weight: 600; }
.terminos-ejemplo b { font: 700 1.1rem var(--font-display); color: var(--graphite-900); font-variant-numeric: tabular-nums; }
.terminos-ejemplo .recibe b { color: var(--emerald-700); }
.terminos-ejemplo > span { color: var(--clay); font-weight: 700; }
.terminos-edicion { margin: 0; padding: 10px 24px; font-size: .85rem; line-height: 1.5; background: var(--clay-soft); color: var(--graphite-700); flex: none; }
.terminos-edicion[hidden] { display: none; }
.terminos-alerta { display: block; margin-top: 4px; padding: 12px 14px; border-radius: var(--radius-sm); background: #fbf1d6; border: 1px solid #ecd28c; border-left: 4px solid var(--amber); color: var(--graphite-900); font-size: .88rem; line-height: 1.5; }
.terminos-notas { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: .9rem; line-height: 1.5; color: var(--graphite-700); }
.terminos-foot { flex: none; padding: 16px 24px 20px; background: var(--surface); border-top: 1px solid var(--line); }
.terminos-acepto { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; line-height: 1.45; font-weight: 500; color: var(--graphite-900); cursor: pointer; margin-bottom: 14px; }
.terminos-acepto input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--emerald-600); cursor: pointer; }
.terminos-botones { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 640px) {
  .terminos-head { padding: 18px; }
  .terminos-head > svg { display: none; }
  .terminos-body { padding: 18px 18px 4px; }
  .terminos-foot { padding: 14px 18px 18px; }
  .terminos-ejemplo { flex-direction: column; gap: 4px; }
  .terminos-ejemplo > span { transform: rotate(90deg); }
  .terminos-botones .btn { flex: 1; }
}
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.calc { background: var(--ivory); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 16px; font-size: .92rem; }
.calc div { display: flex; justify-content: space-between; padding: 2px 0; }
.calc .total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-weight: 700; color: var(--emerald-700); }
/* Total a la derecha de la cantidad (ahorra la fila y la tarjeta aparte) */
.qty { flex-wrap: wrap; }
.qty .calc { margin: 0 0 0 auto; padding: 0; background: none; text-align: right; }
.qty .calc .total { display: flex; flex-direction: column; align-items: flex-end; border: 0; margin: 0; padding: 0; line-height: 1.2; }
.qty .calc .total span:first-child { font-size: .74rem; font-weight: 600; color: var(--stone-500); text-transform: uppercase; letter-spacing: .06em; }
.qty .calc .total span:last-child { font-size: 1.35rem; }
/* Modal de pago con Yappy (elemento <dialog> nativo) */
.pay-dialog { border: 0; border-radius: var(--radius); padding: 24px; width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow); background: var(--surface); color: inherit; }
.pay-dialog::backdrop { background: rgba(24,20,17,.6); }
.pay-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pay-close { border: 0; background: none; font-size: 1.1rem; cursor: pointer; color: var(--stone-500); padding: 4px 8px; }
.pay-summary { display: flex; flex-direction: column; gap: 2px; background: var(--ivory); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px; font-size: .92rem; }
.pay-summary .pay-total { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--emerald-700); font-weight: 600; }
.pay-summary .pay-total b { font-size: 1.2rem; }
.seller-card { display: flex; gap: 18px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); flex-wrap: wrap; }
.seller-card .info { flex: 1; min-width: 200px; }
.description { white-space: pre-line; }

/* ---------- Suscripción ---------- */
.sub-status { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border-radius: var(--radius); margin: 8px 0 24px; border: 1px solid var(--line); background: var(--surface); }
.sub-status.ok { border-color: #bfe6cf; background: #eef8f2; }
.sub-status.off { border-color: #e6c3be; background: #fbeeec; color: var(--danger); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.plan-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 20px; box-shadow: var(--shadow-sm); text-align: center; }
.plan-card.best { border-color: var(--emerald-600); box-shadow: var(--shadow); }
.plan-tag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--emerald-600); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 12px; border-radius: var(--radius-pill); }
.plan-card { transition: var(--t); }
.plan-card:hover, .plan-card:focus-within { border-color: var(--emerald-600); box-shadow: var(--shadow); transform: translateY(-2px); }
/* La fecha resultante se revela al sombrear el plan; en pantallas táctiles (sin hover) queda siempre visible */
.plan-until { margin: 0 0 14px; font-size: .88rem; color: var(--emerald-700); opacity: 0; transition: var(--t); }
.plan-card:hover .plan-until, .plan-card:focus-within .plan-until { opacity: 1; }
@media (hover: none) { .plan-until { opacity: 1; } }
.plan-price { font: 800 2.2rem var(--font-display); color: var(--pine-800); margin: 6px 0; }

/* ---------- Perfil público ---------- */
.profile-cover { height: 280px; background: var(--pine-900) center/cover; position: relative; }
.profile-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(33,29,25,.6)); }
/* El logo es lo único que se monta sobre la portada; nombre y compartir quedan debajo, sobre fondo claro */
.profile-head { display: flex; gap: 24px; align-items: flex-start; margin-top: -70px; position: relative; z-index: 2; flex-wrap: wrap; }
.profile-logo { width: 140px; height: 140px; border-radius: 26px; border: 6px solid var(--ivory); object-fit: cover; background: var(--sand); box-shadow: var(--shadow); }
.profile-cover.zoomable, .profile-logo.zoomable { cursor: zoom-in; }
.profile-head .txt { flex: 1; min-width: 240px; margin-top: 82px; }
.profile-head .share-box { margin-top: 82px; }
.profile-head .share-block { margin-top: 0; }
.profile-head h1 { margin: 6px 0 4px; font-size: clamp(1.6rem, 2.8vw, 2.2rem); line-height: 1.15; overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 24px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.stat b { display: block; font: 700 1.2rem var(--font-display); color: var(--graphite-900); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat span { font-size: .78rem; color: var(--stone-500); }
/* La publicidad lateral arranca debajo de la portada (72px de header + 280px de portada + margen) */
body:has(.profile-cover) { --ad-side-top: 372px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 28px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 12px 18px; font: 600 .92rem var(--font-body); color: var(--stone-500); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; transition: var(--t-fast); }
.tabs button.on { color: var(--emerald-700); border-color: var(--emerald-600); }
.tab-pane { display: none; }
.tab-pane.on { display: block; }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: .94rem; overflow-wrap: anywhere; }
/* Información del perfil: 2 columnas en escritorio; en móvil hereda la columna única de .detail */
@media (min-width: 961px) { .profile-info { grid-template-columns: 1.4fr 1fr; } }
/* Las cajas van en columnas de la grilla: el margen de apilado (.panel-box + .panel-box) las desalineaba */
.profile-info > .panel-box + .panel-box { margin-top: 0; }
.contact-list .ico-ig { vertical-align: -3px; color: #c13584; }
.stars { color: var(--amber); letter-spacing: 2px; }
.stars .off { color: var(--stone-300); }

/* ---------- Noticias / publicaciones ---------- */
.news-card { display: grid; grid-template-columns: 300px 1fr; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: var(--t); }
.news-card:hover { box-shadow: var(--shadow); }
.news-card .img { background: var(--sand) center/cover; min-height: 200px; }
.news-card .body { padding: 22px 26px; }
.author { display: flex; align-items: center; gap: 10px; font-size: .88rem; }
.author .avatar { width: 36px; height: 36px; }
.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.post .txt { white-space: pre-line; margin: 14px 0; }
.post .post-img { border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 14px; }
.post .post-img img { width: 100%; max-height: 460px; object-fit: cover; }
.comment { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.share { display: flex; gap: 8px; flex-wrap: wrap; }
.share a, .share button { font-size: .8rem; padding: 6px 14px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--ivory); color: var(--pine-800); cursor: pointer; font-weight: 600; font-family: var(--font-body); transition: var(--t-fast); }
.share a:hover, .share button:hover { background: var(--pine-800); color: var(--ivory); border-color: var(--pine-800); }
.share .wa { background: #e0f4e8; border-color: #bfe6cf; color: #1c7a49; }

/* Compartir con íconos circulares */
.share-block { margin-top: 20px; }
.share-label { display: block; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--stone-500); margin-bottom: 10px; }
.share-icons { display: flex; gap: 12px; flex-wrap: wrap; }
.share-ico {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--graphite-700); cursor: pointer;
  display: grid; place-items: center; padding: 0; transition: var(--t);
}
.share-ico svg { width: 19px; height: 19px; display: block; }
.share-ico:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.share-ico.wa:hover { background: #25d366; border-color: #25d366; color: #fff; }
.share-ico.fb:hover { background: #1877f2; border-color: #1877f2; color: #fff; }
.share-ico.tw:hover { background: #0f1419; border-color: #0f1419; color: #fff; }
.share-ico.link:hover { background: var(--emerald-600); border-color: var(--emerald-600); color: #fff; }
.share-ico.copied { background: var(--emerald-600); border-color: var(--emerald-600); color: #fff; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100vh - 72px); display: grid; place-items: center; padding: 40px 16px; background: radial-gradient(1200px 500px at 10% -10%, var(--emerald-soft), transparent), var(--ivory); }
.auth-card { width: min(520px, 100%); background: var(--surface); border-radius: 20px; padding: 40px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.auth-card.wide { width: min(680px, 100%); }
.auth-logo { height: 76px; width: auto; margin: 0 auto 18px; display: block; }
.account-type { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.account-type > div { display: flex; }
.account-type input { position: absolute; opacity: 0; }
.account-type label { flex: 1; display: flex; flex-direction: column; justify-content: center; border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 16px; cursor: pointer; text-align: center; transition: var(--t); margin: 0; }
.account-type label small { display: block; font-weight: 400; color: var(--stone-500); }
.account-type input:checked + label { border-color: var(--emerald-600); background: var(--emerald-soft); }
.code-input { text-align: center; letter-spacing: .6em; font: 700 1.9rem var(--font-body) !important; }

/* ---------- Panel privado / admin ---------- */
/* Panel/Admin: layout full-width, sidebar pegado al borde izquierdo */
.dash-wide { width: 100%; max-width: none; margin: 0; padding: 0; }
.dash { display: grid; grid-template-columns: 260px 1fr; gap: 32px; padding: 36px 0 64px; align-items: start; }
.dash-wide .dash { gap: 0; padding: 0; align-items: stretch; min-height: calc(100vh - 72px); }
.dash-wide .side { border-radius: 0; position: static; top: auto; padding: 24px 14px 40px; }
.dash-wide > .dash > section { padding: 36px 36px 64px; min-width: 0; }
.side { background: var(--pine-900); border-radius: var(--radius); padding: 14px; position: sticky; top: 92px; }
.side h4 { color: rgba(250,245,236,.5); font: 600 .7rem var(--font-body); text-transform: uppercase; letter-spacing: .16em; margin: 16px 12px 6px; }
.side a { display: block; padding: 10px 14px; color: rgba(250,245,236,.82); border-radius: 10px; font-size: .92rem; font-weight: 500; transition: var(--t-fast); }
.side a:hover { background: rgba(255,255,255,.07); color: var(--white); }
.side a.active { background: var(--emerald-600); color: var(--ivory); font-weight: 700; }
.side a .count { float: right; background: rgba(255,255,255,.14); border-radius: var(--radius-pill); padding: 0 8px; font-size: .75rem; }
.side a.active .count { background: rgba(0,0,0,.18); }
.side-toggle-input, .side-toggle { display: none; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; padding: 14px 16px; background: var(--surface-alt); color: var(--graphite-700); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.tbl td { padding: 14px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: #fbf7f0; }
.tbl .thumb { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; background: var(--sand); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { text-align: center; padding: 56px 20px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); color: var(--stone-500); }
.empty h3 { color: var(--emerald-700); }
.op-card { display: grid; grid-template-columns: 96px 1fr auto; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); align-items: center; margin-bottom: 16px; }
.op-card img { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; background: var(--sand); }
.op-card h3 { font-size: 1.1rem; margin: 0 0 4px; }
.op-money { text-align: right; }
.op-money b { font: 700 1.4rem var(--font-display); color: var(--emerald-700); display: block; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.kpi.dark { background: linear-gradient(135deg, var(--pine-900), var(--pine-700)); color: var(--ivory); border: 0; }
.kpi.dark b { color: var(--emerald-500); }
.kpi small { display: block; color: var(--stone-500); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.kpi.dark small { color: rgba(250,245,236,.7); }
.kpi b { font: 700 1.9rem var(--font-display); color: var(--graphite-900); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.payout { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--emerald-600); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 16px; box-shadow: var(--shadow-sm); display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 20px; align-items: center; }
.payout .amounts { display: grid; gap: 4px; font-size: .9rem; }
.payout .amounts div { display: flex; justify-content: space-between; gap: 16px; }
.payout .amounts .pay { font-weight: 700; color: var(--emerald-700); font-size: 1.05rem; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; }
.evidence { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.evidence a { display: block; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.evidence img { width: 100%; height: 100%; object-fit: cover; }
.rating-input { display: flex; gap: 6px; flex-direction: row-reverse; justify-content: flex-end; }
.rating-input input { display: none; }
.rating-input label { font-size: 2rem; color: var(--stone-300); cursor: pointer; margin: 0; transition: var(--t-fast); }
.rating-input input:checked ~ label, .rating-input label:hover, .rating-input label:hover ~ label { color: var(--amber); }

/* ---------- Alertas ---------- */
.flash { padding: 14px 20px; border-radius: var(--radius-sm); margin: 20px 0; font-weight: 500; }
.flash.ok { background: #dcefe4; color: #1f5b3f; border: 1px solid #b4dcc6; }
.flash.error { background: #f5dcd7; color: var(--danger); border: 1px solid #efc6be; }
.flash.info { background: var(--emerald-soft); color: var(--emerald-700); border: 1px solid #e6d3b3; }

/* ---------- Footer ---------- */
.site-footer { background: var(--pine-950); color: rgba(250,245,236,.7); padding: 56px 0 28px; margin-top: 40px; }
.site-footer .container { --content-max: 1200px; }
.site-footer .cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h4 { color: var(--ivory); font: 600 .8rem var(--font-body); text-transform: uppercase; letter-spacing: .14em; }
.site-footer a { color: rgba(250,245,236,.7); display: block; padding: 3px 0; font-size: .92rem; }
.site-footer a:hover { color: var(--emerald-500); }
.site-footer .legal { border-top: 1px solid rgba(255,255,255,.08); margin-top: 36px; padding-top: 20px; font-size: .82rem; }

.pager { display: flex; gap: 8px; justify-content: center; margin-top: 32px; }
.pager a, .pager span { padding: 8px 16px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface); font-size: .9rem; }
.pager span { background: var(--emerald-600); color: var(--ivory); border-color: var(--emerald-600); }

/* ---------- Skeleton / estados de carga ---------- */
.skeleton { position: relative; overflow: hidden; background: var(--surface-alt); border-radius: var(--radius-sm); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent); animation: skeleton 1.4s infinite; }
@keyframes skeleton { 100% { transform: translateX(100%); } }

/* ==========================================================
   Carousel de items relacionados (deslizante)
   ========================================================== */
.related { margin-top: 8px; }
.carousel-nav { display: flex; gap: 8px; }
.carousel-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--pine-800); font-size: 1.4rem; line-height: 1;
  cursor: pointer; display: grid; place-items: center; transition: var(--t-fast);
}
.carousel-btn:hover { background: var(--pine-800); color: var(--ivory); border-color: var(--pine-800); }
.carousel-btn:disabled { opacity: .35; cursor: default; background: var(--surface); color: var(--pine-800); }
.carousel-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr);
  gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 4px 2px 8px; scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-item { scroll-snap-align: start; display: flex; }
/* Todas las tarjetas del carrusel con la misma altura (la de la más alta); el pie queda alineado abajo */
.carousel-item > .card { flex: 1; min-width: 0; }
.head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* Si los botones no caben y saltan de línea (móvil), cada uno ocupa el ancho completo: quedan del mismo tamaño */
.head-actions > .btn { flex: 1 1 auto; }
.trust-note { margin: 24px 0 0; text-align: center; color: var(--pine-800); }
@media (min-width: 720px) { .carousel-track { grid-auto-columns: minmax(280px, calc(33.333% - 14px)); } }
@media (min-width: 1100px) { .carousel-track { grid-auto-columns: minmax(280px, calc(25% - 15px)); } }

/* ==========================================================
   Publicidad — layout premium (vertical | contenido | vertical)
   ========================================================== */
.ad-carousel-wrap { margin-top: 16px; }
.ad-rotator { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--surface-alt); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.ad-slide { display: none; }
.ad-slide.active { display: block; animation: adFade .5s; }
.ad-slide img { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--surface-alt); }
.ad-slide a { display: block; height: 100%; }
@keyframes adFade { from { opacity: 0; } to { opacity: 1; } }
.ad-carousel { aspect-ratio: 3 / 1; }
.ad-carousel .ad-slide, .ad-vertical .ad-slide { height: 100%; }
.ad-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.ad-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.65); cursor: pointer; transition: var(--t-fast); }
.ad-dots button.active { background: var(--white); box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.ad-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 36px; height: 36px; padding: 0 0 3px; border: 0; border-radius: 50%; background: rgba(33,29,25,.5); color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: var(--t-fast); }
.ad-arrow:hover { background: rgba(33,29,25,.8); }
.ad-prev { left: 10px; }
.ad-next { right: 10px; }
@media (max-width: 640px) { .ad-arrow { width: 30px; height: 30px; font-size: 1.25rem; } }
.ad-tag { position: absolute; top: 8px; right: 8px; font-size: .62rem; letter-spacing: .04em; text-transform: uppercase; background: rgba(33,29,25,.5); color: #fff; padding: 2px 8px; border-radius: var(--radius-pill); pointer-events: none; }
.ad-vertical { aspect-ratio: 3 / 5; }
.ad-side { display: none; }

/* Publicidad vertical lateral.
   El contenido (main) conserva su ancho completo: la franja del encabezado
   NO se comprime. Las verticales se colocan en el espacio sobrante a los lados,
   fijas en su lugar de la página (suben con el scroll), y arrancan a la altura del carousel hacia abajo. */
.page-shell { position: relative; }

/* Opción 2: el contenido se estrecha para dejar sitio a las laterales, de modo
   que la publicidad vertical aparezca a zoom 100% en monitores comunes.
   El contenido queda centrado (medio ancho = --content-max / 2) y las laterales
   se anclan en el espacio liberado, sin solaparse nunca con el contenido. */
/* En áreas sin publicidad lateral, el contenido no se estrecha ni se ocultan anuncios */
.page-shell.no-ads { --content-max: 1200px; }
.page-shell.no-ads .ad-side { display: none !important; }

@media (min-width: 1360px) {
  :root { --content-max: 1000px; }
  .ad-side {
    display: flex; flex-direction: column; gap: 16px;
    /* Queda fija en su lugar de la página (sube con el scroll); ya no acompaña al usuario.
       Se mide desde .page-shell, que empieza justo debajo del encabezado de 72px. */
    position: absolute;
    top: calc(var(--ad-side-top, 268px) - 72px);
    width: 160px;
    z-index: 5;
  }
  /* borde del contenido = 50% - 500px; luego 20px separación + 160px lateral */
  .ad-side-izq { left: calc(50% - 500px - 20px - 160px); }
  .ad-side-der { right: calc(50% - 500px - 20px - 160px); }
}
/* Más espacio disponible: contenido un poco más ancho y laterales más grandes */
@media (min-width: 1600px) {
  :root { --content-max: 1140px; }
  .ad-side { width: 180px; }
  .ad-side-izq { left: calc(50% - 570px - 24px - 180px); }
  .ad-side-der { right: calc(50% - 570px - 24px - 180px); }
}
@media (min-width: 1800px) {
  :root { --content-max: 1200px; }
  .ad-side { width: 200px; }
  .ad-side-izq { left: calc(50% - 600px - 28px - 200px); }
  .ad-side-der { right: calc(50% - 600px - 28px - 200px); }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .detail { grid-template-columns: 1fr; gap: 28px; }
  .dash { grid-template-columns: 1fr; }
  .side { position: static; display: flex; overflow-x: auto; gap: 4px; padding: 8px; }
  .dash-wide .side { min-height: 0; padding: 8px; }
  .dash-wide > .dash > section { padding: 20px 16px 0; }
  .dash-wide .dash { padding-bottom: 40px; align-content: start; }
  .side h4 { display: none; }
  .side a { white-space: nowrap; }
  /* Panel: en vez de la franja deslizable, botón que despliega el menú completo con sus grupos */
  .side-toggle { display: flex; align-items: center; gap: 10px; margin: 16px 16px 0; padding: 12px 16px; background: var(--pine-900); color: var(--ivory); border-radius: var(--radius-sm); font-size: .95rem; font-weight: 600; cursor: pointer; user-select: none; }
  .side-toggle::after { content: "▾"; margin-left: auto; transition: var(--t-fast); }
  .side-toggle-input:checked + .side-toggle::after { transform: rotate(180deg); }
  .side.side-collapsible { display: none; margin: 8px 16px 0; border-radius: var(--radius-sm); padding: 8px 8px 12px; }
  .side-toggle-input:checked ~ .side.side-collapsible { display: block; }
  .side-collapsible h4 { display: block; }
  .side-collapsible a { white-space: normal; }
  .news-card { grid-template-columns: 1fr; }
  .news-card .img { min-height: 190px; }
  .payout { grid-template-columns: 1fr; }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
}
/* El menú es largo (7 enlaces + usuario): en tablet/móvil pasa a dos filas.
   Fila 1 = logo + acciones de cuenta; fila 2 = franja de opciones deslizable (como las pestañas del perfil) */
@media (max-width: 1240px) {
  .site-header .inner { flex-wrap: wrap; height: auto; padding: 10px 0 0; row-gap: 6px; column-gap: 10px; }
  .site-header .nav-actions { margin-left: auto; gap: 6px; }
  .site-header .main-nav {
    order: 3; flex: 0 0 calc(100% + 32px); margin: 0 -16px; padding: 0 16px; gap: 2px;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    border-top: 1px solid rgba(57,37,27,.10);
  }
  .site-header .main-nav::-webkit-scrollbar { display: none; }
  .site-header .main-nav a { flex: none; padding: 11px 12px; font-size: .88rem; border-radius: 0; border-bottom: 3px solid transparent; }
  .site-header .main-nav a:hover { background: none; }
  .site-header .main-nav a.active { background: none; box-shadow: none; border-bottom-color: var(--emerald-600); }
  /* "Salir" pasa de la fila de cuenta al final de la franja del menú */
  .site-header .nav-actions .nav-salir { display: none !important; }
  .site-header .nav-salir-movil { display: flex; flex: none; }
  .site-header .nav-salir-movil button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 11px 12px; font: 500 .88rem var(--font-body); color: var(--graphite-700); cursor: pointer; white-space: nowrap; }
}
@media (max-width: 640px) {
  .site-header .brand-logo { height: 40px; }
  .site-header .user-chip > span:not(.avatar) { display: none; }
  .site-header .nav-actions .btn-sm { padding: 6px 11px; font-size: .8rem; }
  /* El avatar ya lleva al panel: en móvil se oculta el botón "Mi panel" para que quepa la fila */
  .site-header .nav-mipanel { display: none; }
}
@media (max-width: 380px) {
  .site-header .brand-logo { height: 34px; }
}
@media (max-width: 1100px) {
  .hero .container { padding: 70px 0 80px; }
}
@media (max-width: 860px) {
  .hero .container { padding: 70px 0 80px; }
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .img-slots { grid-template-columns: 1fr 1fr; }
  .op-card { grid-template-columns: 72px 1fr; }
  .op-card img { width: 72px; height: 72px; }
  .op-card .op-money { grid-column: 1 / -1; text-align: left; }
  .auth-card { padding: 28px 22px; }
  .profile-cover { height: 190px; }
  .profile-logo { width: 104px; height: 104px; }
  .profile-head { gap: 12px; }
  .profile-head .txt { flex-basis: 100%; margin-top: 0; }
  .profile-head .share-box { margin-top: 0; }
  .spec { grid-template-columns: 1fr; }
  .site-footer .cols { grid-template-columns: 1fr; }
  .section { padding: 40px 0; }
  .ad-carousel { aspect-ratio: 3 / 1; }
}

/* Ajustes finos */
.main-nav a, .btn { white-space: nowrap; }
.card-seller { min-width: 0; }
.card-foot .btn { flex: none; }
.brand { white-space: nowrap; flex: none; }
.user-chip { white-space: nowrap; min-width: 0; }
.user-chip > span:not(.avatar) { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.nav-actions { flex: none; }
.main-nav { min-width: 0; }
@media (max-width: 1360px) {
  .brand-logo { height: 44px; padding: 5px 10px; }
  .site-header .inner { gap: 12px; }
  .main-nav { gap: 0; }
  .main-nav a { padding: 8px 8px; font-size: .82rem; }
  .nav-actions { gap: 6px; }
  .nav-actions .btn-sm { padding: 7px 12px; }
  .user-chip > span:not(.avatar) { max-width: 90px; }
}
@media (min-width: 1361px) {
  .main-nav a { padding: 8px 11px; }
}
/* Panel/BackOffice: el logo ocupa 260px (alineado con el menú lateral); en pantallas medianas solo se muestra el avatar */
@media (min-width: 1241px) and (max-width: 1500px) {
  .header-dash .user-chip > span:not(.avatar) { display: none; }
}

/* ---------- Botón flotante de WhatsApp ---------- */
.wsp-float {
  position: fixed; bottom: 24px; right: 24px; z-index: 60;
  width: 58px; height: 58px; border-radius: 50%;
  background: #25d366; color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(37, 211, 102, .4);
  transition: var(--t);
}
.wsp-float svg { width: 32px; height: 32px; display: block; }
.wsp-float:hover { color: #fff; transform: translateY(-3px) scale(1.05); box-shadow: 0 12px 30px rgba(37, 211, 102, .5); }
.wsp-float::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(37, 211, 102, .5); animation: wspPulse 2s infinite;
}
@keyframes wspPulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.6); opacity: 0; } }
@media (max-width: 640px) { .wsp-float { width: 52px; height: 52px; bottom: 16px; right: 16px; } .wsp-float svg { width: 28px; height: 28px; } }

/* ---------- Modal "Guardando…" (formularios con data-guardando) ---------- */
.guardando-overlay {
  position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center;
  padding: 24px; background: rgba(24,20,17,.62); backdrop-filter: blur(2px);
}
.guardando-overlay.open { display: flex; animation: adFade .2s; }
.guardando-box {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 32px 36px; max-width: 360px; width: 100%; text-align: center;
}
.guardando-spinner {
  width: 46px; height: 46px; margin: 0 auto 18px; border-radius: 50%;
  border: 4px solid var(--emerald-soft); border-top-color: var(--emerald-600);
  animation: guardandoGira .8s linear infinite;
}
.guardando-box strong { display: block; font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); margin-bottom: 6px; }
.guardando-box span { display: block; font-size: .88rem; color: var(--muted); }
@keyframes guardandoGira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .guardando-spinner { animation-duration: 2s; } }

/* ---------- Video de la publicación ---------- */
.detail-video, .form-video { display: block; width: 100%; max-height: 480px; background: #000; border-radius: var(--radius); box-shadow: var(--shadow); }
.form-video { max-width: 420px; max-height: 260px; margin-bottom: 8px; border-radius: var(--radius-sm); box-shadow: none; }
.field label.chk { display: flex; gap: 6px; align-items: center; font-weight: 500; margin: 0 0 8px; }

/* Campo de fecha: misma altura que los demás inputs y color de texto legible cuando está vacío */
input[type=date] { min-height: 46px; cursor: pointer; }
input[type=date]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .7; }
input[type=date]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* ---------- Campo de contraseña con "ojito" ---------- */
.pw-field { position: relative; }
.pw-field input { padding-right: 48px; }
.pw-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 38px; height: 38px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--stone-500); cursor: pointer;
  transition: var(--t-fast);
}
.pw-toggle:hover { color: var(--emerald-700); background: var(--emerald-soft); }
.pw-toggle:focus-visible { outline: 2px solid var(--emerald-600); outline-offset: 1px; }
.pw-toggle .ico-eye-off { display: none; }
.pw-toggle.on { color: var(--emerald-700); }
.pw-toggle.on .ico-eye { display: none; }
.pw-toggle.on .ico-eye-off { display: block; }
/* Edge/IE traen su propio ojito nativo: se oculta para no duplicarlo */
input[type=password]::-ms-reveal, input[type=password]::-ms-clear { display: none; }

/* ---------- Selector de archivo con arrastrar y soltar (.file-drop) ---------- */
.file-drop { border: 2px dashed var(--line); border-radius: var(--radius-sm); background: var(--ivory); transition: var(--t-fast); }
.file-drop:hover, .file-drop.over { border-color: var(--emerald-600); background: var(--emerald-soft); }
.file-drop:focus-within { border-color: var(--emerald-600); box-shadow: 0 0 0 3px var(--emerald-soft); }
.file-drop .fd-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.file-drop .fd-prompt {
  display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0; padding: 22px 16px;
  text-align: center; cursor: pointer; font-weight: 400; font-size: .92rem; color: var(--graphite-700);
}
.file-drop .fd-prompt b { color: var(--emerald-700); font-weight: 600; }
.file-drop .fd-ico { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--emerald-soft); color: var(--emerald-700); margin-bottom: 6px; }
.file-drop .fd-hint { font-size: .8rem; color: var(--stone-500); }
.file-drop .fd-preview { display: flex; align-items: center; gap: 14px; padding: 12px 14px; }
.file-drop .fd-preview[hidden] { display: none; }
.file-drop .fd-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); flex: none; }
.file-drop .fd-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-drop .fd-name { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-drop .fd-size { font-size: .78rem; color: var(--stone-500); }
.file-drop .field-validation-error { padding: 0 16px 12px; text-align: center; }
.file-drop.tiene-archivo { border-style: solid; background: var(--surface); }
.file-drop.tiene-archivo .fd-prompt { display: none; }
.file-drop { position: relative; }
.field-validation-error[hidden] { display: none; }

/* Beneficio de meses de regalo (registro e inicio) */
.promo-regalo { display: flex; gap: 14px; align-items: flex-start; margin: 4px 0 22px; padding: 14px 16px; background: var(--sand); border: 1px dashed var(--emerald-600); border-radius: var(--radius-sm); }
.promo-regalo .promo-ico { font-size: 1.6rem; line-height: 1; flex: none; }
.promo-regalo b { display: block; color: var(--pine-800); font-size: 1rem; margin-bottom: 2px; }
.promo-regalo span:not(.promo-ico) { display: block; color: var(--graphite-700); font-size: .88rem; line-height: 1.5; }
.promo-pill { display: inline-block; margin-bottom: 12px; padding: 6px 14px; border-radius: var(--radius-pill); background: var(--gold); color: var(--pine-900); font-weight: 700; font-size: .85rem; letter-spacing: .02em; }

/* Formularios de publicar con la membresía vencida */
.aviso-membresia { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 20px; padding: 14px 18px; background: #fbf1d6; border: 1px solid #ecd28c; border-left: 4px solid var(--amber); border-radius: var(--radius-sm); color: var(--graphite-900); }
.aviso-membresia b { display: block; font-size: 1rem; }
.aviso-membresia span { font-size: .9rem; line-height: 1.5; }
