/* ==========================================================================
   ByEssenss — Alojamientos Styles
   Matches site aesthetic: luxury calm, earth tones, Playfair Display
   ========================================================================== */

/* ---------- Variables ---------- */
:root {
  --bye-gold: #cdaa7c;
  --bye-gold-light: #e0c9a6;
  --bye-dark: #2c2c2c;
  --bye-text: #555555;
  --bye-text-light: #818181;
  --bye-bg: #ffffff;
  --bye-bg-cream: #faf8f5;
  --bye-bg-warm: #f5f0ea;
  --bye-border: #e8e2da;
  --bye-shadow: rgba(44, 44, 44, 0.08);
  --bye-shadow-hover: rgba(205, 170, 124, 0.18);
  --bye-radius: 4px;
  --bye-transition: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ---------- Hero Section ---------- */
.bye-hero {
  position: relative;
  width: 100%;
  height: 55vh;
  min-height: 380px;
  max-height: 550px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bye-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.bye-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(44, 44, 44, 0.15) 0%,
    rgba(44, 44, 44, 0.45) 100%
  );
}

.bye-hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 20px;
}

.bye-hero__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 400;
  color: #ffffff;
  letter-spacing: 0.08em;
  margin: 0;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.bye-hero__subtitle {
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 12px;
}

/* ---------- Filters Section ---------- */
.bye-filters {
  background: var(--bye-bg);
  padding: 28px 0;
  border-bottom: 1px solid var(--bye-border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow var(--bye-transition);
}

.bye-filters.is-stuck {
  box-shadow: 0 4px 20px var(--bye-shadow);
}

.bye-filters__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.bye-filters__label {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.95rem;
  color: var(--bye-dark);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.bye-filter-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bye-bg);
  border: 1px solid var(--bye-border);
  border-radius: var(--bye-radius);
  padding: 10px 36px 10px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--bye-text);
  cursor: pointer;
  transition: border-color var(--bye-transition), box-shadow var(--bye-transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23818181' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  min-width: 160px;
}

.bye-filter-select:hover {
  border-color: var(--bye-gold-light);
}

.bye-filter-select:focus {
  outline: none;
  border-color: var(--bye-gold);
  box-shadow: 0 0 0 3px rgba(205, 170, 124, 0.15);
}

.bye-filter-select.is-active {
  border-color: var(--bye-gold);
  background-color: rgba(205, 170, 124, 0.04);
}

.bye-filters__reset {
  background: none;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--bye-text-light);
  cursor: pointer;
  padding: 10px 0;
  letter-spacing: 0.04em;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--bye-transition);
  margin-left: auto;
}

.bye-filters__reset:hover {
  color: var(--bye-gold);
}

.bye-filters__count {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--bye-text-light);
  white-space: nowrap;
}

/* ---------- Grid Section ---------- */
.bye-grid-section {
  background: var(--bye-bg-cream);
  padding: 48px 0 64px;
  min-height: 400px;
}

.bye-grid-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.bye-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  transition: opacity var(--bye-transition);
}

.bye-grid.is-loading {
  opacity: 0.35;
  pointer-events: none;
}

/* ---------- Card ---------- */
.bye-card {
  background: var(--bye-bg);
  border-radius: var(--bye-radius);
  overflow: hidden;
  box-shadow: 0 2px 12px var(--bye-shadow);
  transition: transform var(--bye-transition), box-shadow var(--bye-transition);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(16px);
  animation: byeCardIn 0.5s ease forwards;
}

.bye-card:nth-child(1) { animation-delay: 0.05s; }
.bye-card:nth-child(2) { animation-delay: 0.1s; }
.bye-card:nth-child(3) { animation-delay: 0.15s; }
.bye-card:nth-child(4) { animation-delay: 0.2s; }
.bye-card:nth-child(5) { animation-delay: 0.25s; }
.bye-card:nth-child(6) { animation-delay: 0.3s; }
.bye-card:nth-child(7) { animation-delay: 0.35s; }
.bye-card:nth-child(8) { animation-delay: 0.4s; }
.bye-card:nth-child(9) { animation-delay: 0.45s; }
.bye-card:nth-child(10) { animation-delay: 0.5s; }

@keyframes byeCardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bye-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px var(--bye-shadow-hover);
}

.bye-card__image-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.bye-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.bye-card:hover .bye-card__image {
  transform: scale(1.06);
}

.bye-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 50%,
    rgba(44, 44, 44, 0.35) 100%
  );
  opacity: 0;
  transition: opacity var(--bye-transition);
}

