/* SelectaMarket — Hito 2 fair home, sin Tailwind por ahora. */
:root {
  --fair-primary:   #123B8F;
  --fair-secondary: #C6923B;
  --fair-accent:    #0E1E4A;
  /* Texto oscuro sobre fondos claros; no se redefine en fair/_layout (solo brand). */
  --fair-heading:   #0E1E4A;
  /* Azul marca plataforma (header); feria no redefine este token en _layout. */
  --selecta-primary: #123B8F;
  --bg:             #F4F6FB;
  --card:           #FFFFFF;
  --text:           #1A1A1A;
  --text-soft:      #6B7280;
  --border:         #E5E7EB;
}

* { box-sizing: border-box; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0; background: var(--bg); color: var(--text);
}
a { color: inherit; text-decoration: none; }

/* ---------- Generic pages (auth/account) ---------- */
.sm-page { max-width: 980px; margin: 0 auto; padding: 28px 32px 56px; }
.sm-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.sm-card--narrow { max-width: 520px; margin: 0 auto; }
.sm-h1 { margin: 0 0 10px; font-size: 22px; color: var(--fair-heading); }
.sm-h2 { margin: 0 0 10px; font-size: 16px; color: var(--fair-heading); }
.sm-muted { margin: 0 0 16px; color: var(--text-soft); font-size: 14px; }
.sm-hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.sm-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.sm-prose { font-size: 14px; line-height: 1.55; }
.sm-prose p { margin: 10px 0; }
.sm-prose h2 { margin: 16px 0 8px; font-size: 16px; color: var(--fair-heading); }
.sm-prose h3 { margin: 14px 0 6px; font-size: 14px; color: var(--fair-heading); }
.sm-prose ul, .sm-prose ol { margin: 10px 0 10px 20px; padding: 0; }
.sm-prose li { margin: 4px 0; }
.sm-prose a { text-decoration: underline; text-underline-offset: 2px; }
.sm-prose code { background: #F7F8FA; border: 1px solid var(--border); padding: 1px 6px; border-radius: 8px; }
.sm-prose pre { background: #e8e8eb; color: #0b0b0b; padding: 12px 14px; border-radius: 12px; overflow: auto; }
.sm-prose pre code { background: transparent; border: 0; padding: 0; color: inherit; }

/* Help: special typography for the first H2 of cupones */
.help-article--cupones .sm-prose h2:first-of-type {
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  letter-spacing: 0.2px;
}

.sm-field { display: grid; gap: 6px; margin: 12px 0; }
.sm-field label { font-size: 13px; color: #444; }
.sm-label { font-size: 13px; color: #444; }
.sm-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.sm-table th,
.sm-table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
.sm-table th {
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-soft);
  background: #F7F8FA;
}
.sm-table tbody tr:hover td { background: #FBFCFF; }
.sm-table tbody tr:last-child td { border-bottom: 0; }
.sm-input {
  width: 100%;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
}

.sm-input-group { position: relative; }
.sm-input-group .sm-input { padding-right: 56px; }
.sm-input-action {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  line-height: 1;
  color: #444;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  font-size: 14px;
}
.sm-input-action:hover .sm-eye { background: #F7F8FA; }
.sm-input-action:focus-visible { outline: 2px solid var(--fair-primary); outline-offset: 2px; }
.sm-eye {
  width: 2em;
  height: 2em;
  display: block;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  background: #fff;
}
.sm-input-action[data-state="hidden"] .sm-eye--closed { display: none; }
.sm-input-action[data-state="shown"] .sm-eye--open { display: none; }
.sm-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  margin-top: 12px;
}
@media (max-width: 800px) {
  .sm-form-grid { grid-template-columns: 1fr; }
}

.sm-form-grid input[type="text"],
.sm-form-grid input[type="number"],
.sm-form-grid input[type="email"],
.sm-form-grid input[type="url"],
.sm-form-grid input[type="search"],
.sm-form-grid input[type="file"],
.sm-form-grid input[type="password"],
.sm-form-grid select,
.sm-form-grid textarea {
  width: 100%;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  outline: none;
}
.sm-form-grid textarea { min-height: 110px; resize: vertical; }
.sm-form-grid input[type="checkbox"] { width: auto; padding: 0; }

.sm-error {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #7F1D1D;
  font-size: 13px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  background: #fff;
  border: 1.5px solid #DC2626;
  color: #DC2626;
  cursor: pointer;
}
.btn-secondary:hover { background: #FEF2F2; }
.btn-secondary:disabled { opacity: 0.6; cursor: not-allowed; }
.sm-form-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.sm-help-links { margin-top: 10px; }
.sm-link { color: var(--fair-primary); font-size: 13px; }
.sm-link:hover { text-decoration: underline; }
.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 500;
  font-size: 14px;
}
.sm-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--text-soft); font-size: 12px; }
.sm-divider::before, .sm-divider::after { content: ""; height: 1px; background: var(--border); flex: 1; }
.sm-errors { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: #FEF2F2; border: 1px solid #FECACA; color: #7F1D1D; font-size: 13px; }
.errorlist {
  margin: 6px 0 0;
  padding-left: 18px;
  color: #7F1D1D;
  font-size: 13px;
}
.errorlist li { margin: 2px 0; }

/* ---------- Account layout ---------- */
.sm-account { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
.sm-account-sidebar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.sm-account-sidebar-title {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text-soft);
  margin: 6px 8px 10px;
}
.sm-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 10px;
  font-size: 14px;
  color: #222;
}
.sm-nav-item:hover { background: #F4F6FB; }
.sm-nav-item.is-active { background: #E8EEFB; color: var(--fair-primary); font-weight: 600; }
.sm-nav-item--button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.sm-account-sidebar form { margin: 6px 0 0; }
.sm-account-content { min-width: 0; }
@media (max-width: 900px) {
  .sm-account { grid-template-columns: 1fr; }
  .sm-account-sidebar { display: none; }
  .sm-account { gap: 0; }
}

/* ---------- Header ---------- */
.sm-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 14px 32px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.sm-header-top-actions { display: none; }
.sm-brand { display: flex; align-items: center; gap: 8px; color: var(--selecta-primary); font-weight: 600; }
.sm-brand-logo { height: 110px; width: auto; display: block; }
.sm-brand-logo--fair { height: 90px; }
.sm-brand-titles { display: flex; flex-direction: column; gap: 2px; }
.sm-brand-title {
  color: var(--selecta-primary);
  font-weight: 800;
  font-size: calc(18px + 2pt);
  letter-spacing: 0.2px;
  line-height: 1.1;
}
.sm-brand-subtitle {
  font-weight: 500;
  font-size: calc(13px + 2pt);
  color: var(--text-soft);
  line-height: 1.15;
}
.sm-brand-icon { font-size: 22px; }
.sm-brand-text { font-size: 18px; letter-spacing: 0.5px; }
.sm-search { display: flex; max-width: 520px; width: 100%; justify-self: center; }
.sm-search input {
  flex: 1; padding: 12px 16px; border: 1px solid var(--border); border-right: none;
  border-radius: 999px 0 0 999px; outline: none; font-size: 14px; background: #F7F8FA;
}
.sm-search button {
  padding: 0 18px; border: 1px solid var(--border); border-left: none;
  border-radius: 0 999px 999px 0; background: #F7F8FA; cursor: pointer;
}
.sm-header-actions { display: flex; align-items: center; gap: 18px; }
.sm-mobile-categories { display: none; }
.btn-primary {
  background: var(--fair-primary); color: #fff; padding: 10px 18px;
  border-radius: 999px; font-weight: 500; font-size: 14px;
}
.sm-header .btn-primary {
  background: var(--selecta-primary);
}
.sm-icon-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: #444; }
.sm-icon-only { padding: 6px; border-radius: 10px; }
.sm-icon-only:focus-visible { outline: 2px solid var(--fair-primary); outline-offset: 2px; }
.sm-user-icon { width: 18px; height: 18px; display: block; color: #111; }
.sm-account-mobile { position: relative; }
.sm-dropdown { position: relative; }
.sm-dropdown-trigger { list-style: none; cursor: pointer; }
.sm-dropdown-trigger::-webkit-details-marker { display: none; }
.sm-dropdown[open] .sm-dropdown-trigger { color: var(--fair-primary); }
.sm-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 190px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.10);
  z-index: 50;
}
.sm-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 10px;
  font-size: 14px;
  color: #222;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.sm-dropdown-item:hover { background: #F4F6FB; }
.sm-dropdown-menu form { margin: 0; }
.sm-cart { position: relative; }
.sm-badge {
  background: var(--fair-primary); color: #fff; font-size: 11px;
  border-radius: 999px; padding: 2px 7px; margin-left: 4px;
}

/* Mobile-only: hamburger + carrito compacto. Ocultos en desktop. */
.sm-mobile-toggle { display: none; }
.sm-cart-mobile { display: none; }

@media (max-width: 900px) {
  .sm-header {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "ham brand topactions"
      "search search search";
    gap: 10px 12px;
    padding: 10px 14px;
  }
  .sm-mobile-toggle { display: block; grid-area: ham; position: relative; }
  .sm-hamburger {
    list-style: none; cursor: pointer; font-size: 26px; line-height: 1;
    padding: 4px 8px; border-radius: 8px; user-select: none;
  }
  .sm-hamburger::-webkit-details-marker { display: none; }
  .sm-mobile-toggle[open] .sm-hamburger { background: #F4F6FB; color: var(--fair-primary); }

  .sm-brand { grid-area: brand; gap: 8px; min-width: 0; }
  .sm-brand-logo, .sm-brand-logo--fair { height: 44px; flex-shrink: 0; }
  .sm-brand-title { font-size: calc(14px + 2pt); }
  .sm-brand-subtitle { font-size: calc(11px + 2pt); }
  .sm-brand-titles { min-width: 0; }
  .sm-brand-title, .sm-brand-subtitle {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }

  .sm-header-top-actions {
    display: inline-flex;
    grid-area: topactions;
    align-items: center;
    gap: 10px;
    justify-self: end;
  }
  .sm-cart-mobile { display: none; }

  .sm-search { grid-area: search; max-width: none; justify-self: stretch; }
  .sm-search input { padding: 10px 14px; font-size: 14px; }

  /* Las acciones desktop pasan a ser un panel desplegable abierto por el hamburger.
     Sibling selector: el panel se muestra cuando .sm-mobile-toggle está [open]. */
  .sm-header-actions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 12px 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
    z-index: 60;
  }
  .sm-header { position: relative; }
  .sm-mobile-toggle[open] ~ .sm-header-actions { display: flex; }

  .sm-header-actions .btn-primary {
    text-align: center; padding: 12px 16px; margin-bottom: 8px;
  }
  /* Cuenta en mobile: solo el ícono arriba a la derecha; no duplicar en el panel hamburger */
  .sm-header-actions .sm-account-desktop { display: none !important; }
  .sm-header-actions .sm-icon-link {
    padding: 12px 8px; border-bottom: 1px solid #F0F1F4; font-size: 15px;
  }
  .sm-header-actions .sm-dropdown { width: 100%; }
  .sm-header-actions .sm-dropdown-trigger { padding: 12px 8px; border-bottom: 1px solid #F0F1F4; }
  .sm-header-actions .sm-dropdown-menu {
    position: static; box-shadow: none; border: none; padding: 4px 0 4px 16px;
    min-width: 0;
  }
  .sm-mobile-categories { display: block; margin: 6px 0 10px; }
  .sm-header-actions .fair-sidebar { background: transparent; border: 0; padding: 0; }
  .sm-header-actions .categories-collapse { border-bottom: 1px solid #F0F1F4; padding-bottom: 8px; }
  .sm-header-actions .sidebar-title { padding: 10px 8px; margin: 0; }
  /* En el panel mobile el carrito grande es redundante con el ícono de la fila superior */
  .sm-header-actions .sm-cart { display: none; }
}

/* ---------- Hero ---------- */
.fair-hero {
  position: relative;
  display: block;
  background: #fff;
  overflow: hidden;
  min-height: 256px;
}
.fair-hero-image {
  background-size: cover; background-position: center;
  min-height: 256px;
}
.fair-hero-mobile { display: none; }
@media (max-width: 900px) {
  .fair-hero { min-height: 220px; }
  .fair-hero-image { min-height: 220px; }
  /* Si hay versión mobile dedicada, mostrar esa y ocultar la desktop.
     Si no, .fair-hero-mobile no existe en el DOM y se sigue viendo la desktop. */
  .fair-hero:has(.fair-hero-mobile) .fair-hero-desktop { display: none; }
  .fair-hero-mobile { display: block; }
}

/* ---------- Hero compacto (detalle producto) ---------- */
.fair-hero-compact {
  position: relative;
  background: #fff;
  border-bottom: 1px solid var(--border);
  min-height: 200px;
  overflow: hidden;
}
.fair-hero-compact-image {
  width: 100%;
  min-height: 240px;
  background-size: cover;
  background-position: center;
}
@media (max-width: 900px) {
  .fair-hero-compact { min-height: 160px; }
  .fair-hero-compact-image { min-height: 160px; }
}

/* ---------- Layout ---------- */
.fair-main { max-width: 1400px; margin: 0 auto; padding: 24px 32px 48px; }
.fair-grid { display: grid; grid-template-columns: 240px 1fr; gap: 32px; }

@media (max-width: 900px) {
  .fair-main { padding: 16px 12px 32px; }
  .fair-grid { grid-template-columns: 1fr; gap: 20px; }
  /* Productos arriba, sidebar (categorías + invitar) abajo */
  .fair-products { order: 1; }
  .fair-sidebar  { order: 2; }
  /* Home: no repetir categorías abajo en mobile (van en el menú hamburger) */
  .fair-grid--home-no-sidebar-cats .fair-sidebar .categories-collapse { display: none !important; }
}

/* ---------- Sidebar ---------- */
.fair-sidebar { font-size: 14px; }
.sidebar-title { font-size: 13px; color: var(--fair-heading); margin: 0 0 12px; letter-spacing: 1px; }
.category-list { list-style: none; padding: 0; margin: 0 0 24px; background: #fff; border-radius: 8px; overflow: hidden; }
.category-list li a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid #F0F1F4; color: #333;
}
.category-list li:last-child a { border-bottom: none; }
.category-list li.is-active > a, .category-list li.is-active > .cat-row { background: #E8EEFB; color: var(--fair-primary); font-weight: 500; }
.cat-arrow { color: #B0B6C0; transition: transform 0.15s ease; }

/* Acordeón de categorías → subcategorías */
.cat-group > details > summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid #F0F1F4; color: #333;
  cursor: pointer; list-style: none;
}
.cat-group > details > summary::-webkit-details-marker { display: none; }
.cat-group > details[open] > summary .cat-arrow { transform: rotate(90deg); }
.cat-group > details[open] > summary { background: #F7F9FC; }
.cat-group > details > summary.is-active { background: #E8EEFB; color: var(--fair-primary); font-weight: 500; }

.subcategory-list { list-style: none; padding: 0; margin: 0; background: #FAFBFD; }
.subcategory-list li a {
  display: block; padding: 10px 14px 10px 28px; border-bottom: 1px solid #F0F1F4;
  color: #555; font-size: 13px;
}
.subcategory-list li:last-child a { border-bottom: none; }
.subcategory-list li.is-active a { background: #E8EEFB; color: var(--fair-primary); font-weight: 500; }

.invite-card {
  background: var(--fair-accent); color: #fff; border-radius: 12px;
  padding: 20px; text-align: left;
}
.invite-card h4 { margin: 8px 0 4px; font-size: 15px; line-height: 1.2; color: var(--fair-secondary); }
.invite-card p { margin: 0 0 14px; font-size: 12px; opacity: 0.85; }

/* Colapso de categorías: solo desktop muestra el contenido sin <details>;
   en mobile actúa como acordeón cerrado por defecto. */
.categories-collapse > summary { list-style: none; cursor: default; display: flex; justify-content: space-between; align-items: center; }
.categories-collapse > summary::-webkit-details-marker { display: none; }
.categories-arrow { display: none; color: #B0B6C0; transition: transform 0.15s ease; }

@media (max-width: 900px) {
  .categories-collapse > summary { cursor: pointer; padding: 12px 14px; background: #fff; border-radius: 8px; margin-bottom: 8px; }
  .categories-arrow { display: inline-block; transform: rotate(90deg); }
  .categories-collapse:not([open]) .categories-arrow { transform: rotate(0deg); }
  .categories-collapse:not([open]) .category-list { margin-bottom: 0; }

  .invite-card {
    padding: 14px 16px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "icon text btn";
    align-items: center;
    gap: 12px;
  }
  .invite-icon { grid-area: icon; font-size: 22px; }
  .invite-card h4 { grid-area: text; margin: 0; font-size: 13px; }
  .invite-card h4 br { display: none; }
  .invite-card p { display: none; }
  .invite-card .btn-invite { grid-area: btn; padding: 8px 12px; font-size: 12px; white-space: nowrap; }
}
.btn-invite {
  display: inline-block;
  background: var(--fair-primary);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  border: 0;
  cursor: pointer;
}
.btn-invite:focus-visible { outline: 2px solid var(--fair-secondary); outline-offset: 2px; }

/* ---------- Products ---------- */
.products-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
}
.products-header h2 { font-size: 14px; letter-spacing: 1px; color: var(--fair-heading); margin: 0; }
.sort-control { font-size: 13px; color: #555; }
.sort-control select { margin-left: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
@media (max-width: 1280px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px)  { .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

@media (max-width: 900px) {
  .products-header { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
  .products-header h2 { font-size: 13px; }
  .product-name { font-size: 13px; margin: 10px 10px 4px; min-height: 32px; }
  .product-price { font-size: 15px; margin: 0 10px 4px; }
  .product-location { font-size: 11px; margin: 0 10px 10px; }
}
.product-card {
  background: #fff; border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.product-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.product-image-wrap {
  position: relative;
  aspect-ratio: 1/1;
  background: #F4F4F4;
  width: 100%;
  max-height: 210px;
  overflow: hidden;
}
.product-link { color: inherit; text-decoration: none; display: block; }
.product-link:hover { text-decoration: none; }
.product-image-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-fav {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: 999px; border: none;
  background: rgba(255,255,255,0.9); cursor: pointer; font-size: 16px;
  color: #1A1A1A; transition: transform .15s ease, color .15s ease, background .15s ease;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.product-fav:hover { transform: scale(1.08); }
.product-fav:disabled { opacity: 0.6; cursor: progress; }
.product-fav.is-active { color: #E1306C; background: #fff; }
.product-name { font-size: 14px; font-weight: 500; margin: 12px 14px 4px; min-height: 36px; line-height: 1.2; }
.product-price { font-size: 16px; font-weight: 700; margin: 0 14px 6px; color: var(--text); }
.product-location { font-size: 12px; color: var(--text-soft); margin: 0 14px 14px; }

.see-more { text-align: center; margin: 28px 0; }
.btn-outline {
  display: inline-block; padding: 10px 22px; border: 1.5px solid var(--fair-primary);
  color: var(--fair-primary); border-radius: 999px; font-size: 14px; font-weight: 500;
}

/* Publicar producto (cuenta): mismo perfil que .btn-outline, fondo verde */
.btn-publish-green {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border: 1.5px solid #15803d;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  background: #16a34a;
  color: #fff;
  cursor: pointer;
}
.btn-publish-green:hover {
  background: #15803d;
  border-color: #166534;
}

/* ---------- Product detail (feria) ---------- */
.product-detail { max-width: 1240px; margin: 0 auto; }
.breadcrumbs { font-size: 13px; color: var(--text-soft); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 2px 0 18px; }
.breadcrumbs a { color: var(--text-soft); text-decoration: none; }
.breadcrumbs a:hover { color: var(--fair-primary); }
.crumb-current { color: var(--text); font-weight: 600; }

.product-detail-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 28px; align-items: start; }
@media (max-width: 1050px) { .product-detail-grid { grid-template-columns: 1fr; } }

.pd-media-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.pd-gallery { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; }
.pd-main { border-radius: 12px; overflow: hidden; background: #F4F4F4; aspect-ratio: 4/3; display: flex; }
.pd-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-main-placeholder { width: 100%; height: 100%; }
.pd-thumbs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 12px; }
@media (max-width: 650px) { .pd-thumbs { grid-template-columns: repeat(4, 1fr); } }
.pd-thumb { border: 1px solid var(--border); background: #fff; border-radius: 10px; overflow: hidden; padding: 0; cursor: pointer; aspect-ratio: 1/1; }
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-thumb.is-active { border-color: var(--fair-primary); box-shadow: 0 0 0 2px rgba(18,59,143,0.12); }

.pd-info { display: flex; flex-direction: column; gap: 14px; }
.pd-friend-link-row {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}
.pd-title { margin: 0; font-size: 30px; line-height: 1.1; }
.pd-share-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--selecta-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.pd-share-link:hover { color: var(--selecta-primary); }

.pd-price-block { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.pd-price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pd-price { font-size: 34px; font-weight: 800; color: var(--selecta-primary); }

.pd-reserve-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px 18px;
}
.pd-qty-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pd-qty-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}
.pd-qty-select {
  min-width: 76px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  background: #fff;
}

.pd-reserve {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 800;
  color: var(--selecta-primary);
  background: #fff;
  border: 2px solid var(--selecta-primary);
  text-decoration: none;
  line-height: 1.2;
}
.pd-reserve:hover {
  background: rgba(18, 59, 143, 0.06);
  color: var(--selecta-primary);
}

.pd-share { display: grid; gap: 10px; }
.pd-share-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}
.pd-share-row { display: flex; gap: 10px; align-items: center; }
.pd-share-status { margin: 8px 0 0 0; font-size: 12px; }

.pd-badges { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 520px) { .pd-badges { grid-template-columns: 1fr; } }
.pd-badge { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 12px 12px; }
.pd-badge--accent { background: #F2F7EA; border-color: rgba(67, 131, 43, 0.22); }
.pd-badge-label { font-size: 12px; color: var(--text-soft); margin-bottom: 4px; }
.pd-badge-value { font-size: 15px; font-weight: 700; color: var(--text); }

.pd-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.pd-card h3 { margin: 0 0 10px; font-size: 14px; letter-spacing: 0.2px; }
.pd-desc { margin: 0; color: #2B2F36; font-size: 14px; line-height: 1.5; }
.pd-desc--muted { color: var(--text-soft); }

.pd-attrs { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.pd-attrs li { color: #2B2F36; font-size: 14px; line-height: 1.35; }

.pd-deliveries { display: grid; gap: 10px; }
.pd-delivery { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: #FAFBFD; }
.pd-delivery-title { font-weight: 800; color: var(--text); margin-bottom: 2px; }
.pd-delivery-sub { font-size: 13px; color: var(--text-soft); }
.pd-delivery-note { font-size: 13px; color: #2B2F36; margin-top: 6px; }

/* ── Preguntas y respuestas ── */
.pd-qa { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--border); }
.pd-qa__title { font-size: 16px; font-weight: 700; color: var(--fair-heading); margin: 0 0 18px; }
.pd-qa__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.pd-qa__item { display: grid; gap: 10px; }
.pd-qa__question,
.pd-qa__answer { display: flex; gap: 12px; align-items: flex-start; }
.pd-qa__answer { padding-left: 20px; }
.pd-qa__badge { flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.pd-qa__badge--q { background: var(--fair-secondary); color: #fff; }
.pd-qa__badge--a { background: var(--fair-primary); color: #fff; }
.pd-qa__body { flex: 1; min-width: 0; }
.pd-qa__text { margin: 0 0 4px; font-size: 14px; color: var(--text); line-height: 1.5; }
.pd-qa__meta { font-size: 12px; color: var(--text-soft); }
.pd-qa__empty { font-size: 14px; color: var(--text-soft); margin: 0; }
.pd-qa__msg { font-size: 13px; padding: 10px 12px; border-radius: 10px; margin: 0 0 12px; }
.pd-qa__msg--success { background: #f0fdf4; color: #166534; }
.pd-qa__msg--error { background: #fef2f2; color: #991b1b; }
.pd-qa__ask { margin-top: 20px; display: grid; gap: 12px; }
.pd-qa__ask-btn { width: fit-content; }
.pd-qa__form { display: grid; gap: 10px; }
.pd-qa__textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; resize: vertical; }
.pd-qa__textarea:focus { outline: 2px solid var(--fair-primary); outline-offset: 1px; border-color: transparent; }
.pd-qa__form-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
.pd-qa__cancel { background: none; border: none; font-size: 14px; color: var(--text-soft); cursor: pointer; padding: 4px 8px; }
.pd-qa__cancel:hover { color: var(--text); }

/* ---------- Reserva (checkout placeholder) ---------- */
.reserve-flow { max-width: 720px; margin: 0 auto; }
.reserve-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 22px 24px;
}
.reserve-title { margin: 0 0 18px; font-size: 22px; line-height: 1.2; color: var(--text); }
.reserve-intro p {
  margin: 0 0 12px;
  color: #2B2F36;
  font-size: 15px;
  line-height: 1.55;
}
.reserve-intro p:last-child { margin-bottom: 0; }
.reserve-section { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.reserve-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.reserve-amount { font-size: 28px; font-weight: 800; color: var(--selecta-primary); line-height: 1.1; }
.reserve-hint { margin: 10px 0 0; font-size: 13px; color: var(--text-soft); }
.reserve-deliveries { margin-top: 4px; }
.reserve-empty { margin: 6px 0 0; font-size: 14px; color: var(--text-soft); }
.reserve-actions {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.btn-mercadopago {
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: #009ee3;
  cursor: pointer;
  font-family: inherit;
}
.btn-mercadopago:hover { filter: brightness(1.06); }
.btn-mercadopago:focus-visible {
  outline: 2px solid var(--fair-primary);
  outline-offset: 2px;
}
.reserve-back { display: inline-flex; align-items: center; }

.reserve-paid-form {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.reserve-paid-btn {
  width: 100%;
  max-width: 320px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.reserve-done-card .reserve-title { margin-bottom: 12px; }
.reserve-done-product { font-size: 15px; margin-bottom: 18px; }
.reserve-section--seller { margin-top: 8px; }
.reserve-seller-list {
  margin: 0;
  padding-left: 18px;
  color: #2B2F36;
  font-size: 15px;
  line-height: 1.55;
}
.reserve-seller-name { font-weight: 700; list-style: disc; }
.reserve-done-account {
  margin: 22px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: #2B2F36;
}
.reserve-done-account a { font-weight: 600; }

.fair-messages {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 20px 0;
}
.fair-message {
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
}
.fair-message--success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.fair-message--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.fair-message--info,
.fair-message--debug { background: #f8fafc; color: #334155; border: 1px solid var(--border); }

/* ---------- Messages globales (incluidos desde base.html) ---------- */
.sm-messages {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 20px 0;
}
.sm-message {
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
}
.sm-message--success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.sm-message--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.sm-message--warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.sm-message--info,
.sm-message--debug { background: #f8fafc; color: #334155; border: 1px solid var(--border); }

/* ---------- Footer ---------- */
.fair-footer {
  background: #fff; border-top: 1px solid var(--border);
  font-size: 13px;
}
.fair-footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 22px 32px;
  gap: 24px;
}
.footer-cell { display: flex; gap: 12px; align-items: flex-start; }
.footer-cell strong { display: block; margin-bottom: 4px; }
.footer-cell span { color: var(--text-soft); font-size: 12px; line-height: 1.4; }
.footer-icon {
  width: 28px;
  height: 28px;
  display: block;
  object-fit: contain;
  flex: 0 0 28px;
}
.footer-cell--accent { background: #FFFBEA; border-radius: 8px; padding: 10px; }
.fair-footer-brand {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.fair-footer-brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.fair-footer-brand-logo { height: 120px; width: auto; display: block; }
@media (max-width: 1100px) { .fair-footer-inner { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Modal (Invitar amigos) ---------- */
.sm-modal-overlay[hidden],
.sm-modal[hidden] { display: none !important; }

.sm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.50);
  z-index: 120;
}

.sm-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 121;
}

.sm-modal-card {
  width: min(560px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}

.sm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.sm-modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--fair-heading);
}

.sm-modal-close {
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 18px;
  line-height: 1;
  color: #444;
}
.sm-modal-close:hover { background: #F4F6FB; }
.sm-modal-close:focus-visible { outline: 2px solid var(--fair-primary); outline-offset: 2px; }

.sm-modal-text {
  margin: 0 0 12px;
  color: var(--text-soft);
  font-size: 14px;
}

.sm-modal-copy-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.sm-modal-copy-btn {
  padding: 10px 16px;
  border: 0;
  cursor: pointer;
}

.sm-modal-status {
  margin: 10px 2px 0;
  font-size: 12px;
  color: var(--text-soft);
  min-height: 16px;
}

/* ---------- Favoritos (cuenta) ---------- */
.favorites-toolbar { margin: 4px 0 14px; }
.favorites-search {
  display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap;
}
.favorites-search .sm-input { flex: 1 1 240px; min-width: 180px; }
.favorites-search .btn-primary,
.favorites-search .btn-outline { padding: 8px 14px; }

.favorites-chips {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px;
}
.favorites-chip {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  font-size: 13px; text-decoration: none; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.favorites-chip:hover { background: #F4F4F4; }
.favorites-chip.is-active {
  background: var(--fair-primary); color: #fff; border-color: var(--fair-primary);
}

.favorites-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin: 0 0 14px; flex-wrap: wrap; gap: 8px;
}

.favorites-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .favorites-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px)  { .favorites-grid { grid-template-columns: repeat(2, 1fr); } }

.favorites-empty {
  text-align: center; padding: 28px 16px; color: var(--text-soft);
}
.favorites-empty p { margin: 0 0 12px; }

.product-card.is-removing {
  opacity: 0; transform: scale(0.92);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}

/* ---------- Mis publicaciones (cuenta) ---------- */
.posts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 6px 0 14px;
}
.posts-subtitle { margin: 0; }

.posts-grid { grid-template-columns: 1fr; }
.posts-grid .post-card { width: 100%; }

.post-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.post-card:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(0,0,0,0.06); }

.post-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.post-title {
  color: var(--fair-heading);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.15;
}
.post-title:hover { text-decoration: underline; }

.post-edit.btn-outline { padding: 8px 14px; }

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.post-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #F7F8FA;
  color: #2B2F36;
  font-size: 13px;
  line-height: 1;
}
.post-tag--ok {
  background: #E9F8EE;
  border-color: rgba(15, 125, 65, 0.28);
  color: #0F7D41;
  font-weight: 700;
}
.post-tag--bad {
  background: #FDECEC;
  border-color: rgba(193, 42, 42, 0.30);
  color: #C12A2A;
  font-weight: 700;
}
.post-tag--price {
  background: #E8EEFB;
  border-color: rgba(18,59,143,0.25);
  color: var(--fair-primary);
  font-weight: 700;
}

.posts-admin-list { margin-top: 10px; display: grid; gap: 8px; }
.posts-admin-item {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
}
