/* ==========================================================================
   TOURS ARCHIVE — PREMIUM RESPONSIVE
   --------------------------------------------------------------------------
   Fondo: Off-White Slate
   Tarjetas: White
   Color de marca: var(--color-primary)
   Responsive: Desktop / Tablet / Mobile
   ========================================================================== */

/* ==========================================================================
   01. BASE
   ========================================================================== */

.tours-archive-page {
  background: #f8fafc;
  color: #334155;
  font-family: inherit;
  line-height: 1.625;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.tours-archive-page *,
.tours-archive-page *::before,
.tours-archive-page *::after {
  box-sizing: border-box;
}

.tours-archive-page img {
  display: block;
  max-width: 100%;
}

.tours-archive-page button,
.tours-archive-page input,
.tours-archive-page select {
  font: inherit;
}

.tours-archive-page .container {
  width: min(100% - 48px, 1200px);
  margin-inline: auto;
}

/* ==========================================================================
   02. ICONOS
   ========================================================================== */

.tours-archive-page .icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 36px;
  height: 36px;
  flex: 0 0 36px;

  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 9%, transparent);

  border: 1px solid color-mix(in srgb, var(--color-primary) 17%, transparent);

  border-radius: 10px;
  font-size: 14px;

  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease;
}

.tours-archive-page .icon-box--lg {
  width: 52px;
  height: 52px;
  flex-basis: 52px;

  border-radius: 14px;
  font-size: 20px;
}

/* ==========================================================================
   03. LAYOUT PRINCIPAL
   ========================================================================== */

.tours-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

/* ==========================================================================
   04. SIDEBAR / FILTROS
   ========================================================================== */

.tours-sidebar {
  position: sticky;
  top: 24px;

  min-width: 0;

  padding: 24px;

  background: #fff;

  border: 1px solid color-mix(in srgb, var(--color-primary) 10%, #e2e8f0);

  border-radius: 18px;

  box-shadow: 0 5px 20px rgba(15, 23, 42, 0.045);
}

.tours-filter-title {
  display: flex;
  align-items: center;
  justify-content: space-between;

  width: 100%;

  margin: 0;
  padding: 0 0 18px;

  background: none;
  border: 0;
  border-bottom: 1px solid #e2e8f0;

  color: #0f172a;

  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;

  text-align: left;
  cursor: default;
}

.tours-filter-title__text {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.tours-filter-title__chevron {
  display: none;

  flex-shrink: 0;

  color: #64748b;
  font-size: 14px;

  transition: transform 0.25s ease;
}

/* ==========================================================================
   05. CAMPOS DE FILTRO
   ========================================================================== */

.filter-group {
  margin-top: 18px;
}

.filter-group label {
  display: block;

  margin: 0 0 7px;

  color: #334155;

  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;

  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.filter-group select,
.filter-group input {
  width: 100%;
  min-width: 0;

  padding: 10px 13px;

  background: #f8fafc;

  border: 1px solid #e2e8f0;
  border-radius: 9px;

  color: #0f172a;

  font-size: 14px;
  line-height: 1.4;

  transition:
    border-color 0.25s ease,
    background-color 0.25s ease,
    box-shadow 0.25s ease;
}

.filter-group select {
  appearance: none;
  -webkit-appearance: none;

  padding-right: 38px;

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 15px;

  cursor: pointer;
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;

  background-color: #fff;

  border-color: var(--color-primary);

  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--color-primary) 10%, transparent);
}

.filter-group__input-icon {
  position: relative;
}

.filter-group__input-icon input {
  padding-right: 38px;
}

.filter-group__input-icon .icon {
  position: absolute;

  top: 50%;
  right: 13px;

  transform: translateY(-50%);

  color: #94a3b8;
  font-size: 13px;

  pointer-events: none;
}

/* ==========================================================================
   06. ACCIONES DE FILTRO
   ========================================================================== */

.filter-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;

  margin-top: 22px;
}

