/* =============================================================
   Furni Viewer — Styles
   Todas las clases usan el prefijo .fv- para evitar conflictos
   ============================================================= */

/* ── Layout ─────────────────────────────────────────────────── */

.fv-wrap {
  display: flex;
  flex-direction: column;
}

.fv-layout {
  display: flex;
  align-items: flex-start;
}

/* ── Sidebar ─────────────────────────────────────────────────── */

.fv-sidebar {
  width: 220px;
  min-width: 220px;
  padding: 16px 12px;
  border-right: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  max-height: 100vh;
  transition: width .2s ease, min-width .2s ease, padding .2s ease, border-color .2s ease;
}

.fv-sidebar.is-collapsed {
  width: 0;
  min-width: 0;
  padding: 0;
  border-right-color: transparent;
  overflow: hidden;
}

.fv-sidebar__section {
  margin-bottom: 20px;
}

.fv-sidebar__label {
  display: block;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #6b7280;
  font-weight: 600;
  margin-bottom: 6px;
}

/* ── Search ──────────────────────────────────────────────────── */

.fv-search {
  width: 100%;
  padding: 7px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: .875rem;
  box-sizing: border-box;
}

.fv-search:focus {
  outline: none;
  border-color: #2563eb;
}

/* ── Selects ─────────────────────────────────────────────────── */

.fv-select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: .875rem;
  background: #fff;
  box-sizing: border-box;
}

/* ── View toggle ─────────────────────────────────────────────── */

.fv-view-toggle {
  display: flex;
  gap: 4px;
}

.fv-view-btn {
  flex: 1;
  padding: 6px 0;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  font-size: .875rem;
  cursor: pointer;
  text-align: center;
}

.fv-view-btn.is-active {
  background: #006891;
  color: #fff;
  border-color: #006891;
}

/* ── Filters ─────────────────────────────────────────────────── */

.fv-filter {
  display: block;
  width: 100%;
  text-align: left;
  padding: 5px 8px;
  background: none;
  border: none;
  border-radius: 6px;
  font-size: .875rem;
  cursor: pointer;
  color: #374151;
}

.fv-filter:hover {
  background: #f3f4f6;
}

.fv-filter.is-active {
  background: #eff6ff;
  color: #006891;
  font-weight: 600;
}

/* ── Flag picker (hotel) ─────────────────────────────────────── */

.fv-flag-picker,
.fv-line-picker {
  position: relative;
}

.fv-flag-picker__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  font-size: .875rem;
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
}

.fv-flag-picker__trigger:focus {
  outline: none;
  border-color: #2563eb;
}

.fv-flag-picker__current {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fv-flag-picker__current img {
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

.fv-flag-picker__text {
  font-size: .875rem;
  color: #374151;
}

.fv-flag-picker__arrow {
  font-size: .7rem;
  color: #9ca3af;
  margin-left: 4px;
  flex-shrink: 0;
}

.fv-flag-picker__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  z-index: 200;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
}

.fv-flag-picker__dropdown.is-open {
  display: block;
}

.fv-flag-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .875rem;
  color: #374151;
}

.fv-flag-option:hover {
  background: #f3f4f6;
}

.fv-flag-option.is-active {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 600;
}

.fv-flag-option img {
  width: 22px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Line picker (furni line) ────────────────────────────────── */

.fv-line-option {
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .875rem;
  color: #374151;
}

.fv-line-option:hover {
  background: #f3f4f6;
}

.fv-line-option.is-active {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 600;
}

/* ── Sidebar toggle button ───────────────────────────────────── */

.fv-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  font-size: .85rem;
  cursor: pointer;
  color: #374151;
  flex-shrink: 0;
}

.fv-sidebar-toggle:hover {
  background: #f3f4f6;
}

.fv-sidebar-toggle.is-active {
  background: #eff6ff;
  color: #2563eb;
  border-color: #2563eb;
}

/* ── Content ─────────────────────────────────────────────────── */

.fv-content {
  flex: 1;
  padding: 20px;
  min-width: 0;
}

.fv-results-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.fv-results-count {
  font-size: .85rem;
  color: #6b7280;
}

/* ── Loading / Empty ─────────────────────────────────────────── */

