:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  color: #111;
  background: #f7f7f8;
  --pub-image-aspect: 3 / 2;
  --site-gutter: 1.25rem;
  --site-content-max: 100%;
}

@media (min-width: 960px) {
  :root {
    --site-gutter: 1.5rem;
    --site-content-max: min(1440px, 100% - 2 * var(--site-gutter));
  }
}

@media (min-width: 1440px) {
  :root {
    --site-gutter: 2rem;
    --site-content-max: min(1680px, 100% - 2 * var(--site-gutter));
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a {
  color: #0b5cab;
}

.site-header,
.site-footer {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.75rem var(--site-gutter);
}

.site-shell {
  width: 100%;
  max-width: var(--site-content-max);
  margin-inline: auto;
}

.site-header {
  display: block;
}

.site-header .site-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
  font-weight: 700;
  text-decoration: none;
  color: inherit;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

main {
  width: 100%;
  max-width: var(--site-content-max);
  margin-inline: auto;
  padding: var(--site-gutter);
}

.site-footer {
  border-top: 1px solid #e5e7eb;
  border-bottom: none;
  margin-top: 2rem;
}

.hero {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.625rem 1rem;
  border-radius: 8px;
  background: #0b5cab;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.btn--secondary {
  background: #fff;
  color: #0b5cab;
  border: 1px solid #0b5cab;
}

.listing-results__grid,
.pub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

@media (min-width: 1280px) {
  .listing-results__grid,
  .pub-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.125rem;
  }
}

.pub-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(0 0 0 / 8%);
}

.pub-card__link {
  color: inherit;
  text-decoration: none;
  display: block;
}

.pub-media-frame {
  position: relative;
  width: 100%;
  aspect-ratio: var(--pub-image-aspect);
  background: #e5e7eb;
  overflow: hidden;
}

.pub-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pub-media-frame__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
}

.pub-card__media {
  border-radius: 12px 12px 0 0;
}

.pub-card__body {
  padding: 0.875rem;
}

.pub-card__title {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
}

.pub-card__specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 0.75rem;
  color: #64748b;
  font-size: 0.8125rem;
  line-height: 1.3;
}

.pub-card__pricing {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.375rem;
}

.pub-card__badge {
  align-self: flex-start;
  padding: 0.125rem 0.4375rem;
  border-radius: 4px;
  background: #dcfce7;
  color: #166534;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.pub-card__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.375rem;
  margin: 0;
  font-weight: 700;
  font-size: 1.125rem;
}

.pub-card__price-list {
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: line-through;
}

.detail-layout {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .detail-layout {
    grid-template-columns: 2fr 1fr;
  }
}

.detail-main {
  display: grid;
  gap: 1rem;
}

.detail-carousel-wrap {
  position: relative;
}

.detail-carousel {
  anchor-name: --detail-carousel;
  display: flex;
  gap: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  border-radius: 12px;
  scroll-marker-group: after;
}

.detail-carousel::-webkit-scrollbar {
  display: none;
}

.detail-carousel__slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.detail-carousel__frame {
  border-radius: 12px;
}

.detail-carousel__swipe-hint {
  display: none;
  margin: 0.5rem 0 0;
  text-align: center;
  font-size: 0.8125rem;
  color: #64748b;
}

@supports not selector(::scroll-marker) {
  .detail-carousel__swipe-hint {
    display: block;
  }
}

@supports selector(::scroll-button(*)) {
  .detail-carousel::scroll-button(*) {
    position: absolute;
    position-anchor: --detail-carousel;
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 999px;
    background: rgb(255 255 255 / 92%);
    color: #1e293b;
    font-size: 1.5rem;
    line-height: 1;
    box-shadow: 0 2px 8px rgb(15 23 42 / 18%);
    cursor: pointer;
    opacity: 0.92;
  }

  .detail-carousel::scroll-button(*):hover,
  .detail-carousel::scroll-button(*):focus-visible {
    opacity: 1;
  }

  .detail-carousel::scroll-button(*):disabled {
    opacity: 0.35;
    cursor: default;
  }

  .detail-carousel::scroll-button(left) {
    content: '‹' / 'Anterior';
    left: calc(anchor(left) + 0.75rem);
    top: calc(anchor(center) - 1.375rem);
  }

  .detail-carousel::scroll-button(right) {
    content: '›' / 'Siguiente';
    left: calc(anchor(right) - 3.5rem);
    top: calc(anchor(center) - 1.375rem);
  }

  .detail-carousel__swipe-hint {
    display: none;
  }
}