.btn-filter,
.btn-reset {
  display: flex;
  align-items: center;
  justify-content: center;

  min-height: 42px;

  gap: 8px;

  border-radius: 9px;

  font-size: 14px;
  font-weight: 700;

  text-decoration: none;

  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.btn-filter {
  padding: 10px 14px;

  background: var(--color-primary);
  color: #fff;

  border: 1px solid var(--color-primary);

  cursor: pointer;
}

.btn-filter:hover {
  background: color-mix(in srgb, var(--color-primary) 86%, black);

  border-color: color-mix(in srgb, var(--color-primary) 86%, black);

  transform: translateY(-1px);

  box-shadow: 0 7px 18px
    color-mix(in srgb, var(--color-primary) 18%, transparent);
}

.btn-reset {
  padding: 10px 14px;

  background: #fff;
  color: #475569;

  border: 1px solid #e2e8f0;
}

.btn-reset:hover {
  background: color-mix(in srgb, var(--color-primary) 5%, #fff);

  color: color-mix(in srgb, var(--color-primary) 75%, #0f172a);

  border-color: color-mix(in srgb, var(--color-primary) 28%, #e2e8f0);
}

/* ==========================================================================
   07. AYUDA DEL SIDEBAR
   ========================================================================== */

.tours-sidebar__help {
  margin-top: 22px;
  padding: 20px 16px;

  background: color-mix(in srgb, var(--color-primary) 5%, #fff);

  border: 1px solid color-mix(in srgb, var(--color-primary) 13%, #e2e8f0);

  border-radius: 14px;

  text-align: center;
}

.tours-sidebar__help .icon-box {
  margin: 0 auto 12px;
}

.tours-sidebar__help h4 {
  margin: 0 0 6px;

  color: #0f172a;

  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.tours-sidebar__help p {
  margin: 0 0 15px;

  color: #64748b;

  font-size: 12.5px;
  line-height: 1.55;
}

/* ==========================================================================
   08. MAIN — CABECERA
   ========================================================================== */

.tours-main {
  min-width: 0;
}

.tours-main__header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 16px;

  margin-bottom: 20px;
  padding: 10px 14px;

  background: color-mix(in srgb, var(--color-primary) 5%, #fff);

  border: 1px solid color-mix(in srgb, var(--color-primary) 9%, #e2e8f0);

  border-radius: 13px;
}

.tours-main__count {
  margin: 0;

  color: #64748b;

  font-size: 14px;
  line-height: 1.4;
}

.tours-main__count strong {
  color: #0f172a;

  font-size: 19px;
  font-weight: 800;
}

.tours-sort {
  display: flex;
  align-items: center;

  gap: 9px;

  flex-shrink: 0;
}

.tours-sort label {
  color: #64748b;

  font-size: 12.5px;
  font-weight: 600;

  white-space: nowrap;
}

.tours-sort select {
  appearance: none;
  -webkit-appearance: none;

  min-width: 155px;

  padding: 9px 34px 9px 12px;

  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E")
    no-repeat right 11px center;

  background-size: 15px;

  border: 1px solid #e2e8f0;
  border-radius: 9px;

  color: #0f172a;

  font-size: 13px;
  font-weight: 600;

  cursor: pointer;
}

.tours-sort select:focus {
  outline: none;

  border-color: var(--color-primary);

  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 9%, transparent);
}

/* ==========================================================================
   09. GRID DE TOURS
   ========================================================================== */

.tours-grid {
  display: grid;

  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));

  gap: 22px;
}

/* ==========================================================================
   10. TOUR CARD
   ========================================================================== */

.tour-card {
  min-width: 0;
  height: 100%;
}

.tour-card__link {
  display: flex;
  flex-direction: column;

  height: 100%;
  min-width: 0;

  overflow: hidden;

  background: #fff;

  border: 1px solid color-mix(in srgb, var(--color-primary) 8%, #e2e8f0);

  border-radius: 17px;

  box-shadow: 0 5px 18px
    color-mix(in srgb, var(--color-primary) 5%, rgba(15, 23, 42, 0.07));

  text-decoration: none;

  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.tour-card__link:hover {
  transform: translateY(-4px);

  border-color: color-mix(in srgb, var(--color-primary) 32%, #e2e8f0);

  box-shadow: 0 13px 30px
    color-mix(in srgb, var(--color-primary) 11%, rgba(15, 23, 42, 0.09));
}

/* ==========================================================================
   11. IMAGEN DEL TOUR
   ========================================================================== */

.tour-card__img {
  position: relative;

  width: 100%;

  aspect-ratio: 4 / 3;

  overflow: hidden;

  background: #f1f5f9;

  border-bottom: 1px solid #e2e8f0;
}

.tour-card__img img {
  width: 100%;
  height: 100%;

  object-fit: cover;

  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.tour-card__link:hover .tour-card__img img {
  transform: scale(1.045);
}

.tour-card__placeholder {
  width: 100%;
  height: 100%;

  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}

/* ==========================================================================
   12. BADGE DURACIÓN
   ========================================================================== */

.tour-card__duration-badge {
  position: absolute;

  top: 11px;
  right: 11px;

  display: inline-flex;
  align-items: center;

  gap: 5px;

  padding: 6px 10px;

  background: rgba(255, 255, 255, 0.94);

  border: 1px solid color-mix(in srgb, var(--color-primary) 12%, transparent);

  border-radius: 999px;

  color: #0f172a;

  font-size: 11px;
  font-weight: 800;

  line-height: 1;

  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);

  backdrop-filter: blur(5px);
}

.tour-card__duration-badge .icon {
  color: var(--color-primary);
}

/* ==========================================================================
   13. BODY DEL CARD
   --------------------------------------------------------------------------
   IMPORTANTE:
   Aquí está el padding real del contenido.
   El título ya no queda pegado a los bordes.
   ========================================================================== */

.tour-card__body {
  display: flex;
  flex-direction: column;

  flex: 1;
  min-width: 0;

  padding: 18px 19px 19px;
}

/* ==========================================================================
   14. DESTINO DEL TOUR
   ========================================================================== */

.tour-card__destination {
  display: inline-flex;
  align-items: center;

  align-self: flex-start;

  max-width: 100%;

  gap: 6px;

  margin: 0 0 8px;

  color: var(--color-primary);

  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;

  letter-spacing: 0.045em;
  text-transform: uppercase;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tour-card__destination .icon {
  flex-shrink: 0;
}

/* ==========================================================================
   15. TÍTULO DEL TOUR
   --------------------------------------------------------------------------
   El título tiene su propio espacio y no se pega al contenido.
   ========================================================================== */

.tour-card__title {
  display: -webkit-box;

  margin: 0 0 12px;

  color: #0f172a;

  font-size: 18px;
  font-weight: 750;
  line-height: 1.35;

  letter-spacing: -0.015em;

  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* ==========================================================================
   16. PRECIO
   ========================================================================== */

.tour-card__price {
  margin: auto 0 14px;

  color: #64748b;

  font-size: 13px;
  line-height: 1.4;
}

.tour-card__price strong {
  color: #0f172a;

  font-size: 17px;
  font-weight: 800;
}

/* ==========================================================================
   17. BOTÓN DEL CARD
   --------------------------------------------------------------------------
   El HTML utiliza .ac__button, no .tour-card__btn.
   ========================================================================== */

.tour-card__body .ac__button {
  align-self: flex-start;

  max-width: 100%;
}

/* ==========================================================================
   18. PAGINACIÓN
   ========================================================================== */

.tours-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;

  gap: 7px;

  margin-top: 40px;
}

.tours-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 40px;
  height: 40px;

  padding: 0 12px;

  background: #fff;

  border: 1px solid #e2e8f0;
  border-radius: 9px;

  color: #0f172a;

  font-size: 13px;
  font-weight: 700;

  text-decoration: none;

  transition:
    color 0.25s ease,
    background-color 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease;
}

.tours-pagination a.page-numbers:hover {
  color: var(--color-primary);

  border-color: color-mix(in srgb, var(--color-primary) 35%, #e2e8f0);

  background: color-mix(in srgb, var(--color-primary) 5%, #fff);

  transform: translateY(-1px);
}

.tours-pagination .current {
  background: var(--color-primary);

  border-color: var(--color-primary);

  color: #fff;
}

.tours-pagination .dots {
  background: transparent;
  border: 0;
}

/* ==========================================================================
   19. EMPTY STATE
   ========================================================================== */

.tours-empty {
  padding: 48px 28px;

  background: #fff;

  border: 1px solid #e2e8f0;
  border-radius: 18px;

  box-shadow: 0 5px 18px rgba(15, 23, 42, 0.035);

  text-align: center;
}

.tours-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 60px;
  height: 60px;

  margin: 0 auto 16px;

  background: color-mix(in srgb, var(--color-primary) 8%, #fff);

  border: 1px solid color-mix(in srgb, var(--color-primary) 13%, transparent);

  border-radius: 15px;

  color: var(--color-primary);

  font-size: 22px;
}

.tours-empty h3 {
  margin: 0 0 7px;

  color: #0f172a;

  font-size: 20px;
  font-weight: 800;
}

.tours-empty p {
  max-width: 520px;

  margin: 0 auto 20px;

  color: #64748b;

  font-size: 14px;
  line-height: 1.6;
}

.tours-empty .btn-reset {
  display: inline-flex;

  width: auto;
  max-width: 220px;

  margin-inline: auto;
}

/* ==========================================================================
   20. TABLET — 769px a 992px
   ========================================================================== */

@media (min-width: 769px) and (max-width: 992px) {
  .tours-archive-page .container {
    width: min(100% - 40px, 920px);
  }

  .tours-layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .tours-sidebar {
    position: static;
  }

  .tours-sidebar__help {
    display: none;
  }

  .tours-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 18px;
  }

  .tour-card__body {
    padding: 16px;
  }

  .tour-card__title {
    font-size: 17px;
  }
}

/* ==========================================================================
   21. TABLET PEQUEÑA / MÓVIL — <= 768px
   ========================================================================== */

@media (max-width: 768px) {
  .tours-archive-page .container {
    width: min(100% - 32px, 620px);
  }

  .tours-archive-page .ac__hero-content {
    padding: 28px 0 48px;
  }

  /* ---------- LAYOUT ---------- */

  .tours-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* ---------- SIDEBAR ---------- */

  .tours-sidebar {
    position: static;

    padding: 17px;

    border-radius: 15px;
  }

  .tours-filter-title {
    padding: 0;

    border-bottom: 0;

    font-size: 14px;

    cursor: pointer;
  }

  .tours-filter-title__text {
    gap: 10px;
  }

  .tours-filter-title__chevron {
    display: block;
  }

  .tours-filter-title[aria-expanded="true"] .tours-filter-title__chevron {
    transform: rotate(180deg);
  }

  .tours-filter-fields {
    display: none;
  }

  .tours-sidebar.is-open .tours-filter-fields {
    display: block;
  }

  .tours-sidebar.is-open .tours-filter-title {
    margin-bottom: 15px;
    padding-bottom: 12px;

    border-bottom: 1px solid #e2e8f0;
  }

  .filter-group {
    margin-top: 14px;
  }

  .filter-actions {
    flex-direction: row;

    gap: 7px;

    margin-top: 17px;
  }

  .btn-filter,
  .btn-reset {
    flex: 1;

    min-height: 40px;

    padding: 9px 10px;

    font-size: 12.5px;
  }

  .tours-sidebar__help {
    display: none;
  }

  /* ---------- HEADER DEL LISTADO ---------- */

  .tours-main__header {
    align-items: center;

    gap: 10px;

    margin-bottom: 15px;

    padding: 10px 12px;

    border-radius: 11px;
  }

  .tours-main__count {
    font-size: 12.5px;
  }

  .tours-main__count strong {
    font-size: 16px;
  }

  .tours-sort {
    min-width: 0;
  }

  .tours-sort label {
    display: none;
  }

  .tours-sort select {
    min-width: 135px;

    padding: 7px 29px 7px 9px;

    background-position: right 9px center;
    background-size: 14px;

    font-size: 12px;
  }

  /* ---------- GRID ---------- */

  .tours-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  /* ---------- CARD VERTICAL CONSISTENTE ---------- */

  .tour-card__link {
    flex-direction: column;
    min-height: auto;
    border-radius: 16px;
  }

  .tour-card__img {
    width: 100%;
    max-width: none;
    aspect-ratio: 4 / 3;
    flex-basis: auto;
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
  }

  .tour-card__duration-badge {
    top: 10px;
    right: 10px;
    left: auto;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.94);
    color: #0f172a;
    font-size: 11px;
    border: 1px solid color-mix(in srgb, var(--color-primary) 12%, transparent);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
  }

  .tour-card__duration-badge .icon {
    color: var(--color-primary);
  }

  /* ---------- BODY ---------- */

  .tour-card__body {
    width: 100%;
    padding: 16px 17px 18px;
  }

  /* ---------- DESTINO ---------- */

  .tour-card__destination {
    margin-bottom: 7px;
    font-size: 11px;
  }

  /* ---------- TÍTULO ---------- */

  .tour-card__title {
    margin-bottom: 10px;
    font-size: 17px;
    line-height: 1.35;
  }

  /* ---------- PRECIO ---------- */

  .tour-card__price {
    margin-bottom: 12px;
    font-size: 12.5px;
  }

  .tour-card__price strong {
    font-size: 16px;
  }

  /* ---------- BOTÓN ---------- */

  .tour-card__body .ac__button {
    align-self: flex-start;
    max-width: 100%;
  }

  /* ---------- PAGINACIÓN ---------- */

  .tours-pagination {
    margin-top: 30px;
  }
}

/* ==========================================================================
   22. MÓVIL PEQUEÑO — <= 440px
   ========================================================================== */

@media (max-width: 440px) {
  .tours-archive-page .container {
    width: calc(100% - 28px);
  }

  .tours-archive-page .ac__hero-content {
    padding: 24px 0 40px;
  }

  /* ---------- HEADER ---------- */

  .tours-main__header {
    padding: 9px 10px;
  }

  .tours-main__count {
    font-size: 12px;
  }

  .tours-main__count strong {
    font-size: 15px;
  }

  .tours-sort select {
    min-width: 125px;
    padding: 7px 27px 7px 8px;
    font-size: 11.5px;
  }

  /* ---------- CARD ---------- */

  .tour-card__link {
    border-radius: 15px;
  }

  .tour-card__img {
    aspect-ratio: 4 / 3;
  }

  .tour-card__duration-badge {
    top: 9px;
    right: 9px;
    left: auto;
    padding: 5px 9px;
    font-size: 10.5px;
  }

  .tour-card__body {
    padding: 15px 16px 17px;
  }

  .tour-card__destination {
    margin-bottom: 6px;
    font-size: 10.5px;
  }

  .tour-card__title {
    margin-bottom: 9px;
    font-size: 16px;
    line-height: 1.35;
  }

  .tour-card__price {
    margin-bottom: 12px;
    font-size: 12px;
  }

  .tour-card__price strong {
    font-size: 15.5px;
  }

  .tour-card__body .ac__button {
    align-self: flex-start;
  }
}

/* ==========================================================================
   23. MÓVIL MUY PEQUEÑO — <= 360px
   ========================================================================== */

@media (max-width: 360px) {
  .tours-archive-page .container {
    width: calc(100% - 24px);
  }

  .tours-main__header {
    flex-direction: column;
    align-items: stretch;
  }

  .tours-main__count {
    text-align: left;
  }

  .tours-sort {
    width: 100%;
  }

  .tours-sort select {
    width: 100%;
  }

  .tour-card__body {
    padding: 14px;
  }

  .tour-card__title {
    font-size: 15px;
  }

  .tour-card__price strong {
    font-size: 15px;
  }
}

/* ==========================================================================
   24. REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .tours-archive-page *,
  .tours-archive-page *::before,
  .tours-archive-page *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