.fv-loader-wrap {
  display: flex;
  justify-content: center;
  padding: 60px 0;
}

.fv-loader {
  object-fit: contain;
}

.fv-empty {
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
  font-size: .9rem;
}

/* ── Grid ────────────────────────────────────────────────────── */

.fv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.fv-card {
  position: relative;
  padding: 12px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  background: #fff;
  transition: box-shadow .15s, transform .15s;
}

.fv-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,.09);
  transform: translateY(-2px);
}

.fv-card__icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
  margin: 0 auto;
}

.fv-card__icon.is-broken { display: none; }

.fv-card__name {
  font-size: .78rem;
  font-weight: 600;
  color: #1f2937;
  margin-top: 6px;
  line-height: 1.3;
  overflow-wrap: break-word;
}

.fv-card__classname {
  font-size: .68rem;
  color: #6b7280;
  margin-top: 2px;
  word-break: break-all;
  line-height: 1.2;
}

.fv-card__badges {
  margin-top: 5px;
}

/* ── List ────────────────────────────────────────────────────── */

.fv-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fv-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
  transition: box-shadow .15s;
}

.fv-row:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}

.fv-row__icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.fv-row__icon.is-broken { display: none; }

.fv-row__info {
  flex: 1;
  min-width: 0;
}