@supports selector(::scroll-marker) {
  .detail-carousel::scroll-marker-group {
    position: absolute;
    position-anchor: --detail-carousel;
    top: calc(anchor(bottom) - 2.25rem);
    left: calc(anchor(left) + 50%);
    translate: -50% 0;
    display: flex;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    border-radius: 999px;
    background: rgb(15 23 42 / 45%);
  }

  .detail-carousel__slide::scroll-marker {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: rgb(255 255 255 / 45%);
  }

  .detail-carousel__slide::scroll-marker:target-current {
    background: #fff;
    transform: scale(1.15);
  }
}

.lead-form {
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
}

.lead-form label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.lead-form input,
.lead-form textarea {
  padding: 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}

.lead-form button {
  padding: 0.625rem 1rem;
  border: 0;
  border-radius: 8px;
  background: #0b5cab;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.gpt-ad__skeleton {
  width: 100%;
  max-width: 970px;
  height: 90px;
  margin: 1rem auto;
  background: linear-gradient(90deg, #eceff3 25%, #f8fafc 50%, #eceff3 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

.gpt-ad__loaded {
  animation: none;
  background: #eef2f7;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.hub-page {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
}

.listing-results__pagination {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
}

.search-wizard__layout {
  display: grid;
  gap: 1rem;
}

@media (min-width: 960px) {
  .search-wizard__layout {
    grid-template-columns: 320px 1fr;
    align-items: start;
  }
}

.search-wizard__sidebar {
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / 8%);
  position: sticky;
  top: 1rem;
}

.wizard-filters {
  display: grid;
  gap: 0.875rem;
}

.wizard-filters__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.wizard-filters__header h2 {
  margin: 0;
  font-size: 1.125rem;
}

.wizard-filters__clear {
  border: 0;
  background: none;
  color: #0b5cab;
  cursor: pointer;
  font-size: 0.875rem;
  text-decoration: underline;
}

.wizard-filters__count {
  color: #666;
  font-size: 0.8125rem;
  margin-left: auto;
}

.wizard-filters__hint {
  margin: 0;
  font-size: 0.8125rem;
  color: #555;
}

.wizard-price-row {
  display: grid;
  gap: 0.5rem;
}

.wizard-select-label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.8125rem;
  color: #444;
}

.wizard-select-label select {
  width: 100%;
  padding: 0.5rem 0.625rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font-size: 0.875rem;
}

.wizard-body-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.375rem;
}

.wizard-body-btn {
  display: grid;
  gap: 0.25rem;
  justify-items: center;
  padding: 0.5rem 0.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 0.6875rem;
  line-height: 1.2;
  color: #334155;
  transition: border-color 0.15s, background 0.15s;
}

.wizard-body-btn img {
  width: 100%;
  max-width: 72px;
  height: auto;
  object-fit: contain;
}

.wizard-body-btn.is-selected {
  border-color: #0b5cab;
  background: #eff6ff;
  color: #0b5cab;
}

.wizard-body-btn__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wizard-filter-menus {
  display: grid;
  gap: 0.375rem;
}