.bye-card:hover .bye-card__overlay {
  opacity: 1;
}

.bye-card__badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  z-index: 2;
}

.bye-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.bye-badge--ubicacion {
  background: rgba(255, 255, 255, 0.88);
  color: var(--bye-dark);
}

.bye-badge--pets {
  background: rgba(76, 175, 80, 0.85);
  color: #ffffff;
}

.bye-badge--adults {
  background: rgba(205, 170, 124, 0.88);
  color: #ffffff;
}

.bye-badge--experiencia {
  background: rgba(121, 85, 72, 0.82);
  color: #ffffff;
}

.bye-badge__icon {
  font-size: 0.75rem;
  line-height: 1;
}

/* Card body */
.bye-card__body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.bye-card__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--bye-dark);
  margin: 0 0 8px;
  line-height: 1.3;
}

.bye-card__location {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: var(--bye-text-light);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 14px;
}

.bye-card__location::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23818181' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.bye-card__excerpt {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--bye-text);
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bye-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--bye-gold);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: gap var(--bye-transition), color var(--bye-transition);
  margin-top: auto;
}

.bye-card__link:hover {
  color: var(--bye-dark);
  gap: 10px;
}

.bye-card__link::after {
  content: '→';
  transition: transform var(--bye-transition);
}

.bye-card:hover .bye-card__link::after {
  transform: translateX(3px);
}

/* ---------- Loading State ---------- */
.bye-loader {
  display: none;
  justify-content: center;
  align-items: center;
  padding: 48px 0;
}

.bye-loader.is-active {
  display: flex;
}

.bye-loader__spinner {
  width: 36px;
  height: 36px;
  border: 2px solid var(--bye-border);
  border-top-color: var(--bye-gold);
  border-radius: 50%;
  animation: byeSpin 0.8s linear infinite;
}

@keyframes byeSpin {
  to { transform: rotate(360deg); }
}

/* ---------- No Results ---------- */
.bye-no-results {
  text-align: center;
  padding: 64px 20px;
  display: none;
}

.bye-no-results.is-active {
  display: block;
}

.bye-no-results__icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.bye-no-results__text {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  color: var(--bye-text-light);
}

.bye-no-results__sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--bye-text-light);
  margin-top: 8px;
}

/* ---------- Single Alojamiento ---------- */

.single-alojamientos .post_text_inner,
.single-alojamiento .post_text_inner {
  padding: 0 !important;
}

.bye-single-hero {
  position: relative;
  width: 100%;
  height: 60vh;
  min-height: 400px;
  max-height: 600px;
  overflow: hidden;
}

.bye-single-hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bye-single-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 40%,
    rgba(44, 44, 44, 0.5) 100%
  );
}

.bye-single-hero__content {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 2;
  padding: 0 20px;
}

.bye-single-hero__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 400;
  color: #ffffff;
  margin: 0;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
}

.bye-single-hero__meta {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.bye-single-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}

.bye-single-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--bye-gold);
  text-decoration: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 32px;
  transition: gap var(--bye-transition);
}

.bye-single-back:hover {
  gap: 12px;
}

.bye-single-back::before {
  content: '←';
}

.bye-single-nav {
  display: flex;
  justify-content: space-between;
  padding: 32px 0;
  border-top: 1px solid var(--bye-border);
  margin-top: 48px;
}

.bye-single-nav__link {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--bye-text-light);
  text-decoration: none;
  transition: color var(--bye-transition);
}

.bye-single-nav__link:hover {
  color: var(--bye-gold);
}

/* ---------- Recommended Section ---------- */
.bye-recomendados {
  padding: 80px 0;
  border-top: 1px solid var(--bye-border);
  border-bottom: 1px solid var(--bye-border);
}

.bye-recomendados__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.bye-recomendados__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 400;
  color: var(--bye-dark);
  text-align: center;
  letter-spacing: 0.06em;
  margin: 0 0 48px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .bye-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
  }

  .bye-filters__inner {
    gap: 12px;
  }

  .bye-filter-select {
    min-width: 140px;
    font-size: 0.82rem;
  }
}