.fv-row__name {
  font-weight: 600;
  font-size: .9rem;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fv-row__classname {
  font-size: .75rem;
  color: #6b7280;
}

.fv-row__meta {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.fv-row__id {
  font-size: .75rem;
  color: #9ca3af;
}

/* ── Badges ──────────────────────────────────────────────────── */

.fv-badge {
  display: inline-block;
  font-size: .65rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  line-height: 1.4;
}

.fv-badge--floor    { background: #dbeafe; color: #1d4ed8; }
.fv-badge--wall     { background: #fce7f3; color: #be185d; }
.fv-badge--rendered { background: #d1fae5; color: #065f46; }
.fv-badge--pending  { background: #fef3c7; color: #d97706; }
.fv-badge--failed   { background: #fee2e2; color: #991b1b; }
.fv-badge--line     { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }
.fv-badge--new      { background: #dcfce7; color: #15803d; font-weight: 700; }
.fv-badge--ltd      { background: #fef3c7; color: #92400e; font-weight: 700; }
.fv-badge--rare     { background: #ede9fe; color: #6d28d9; font-weight: 700; }
.fv-badge--bundle   { background: #dbeafe; color: #1e40af; font-weight: 700; }

/* ── Pagination ──────────────────────────────────────────────── */

.fv-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.fv-page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  font-size: .85rem;
  cursor: pointer;
  text-align: center;
}

.fv-page-btn:disabled {
  opacity: .4;
  cursor: default;
}

.fv-page-btn.is-active {
  background: #006891;
  color: #fff;
  border-color: #006891;
}

.fv-page-ellipsis {
  color: #9ca3af;
  padding: 0 4px;
}

.fv-page-info {
  font-size: .8rem;
  color: #6b7280;
  margin-left: 4px;
}

/* ── Modal content styles ────────────────────────────────────── */

/* Layout del header del modal */
#furni-view .modal-header.clear-fix {
  display: flex;
  align-items: center;
  gap: 14px;
}

.fv-modal__header-info {
  flex: 1;
  min-width: 0;
  padding-top: 5px;
}

.fv-modal__icon {
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.fv-modal__name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
}

.fv-modal__classname {
  font-size: .8rem;
  color: #6b7280;
  margin-top: 2px;
}

.fv-modal__badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 6px;
  margin-bottom: 6px;
}

.fv-modal__desc {
  font-size: .85rem;
  color: #6b7280;
  margin-bottom: 14px;
  min-height: 16px;
}

/* ── Hotel tabs (solo banderas) ──────────────────────────────── */

.fv-hotel-tabs,
.bv-hotel-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.fv-hotel-tab,
.bv-hotel-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}

.fv-hotel-tab img,
.bv-hotel-tab img {
  object-fit: cover;
  border-radius: 2px;
  display: block;
}

.fv-hotel-tab:hover,
.bv-hotel-tab:hover { border-color: #2563eb; }

.fv-hotel-tab.is-active,
.bv-hotel-tab.is-active {
  border-color: #006ccb;
  box-shadow: 0 0 0 2px #eff6ff;
}

.fv-no-texts {
  font-size: .8rem;
  color: #9ca3af;
}

/* ── Render viewer ───────────────────────────────────────────── */

.fv-render {
  margin-bottom: 16px;
}

.fv-render__label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #6b7280;
  font-weight: 600;
  margin-bottom: 8px;
}

.fv-render__hint {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  opacity: .7;
}

.fv-render__stage {
  position: relative;
  width: 100%;
  height: 280px;
  background: #0d0d0d;
  background-size: cover;
  background-position: center;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

.fv-render__stage.is-dragging {
  cursor: grabbing;
}

/* Fondos según tipo de furni — reemplaza la URL con tu imagen */
.fv-render__stage--floor {
  background-color: #0d0d0d;
  background-image: url('https://images.habbotemplarios.com/web/fondos/Background_furnis.png');
  background-position: center -115px;
  background-size: unset;
  background-repeat: no-repeat;
}

.fv-render__stage--wall {
  background-color: #0d0d0d;
  background-image: url('https://images.habbotemplarios.com/web/fondos/Background_furnis.png');
  background-position: -10px 0;
  background-size: unset;
  background-repeat: no-repeat;
}
.fv-render__stage--wall-4 {
  background-color: #0d0d0d;
  background-image: url('https://images.habbotemplarios.com/web/fondos/Background_furnis.png');
  background-position: -180px 0px;
  background-size: unset;
  background-repeat: no-repeat;
}

.fv-render__stage--dark {
  background-color: #0d0d0d !important;
  background-image: none !important;
}

/* Botón de cambio de fondo (esquina inferior izquierda del stage) */
.fv-render__bg-btn {
  position: absolute;
  bottom: 6px;
  left: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.45);
  background: rgba(0,0,0,.55);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .55rem;
  color: #fff;
  z-index: 2;
  line-height: 1;
  transition: border-color .15s, background .15s;
  flex-shrink: 0;
}

.fv-render__bg-btn:hover {
  border-color: rgba(255,255,255,.9);
  background: rgba(0,0,0,.8);
}

.fv-render__img {
  image-rendering: pixelated;
  pointer-events: none;
  display: block;
  position: absolute;
  /* sin max-width/height para ver el furni a su tamaño natural */
}

.fv-render__empty {
  color: #fff;
  font-size: 1rem;
}

.fv-render__state {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: .68rem;
  background: rgba(0,0,0,.5);
  color: #fff;
  padding: 1px 7px;
  border-radius: 10px;
  pointer-events: none;
}

.fv-render__dirs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.fv-dir-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, border-color .12s;
}

.fv-dir-btn:hover {
  background: #eff6ff;
  border-color: #2563eb;
}

.fv-dir-label {
  font-size: .8rem;
  color: #6b7280;
  min-width: 50px;
  text-align: center;
}

/* ── Data section (oculta por defecto) ───────────────────────── */

.fv-data-section {
  margin-top: 4px;
}

.fv-data-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  text-align: left;
}

.fv-data-toggle:hover {
  background: #f3f4f6;
}

.fv-data-toggle__arrow {
  font-size: .7rem;
  color: #9ca3af;
  transition: transform .2s;
}

.fv-data-toggle.is-open .fv-data-toggle__arrow {
  transform: rotate(180deg);
}

.fv-data {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 5px 20px;
  font-size: .82rem;
  margin-top: 8px;
  padding: 4px 2px;
}

.fv-data.is-open {
  display: grid;
}

.fv-data__key { color: #6b7280; }
.fv-data__val { font-weight: 500; color: #1f2937; }

/* ── Grid de imágenes / renders en modal ─────────────────────── */

.fv-toggle-count {
  font-weight: 400;
  color: #9ca3af;
  font-size: .78rem;
}

.fv-images-grid {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.fv-images-grid.is-open {
  display: grid;
}

.fv-images-grid a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  background: #f9fafb;
  transition: border-color .12s;
}

.fv-images-grid a:hover {
  border-color: #2563eb;
}

.fv-images-grid img {
  max-width: 60px;
  max-height: 60px;
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
}

/* ── Hover preview ───────────────────────────────────────────── */

.fv-preview {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  display: none;
}

.fv-preview img {
  max-width: 160px;
  max-height: 160px;
  image-rendering: pixelated;
  display: block;
}

/* ── Botón modo selección ────────────────────────────────────── */

.fv-select-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  font-size: .85rem;
  cursor: pointer;
  color: #374151;
  flex-shrink: 0;
}

.fv-select-toggle:hover {
  background: #f3f4f6;
}

.fv-select-toggle.is-active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

/* ── Cards en modo selección ─────────────────────────────────── */

.fv-wrap.is-selecting .fv-fav-btn {
  display: none;
}

.fv-wrap.is-selecting .fv-card,
.fv-wrap.is-selecting .fv-row {
  cursor: pointer;
  position: relative;
}

.fv-wrap.is-selecting .fv-card::before,
.fv-wrap.is-selecting .fv-row::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid transparent;
  pointer-events: none;
  transition: border-color .12s;
}

.fv-wrap.is-selecting .fv-card.is-selected,
.fv-wrap.is-selecting .fv-row.is-selected {
  border-color: #2563eb;
  background: #f0f9ff;
}

.fv-wrap.is-selecting .fv-card.is-selected::before,
.fv-wrap.is-selecting .fv-row.is-selected::before {
  border-color: #2563eb;
}

/* Checkmark en esquina superior derecha */
.fv-wrap.is-selecting .fv-card::after,
.fv-wrap.is-selecting .fv-row::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  background: #fff;
  transition: background .12s, border-color .12s;
}

.fv-wrap.is-selecting .fv-card.is-selected::after,
.fv-wrap.is-selecting .fv-row.is-selected::after {
  background: #2563eb;
  border-color: #2563eb;
  content: '✓';
  color: #fff;
  font-size: .6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ── Barra flotante de selección ─────────────────────────────── */

.fv-select-bar {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  border-radius: 12px;
  padding: 12px 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
  align-items: center;
  gap: 16px;
  z-index: 5000;
  white-space: nowrap;
}

.fv-select-bar.is-visible {
  display: flex;
}

.fv-select-bar__count {
  font-size: .9rem;
  font-weight: 600;
}

.fv-select-bar__actions {
  display: flex;
  gap: 8px;
}

.fv-select-bar__btn {
  padding: 7px 14px;
  border-radius: 8px;
  border: none;
  font-size: .85rem;
  cursor: pointer;
  font-weight: 600;
}

.fv-select-bar__btn--copy {
  background: #2563eb;
  color: #fff;
}

.fv-select-bar__btn--copy:hover {
  background: #1d4ed8;
}

.fv-select-bar__btn--clear {
  background: rgba(255,255,255,.15);
  color: #fff;
}

.fv-select-bar__btn--clear:hover {
  background: rgba(255,255,255,.25);
}

/* ── Cards del shortcode (en posts) ─────────────────────────── */

.fv-post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin: 10px;
}

.fv-post-grid > .fv-loader-wrap {
  grid-column: 1 / -1;
  padding: 30px 0;
}

.fv-post-card {
  padding: 12px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  background: #fff;
  transition: box-shadow .15s, transform .15s;
}

.fv-post-card:hover {
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.fv-post-card__icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
  margin: 0 auto;
}

.fv-post-card__icon.is-broken { display: none; }

.fv-post-card {
  position: relative;
}

.fv-post-card__new-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px #fff;
}

.fv-post-card__name {
  font-size: .78rem;
  font-weight: 600;
  color: #1f2937;
  margin-top: 6px;
  line-height: 1.3;
  overflow-wrap: break-word;
}

.fv-post-card__classname {
  font-size: .68rem;
  color: #6b7280;
  margin-top: 2px;
  word-break: break-all;
}

/* ── Vista real (shortcode view="real") ─────────────────────── */

.fv-post-grid--real {
  grid-template-columns: repeat(auto-fill, minmax(40px, max-content));
  gap: 4px;
}

.fv-post-grid--real .fv-post-card {
  padding: 8px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fv-post-card__icon--real {
  width: auto;
  height: auto;
  max-width: none;
  image-rendering: pixelated;
}

/* ── Badge Shortcode (en posts) ─────────────────────────────── */

.bv-post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.bv-post-grid--icon {
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 4px;
  justify-items: center;
}

.bv-post-grid--icon .bv-post-card {
  padding: 6px;
}

.bv-post-grid > .fv-loader-wrap {
  grid-column: 1 / -1;
  padding: 30px 0;
}

.bv-post-card {
  position: relative;
  padding: 12px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #fff;
  transition: box-shadow .15s, transform .15s;
  text-align: center;
}

.bv-post-card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,.08);
  transform: translateY(-2px);
}

.bv-post-card__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  width: 100%;
}

.bv-post-card__img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  image-rendering: pixelated;
}