.wizard-menu {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.wizard-menu summary {
  padding: 0.625rem 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wizard-menu summary::-webkit-details-marker {
  display: none;
}

.wizard-menu summary::after {
  content: '▾';
  font-size: 0.75rem;
  color: #64748b;
}

.wizard-menu[open] summary::after {
  transform: rotate(180deg);
}

.wizard-menu__panel {
  padding: 0 0.75rem 0.75rem;
  border-top: 1px solid #f1f5f9;
}

.wizard-menu__panel--row {
  display: grid;
  gap: 0.5rem;
  padding-top: 0.625rem;
}

.wizard-menu__search {
  width: 100%;
  margin-top: 0.625rem;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.625rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.875rem;
}

.wizard-menu__options {
  display: grid;
  gap: 0.25rem;
  max-height: 220px;
  overflow-y: auto;
}

.wizard-menu__option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0;
  font-size: 0.875rem;
  cursor: pointer;
}

.wizard-menu__option--icon img {
  flex-shrink: 0;
}

.wizard-menu__empty {
  margin: 0.625rem 0 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.wizard-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.wizard-chip {
  border: 0;
  border-radius: 999px;
  padding: 0.25rem 0.625rem;
  background: #e2e8f0;
  color: #1e293b;
  font-size: 0.75rem;
  cursor: pointer;
}

.wizard-chip:hover {
  background: #cbd5e1;
}

/* Legacy fieldset styles kept for compatibility */
.wizard-filters__group {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.375rem;
}

.wizard-filters__group legend {
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.wizard-filters__check {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.9375rem;
}

.wizard-filters__range {
  display: grid;
  gap: 0.5rem;
}

.wizard-filters__range label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.wizard-filters__range input,
.wizard-filters select {
  padding: 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}

.search-wizard__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.search-wizard__count {
  margin: 0;
  font-weight: 600;
}

.search-wizard__sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.search-wizard__sort select {
  padding: 0.375rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}

body.wizard-filters-open {
  overflow: hidden;
}

.search-wizard--loading [data-results-grid] {
  opacity: 0.55;
  pointer-events: none;
}

/* Mobile filter modal */
.wizard-filters__header--mobile {
  display: none;
}

.wizard-filters__mobile-footer {
  display: none;
}

.wizard-mobile-open {
  display: none;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.wizard-mobile-backdrop {
  display: none;
}

.wizard-mobile-close {
  border: 0;
  background: none;
  font-size: 1.75rem;
  line-height: 1;
  color: #334155;
  cursor: pointer;
  padding: 0 0.25rem;
}

.wizard-chips--results {
  margin-bottom: 0.75rem;
}

@media (max-width: 959px) {
  .search-wizard__sidebar {
    position: fixed;
    inset: 0;
    z-index: 300;
    transform: translateX(100%);
    transition: transform 0.22s ease;
    border-radius: 0;
    padding: 0;
    max-height: 100dvh;
    box-shadow: -4px 0 24px rgb(0 0 0 / 12%);
    visibility: hidden;
    pointer-events: none;
  }

  .search-wizard__sidebar.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .wizard-filters {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    gap: 0;
  }

  .wizard-filters__header--desktop,
  .wizard-filters__desktop-only {
    display: none !important;
  }

  .wizard-filters__header--mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
  }

  .wizard-filters__header--mobile h2 {
    margin: 0;
    font-size: 1.0625rem;
    flex: 1;
    text-align: center;
  }

  .wizard-filters__sections {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
  }

  .wizard-section {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
  }

  .wizard-section--always-visible > .wizard-section__summary {
    display: list-item;
  }

  .wizard-section--always-visible > .wizard-menu__panel {
    border-top: 1px solid #f1f5f9;
  }

  .wizard-menu summary {
    padding: 1rem;
    font-size: 1rem;
  }

  .wizard-menu__options {
    max-height: none;
  }

  .wizard-body-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wizard-filters__mobile-footer {
    display: block;
    flex-shrink: 0;
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
    background: #fff;
  }

  .wizard-filters__mobile-apply {
    width: 100%;
    border: 0;
    cursor: pointer;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-weight: 600;
  }

  .wizard-mobile-open {
    display: inline-flex;
  }

  .wizard-mobile-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 299;
    background: rgb(15 23 42 / 45%);
  }

  .wizard-mobile-backdrop[hidden] {
    display: none;
  }

  .search-wizard__toolbar {
    flex-wrap: wrap;
  }
}

@media (min-width: 960px) {
  .wizard-section--always-visible {
    border: none;
    background: transparent;
  }

  .wizard-section--always-visible > .wizard-section__summary {
    display: none;
  }

  .wizard-section--always-visible > .wizard-menu__panel {
    border-top: none;
    padding: 0;
    display: block !important;
  }

  .wizard-filters__sections {
    display: grid;
    gap: 0.875rem;
  }

  .wizard-chips--results {
    display: none !important;
  }
}