@media (max-width: 768px) {
  .bye-hero {
    height: 40vh;
    min-height: 280px;
  }

  .bye-filters {
    padding: 20px 0;
  }

  .bye-filters__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .bye-filters__label {
    margin-bottom: 4px;
  }

  .bye-filter-select {
    width: 100%;
    min-width: unset;
  }

  .bye-filters__reset {
    margin-left: 0;
    text-align: center;
  }

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

  .bye-card__image-wrap {
    aspect-ratio: 16 / 9;
  }

  .bye-grid-section {
    padding: 32px 0 48px;
  }

  .bye-recomendados {
    padding: 48px 0;
  }

  .bye-single-hero {
    height: 45vh;
    min-height: 300px;
  }

  .bye-single-content {
    padding: 32px 16px 48px;
  }
}

@media (max-width: 480px) {
  .bye-hero__title {
    font-size: 1.6rem;
  }

  .bye-card__title {
    font-size: 1.05rem;
  }

  .bye-badge {
    font-size: 0.65rem;
    padding: 3px 8px;
  }
}

/* ---------- ByEssenss — Leaflet Map & Custom Popup Styles ---------- */

.bye-map-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 48px;
}

.bye-map-container {
  height: 520px;
  border-radius: var(--bye-radius);
  border: 1px solid var(--bye-border);
  box-shadow: 0 4px 20px var(--bye-shadow);
  overflow: hidden;
  position: relative;
  background: var(--bye-bg-cream);
  z-index: 10;
}

/* Leaflet Container Overrides for Modern calm luxury font */
.leaflet-container {
  font-family: 'Inter', sans-serif !important;
}

.leaflet-bar {
  border: 1px solid var(--bye-border) !important;
  box-shadow: 0 2px 10px rgba(44, 44, 44, 0.08) !important;
  border-radius: var(--bye-radius) !important;
}

.leaflet-bar a {
  background-color: var(--bye-bg) !important;
  color: var(--bye-dark) !important;
  border-bottom: 1px solid var(--bye-border) !important;
  transition: background-color var(--bye-transition), color var(--bye-transition) !important;
}

.leaflet-bar a:hover {
  background-color: var(--bye-bg-warm) !important;
  color: var(--bye-gold) !important;
}

/* Custom Popup Style */
.leaflet-popup-content-wrapper {
  background: var(--bye-bg) !important;
  border-radius: 6px !important;
  box-shadow: 0 10px 30px rgba(44, 44, 44, 0.15) !important;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid var(--bye-border);
}

.leaflet-popup-content {
  margin: 0 !important;
  width: 280px !important;
}

.leaflet-popup-tip {
  background: var(--bye-bg) !important;
  box-shadow: 0 10px 30px rgba(44, 44, 44, 0.15) !important;
  border: 1px solid var(--bye-border);
}

.leaflet-container a.leaflet-popup-close-button {
  top: 10px !important;
  right: 10px !important;
  color: #ffffff !important;
  background: rgba(44, 44, 44, 0.6) !important;
  border-radius: 50% !important;
  width: 20px !important;
  height: 20px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 12px !important;
  font-weight: bold !important;
  padding: 0 !important;
  z-index: 100 !important;
  transition: background var(--bye-transition), color var(--bye-transition) !important;
}

.leaflet-container a.leaflet-popup-close-button:hover {
  background: var(--bye-gold) !important;
  color: #ffffff !important;
}

/* Popup Content Card */
.bye-map-popup {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 280px;
}

.bye-map-popup__image-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  background: var(--bye-bg-warm);
}

.bye-map-popup__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bye-map-popup__body {
  padding: 16px;
}

.bye-map-popup__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--bye-dark);
  margin: 0 0 6px;
  line-height: 1.3;
}

.bye-map-popup__address {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: var(--bye-text-light);
  line-height: 1.5;
  margin: 0 0 12px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.bye-map-popup__address::before {
  content: '';
  display: inline-block;
  width: 11px;
  height: 11px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23818181' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
  margin-top: 2px;
}

.bye-map-popup__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bye-gold);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: gap var(--bye-transition), color var(--bye-transition);
}

.bye-map-popup__link:hover {
  color: var(--bye-dark);
  gap: 7px;
}

/* Custom Marker Pins */
.bye-custom-pin {
  cursor: pointer;
  background: none !important;
  border: none !important;
}

.bye-custom-pin:hover {
  z-index: 1000 !important;
}

.bye-custom-pin svg {
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-origin: bottom center;
}

.bye-custom-pin:hover svg {
  transform: scale(1.18) translateY(-4px);
}

/* Loader custom transitions */
.bye-loader--map {
  transition: opacity 0.4s ease;
}

@media (max-width: 768px) {
  .bye-map-container {
    height: 380px;
  }
  
  .bye-map-wrapper {
    padding: 0 20px 32px;
  }
}