.bv-post-card__img.is-broken { display: none; }

.bv-post-card__name {
  font-size: .72rem;
  font-weight: 600;
  color: #1f2937;
  margin-top: 6px;
  line-height: 1.3;
  overflow-wrap: break-word;
}

.bv-post-card__code {
  font-size: .62rem;
  color: #6b7280;
  margin-top: 2px;
  word-break: break-all;
}

.bv-post-card__new-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px #fff;
}

/* ── Badge Viewer ────────────────────────────────────────────── */

.bv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  padding: 4px 0;
}

.bv-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 6px 6px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s, transform .15s;
}

.bv-card:hover {
  box-shadow: 0 3px 8px rgba(0,0,0,.1);
  transform: translateY(-2px);
}

.bv-card--icon {
  padding: 8px 6px;
  justify-content: center;
  position: relative;
}

.bv-card--icon .fv-badge--new {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: .55rem;
  padding: 1px 4px;
  line-height: 1.4;
}

.bv-card--icon .bv-card__img {
  width: auto;
  height: auto;
}

.bv-card__img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.bv-card__img.is-broken { display: none; }

.bv-card__name {
  font-size: .65rem;
  font-weight: 600;
  color: #1f2937;
  margin-top: 5px;
  line-height: 1.2;
  overflow-wrap: break-word;
  width: 100%;
}

.bv-card__code {
  font-size: .6rem;
  color: #6b7280;
  margin-top: 2px;
  word-break: break-all;
  line-height: 1.2;
}

.bv-card__owners {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: .6rem;
  color: #2563eb;
  margin-top: 3px;
  font-weight: 600;
}

.bv-card__owners span {
  font-weight: 400;
  color: #9ca3af;
}

.bv-card__flag {
  width: 12px;
  height: 9px;
  object-fit: cover;
  border-radius: 1px;
  flex-shrink: 0;
}

.fv-post-card__badges {
  margin-top: 5px;
}

/* ── Badge Viewer — exclude hotel chips ─────────────────────── */

/* ── Badge Viewer — botón favoritos (results bar) ─────────── */

.bv-fav-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 5px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  font-size: .8rem;
  color: #374151;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}

.bv-fav-open-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.bv-fav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  line-height: 1;
}

.bv-fav-count:empty { display: none; }

/* ── Badge Viewer — corazón sobre la card ──────────────────── */

.bv-card {
  position: relative;
}

.bv-fav-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 4px;
  background: rgba(255,255,255,.85);
  color: #d1d5db;
  font-size: .7rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s, color .15s, background .15s;
  z-index: 1;
}

.bv-card:hover .bv-fav-btn,
.fv-card:hover .bv-fav-btn,
.fv-row:hover .bv-fav-btn,
.bv-fav-btn.is-fav {
  opacity: 1;
}

.bv-fav-btn.is-fav {
  color: #ef4444;
  background: rgba(255,255,255,.95);
}

.bv-fav-btn:hover {
  color: #ef4444;
  background: #fff;
}

/* ── Badge Viewer — panel de favoritos ─────────────────────── */

.bv-fav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 999999;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transition: opacity .25s ease;
}

.bv-fav-overlay.is-open { opacity: 1; pointer-events: auto; }

.bv-fav-panel {
  position: fixed;
  top: 25px;
  right: calc(-380px - 25px - 4px);
  width: 380px;
  max-width: calc(95vw - 50px);
  height: calc(100dvh - 50px);
  height: calc(100vh - 50px);
  background: #fff;
  box-shadow: 0 0 0 2px #000000;
  border: 2px solid #fff;
  border-radius: 10px;
  margin-right: 25px;
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  transition: right .25s ease;
}

.bv-fav-panel.is-open { right: 0; }

@media (max-width: 480px) {
  .bv-fav-panel {
    top: 0;
    right: -100vw;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    height: 100vh;
    margin-right: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
  .bv-fav-panel.is-open { right: 0; }
}

.bv-fav-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.bv-fav-panel__title {
  font-size: .95rem;
  font-weight: 700;
  color: #111827;
}

.bv-fav-panel__close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  font-size: .85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bv-fav-panel__close:hover { background: #f3f4f6; color: #111; }

.bv-fav-panel__actions {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.bv-fav-copy-btn,
.bv-fav-clear-btn {
  flex: 1;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  font-size: .78rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.bv-fav-copy-btn {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  font-weight: 600;
}

.bv-fav-copy-btn:hover { background: #dbeafe; }

.bv-fav-clear-btn {
  background: #fff;
  color: #6b7280;
}

.bv-fav-clear-btn:hover { background: #fef2f2; border-color: #fca5a5; color: #b91c1c; }

.bv-fav-copy-btn:disabled,
.bv-fav-clear-btn:disabled {
  opacity: .4;
  cursor: default;
}

.bv-fav-panel__list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.bv-fav-empty {
  padding: 32px 16px;
  text-align: center;
  color: #9ca3af;
  font-size: .85rem;
}

.bv-fav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid #f3f4f6;
}

.bv-fav-item:last-child { border-bottom: none; }

.bv-fav-item__img {
  object-fit: contain;
  flex-shrink: 0;
}

.bv-fav-item__img.is-broken { display: none; }

.bv-fav-item__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bv-fav-item__code {
  font-size: .75rem;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bv-fav-item__hotel {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .65rem;
  color: #6b7280;
}

.bv-fav-item__flag {
  width: 16px;
  height: 11px;
  object-fit: cover;
  border-radius: 1px;
}

.bv-fav-item__url {
  font-size: .6rem;
  color: #3b82f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}

.bv-fav-item__url:hover { text-decoration: underline; }

.bv-fav-remove,
.fv-fav-remove {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #9ca3af;
  font-size: .7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bv-fav-remove:hover,
.fv-fav-remove:hover { background: #fef2f2; color: #ef4444; }

/* ── Badge Viewer — exclude hotel chips ─────────────────────── */

.bv-exclude-hotels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.bv-exclude-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px 2px 4px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: .65rem;
  color: #374151;
  transition: background .15s, border-color .15s, color .15s;
  line-height: 1;
}

.bv-exclude-chip img {
  width: 18px;
  height: 12px;
  object-fit: cover;
  border-radius: 1px;
  flex-shrink: 0;
}

.bv-exclude-chip:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.bv-exclude-chip.is-excluded {
  background: #fef2f2;
  border-color: #ef4444;
  color: #b91c1c;
  font-weight: 600;
}

.bv-exclude-chip.is-excluded::after {
  content: '✕';
  font-size: .6rem;
  margin-left: 2px;
  opacity: .7;
}

.fv-post-card__error {
  font-size: .75rem;
  color: #9ca3af;
  padding: 8px 0;
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 640px) {
  .fv-layout {
    flex-direction: column;
  }

  .fv-sidebar {
    width: 100%;
    min-width: 0;
    max-height: 0;
    padding: 0 12px;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    position: static;
    overflow: hidden;
    transition: max-height .3s ease, padding .3s ease;
  }

  .fv-sidebar.is-open {
    max-height: 900px;
    padding: 16px 12px;
  }

  .fv-sidebar.is-collapsed {
    width: 100%;
    min-width: 0;
    padding: 0 12px;
    border-right: none;
    overflow: hidden;
  }

  .fv-content {
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
  }

  .fv-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
  }

  .fv-results-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
}
