/**
 * Llistat d'allotjaments — split layout + mapa + cards + modal.
 * Tot amb design tokens del tema (Costa / Terres) — res hardcodejat.
 */

.alloc-page { --alloc-navbar: 80px; }

/* ---- Split layout ---- */
/* L'ample i el padding lateral els posa el wrapper amb les classes del tema
   (max-w-costa mx-auto px-6 md:px-8 lg:px-12), idèntic a la resta de pàgines. */
.alloc-split {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.alloc-mapcol {
  width: 100%;
  height: 40vh;
  order: 1;
  border-bottom: 1px solid var(--neutral-border, #e0e4ea);
}
.alloc-map { width: 100%; height: 100%; background: var(--neutral-bg, #f5f7fa); }
.alloc-listcol {
  width: 100%;
  order: 2;
  padding-block: 2rem 3rem;
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .alloc-split { flex-direction: row; align-items: flex-start; }
  .alloc-mapcol {
    order: 2;
    width: 50%;
    height: calc(100vh - var(--alloc-navbar));
    position: sticky;
    top: var(--alloc-navbar);
    border-bottom: 0;
    border-inline-start: 1px solid var(--neutral-border, #e0e4ea);
  }
  /* Gutter entre llista i mapa; el padding extern el dona el wrapper del tema. */
  .alloc-listcol { order: 1; width: 50%; padding-block: 3rem; padding-inline-end: 2.5rem; }
}

/* ---- Capçalera ---- */
.alloc-head { margin-bottom: 2rem; }
.alloc-eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  color: rgb(var(--brand-accent, 128 186 39));
  font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: .8rem;
  margin-bottom: .5rem;
}
.alloc-eyebrow .material-icons-outlined { font-size: 1.25rem; }
.alloc-title {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.05; font-weight: 800; text-transform: uppercase;
  color: rgb(var(--brand-primary, 4 36 64));
  margin: 0 0 1rem;
}
/* Mateixa mida i color que la resta de text de cos del lloc. La variable és un
   triplet RGB, així que ha d'anar dins de rgb(): sense això el color no
   s'aplicava i el text sortia negre. */
.alloc-intro { color: rgb(var(--neutral-text-muted, 75 85 99)); font-size: 1rem; line-height: 1.65; max-width: 42rem; }

/* ---- Filtres ---- */
.alloc-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  background: #fff;
  padding: 1.25rem;
  border: 1px solid var(--neutral-border, #e0e4ea);
  border-radius: var(--radius-md, 2px);
  box-shadow: 0 1px 3px rgb(0 0 0 / .06);
  position: sticky;
  top: calc(var(--alloc-navbar) + .5rem);
  z-index: 20;
  margin-bottom: 1.5rem;
}
@media (min-width: 640px) { .alloc-filters { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .alloc-filters { grid-template-columns: repeat(4, 1fr); } }
.alloc-filter label {
  display: block;
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em;
  color: rgb(var(--neutral-text-muted, 75 85 99));
  margin-bottom: .4rem;
}
.alloc-filter select {
  width: 100%;
  background: var(--neutral-bg, #f5f7fa);
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 2px);
  padding: .65rem .9rem;
  color: rgb(var(--brand-primary, 4 36 64));
  font-weight: 600; font-size: .9rem;
  cursor: pointer;
  outline: none;
  transition: border-color .2s;
}
.alloc-filter select:focus { border-color: rgb(var(--brand-accent, 128 186 39)); }

/* ---- Resultats ---- */
.alloc-resultbar { margin-bottom: 1.25rem; }
.alloc-resultbar h2 {
  font-size: 1.25rem; font-weight: 700; text-transform: uppercase;
  color: rgb(var(--brand-primary, 4 36 64)); margin: 0;
}
.alloc-list { display: grid; grid-template-columns: 1fr; gap: 1.25rem; padding-bottom: 3rem; }

/* ---- Card ---- */
.alloc-card {
  display: flex; flex-direction: column; gap: 1.25rem;
  background: #fff;
  padding: 1.25rem;
  border: 1px solid var(--neutral-border, #e0e4ea);
  border-radius: var(--radius-lg, 2px);
  box-shadow: 0 1px 3px rgb(0 0 0 / .06);
  cursor: pointer;
  transition: box-shadow .25s, border-color .25s, transform .25s;
}
.alloc-card:hover, .alloc-card:focus-visible {
  box-shadow: 0 12px 28px -8px rgb(0 0 0 / .18);
  border-color: rgb(var(--brand-accent, 128 186 39));
  outline: none;
}
@media (min-width: 480px) { .alloc-card { flex-direction: row; } }
.alloc-card__media {
  position: relative;
  width: 100%; height: 12rem;
  border-radius: var(--radius-md, 2px);
  overflow: hidden; flex-shrink: 0;
}
@media (min-width: 480px) { .alloc-card__media { width: 10rem; height: 9rem; } }
.alloc-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.alloc-card:hover .alloc-card__media img { transform: scale(1.08); }
.alloc-card__cat {
  position: absolute; bottom: .5rem; left: .5rem;
  background: rgb(var(--brand-primary, 4 36 64) / .85); color: #fff;
  font-size: .65rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px;
}
.alloc-card__body { display: flex; flex-direction: column; justify-content: center; flex: 1; min-width: 0; }
.alloc-card__type {
  font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em;
  color: rgb(var(--brand-accent, 128 186 39));
  background: rgb(var(--brand-accent, 128 186 39) / .1);
  padding: .2rem .55rem; border-radius: var(--radius-sm, 2px);
  width: fit-content; margin-bottom: .5rem;
}
.alloc-card__name {
  font-size: 1.25rem; font-weight: 700; line-height: 1.2; margin: 0 0 .4rem;
  color: rgb(var(--brand-primary, 4 36 64));
}
.alloc-card:hover .alloc-card__name { color: rgb(var(--brand-accent, 128 186 39)); }
.alloc-card__desc {
  font-size: .9rem; color: rgb(var(--neutral-text-muted, 75 85 99)); line-height: 1.5; margin: 0 0 .75rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.alloc-card__loc {
  display: inline-flex; align-items: center; gap: .4rem; margin-top: auto; width: fit-content;
  font-size: .78rem; font-weight: 600; color: rgb(var(--brand-primary, 4 36 64));
  background: var(--neutral-bg, #f5f7fa);
  border: 1px solid var(--neutral-border, #e0e4ea);
  padding: .35rem .65rem; border-radius: var(--radius-sm, 2px);
}
.alloc-card__loc .material-icons-outlined { font-size: 1rem; color: rgb(var(--brand-accent, 128 186 39)); }

/* ---- Placeholder per tipus (CSS + icona, mai trencat) ---- */
.alloc-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(135deg, rgb(var(--brand-primary, 4 36 64) / .08), rgb(var(--brand-accent, 128 186 39) / .14));
  color: rgb(var(--brand-primary, 4 36 64) / .55);
}
.alloc-ph .material-icons-outlined { font-size: 3rem; }
.alloc-ph--mini .material-icons-outlined { font-size: 1.4rem; }

/* ---- Marker avatar ---- */
.alloc-marker-icon { background: transparent; border: 0; }
.alloc-marker__wrap {
  width: 48px; height: 48px; border-radius: 50%;
  border: 3px solid rgb(var(--brand-accent, 128 186 39));
  background: #fff; position: relative;
  box-shadow: 0 4px 10px rgb(0 0 0 / .2);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), border-color .3s;
  transform-origin: bottom center;
  overflow: visible;
}
.alloc-marker__wrap img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; padding: 2px; }
.alloc-marker__wrap .alloc-ph { border-radius: 50%; }
.alloc-marker__tip {
  width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-top: 10px solid rgb(var(--brand-accent, 128 186 39));
  position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  transition: border-top-color .3s;
}
.alloc-marker.is-active .alloc-marker__wrap { transform: scale(1.25); border-color: rgb(var(--brand-primary, 4 36 64)); }
.alloc-marker.is-active .alloc-marker__tip { border-top-color: rgb(var(--brand-primary, 4 36 64)); }

/* ---- Clusters ---- */
.alloc-cluster-icon { background: transparent; border: 0; }
.alloc-cluster {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgb(var(--brand-accent, 128 186 39));
  color: #fff; font-weight: 700; font-size: .85rem;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgb(0 0 0 / .25);
}
.alloc-cluster--md { width: 50px; height: 50px; font-size: .9rem; }
.alloc-cluster--lg { width: 58px; height: 58px; font-size: 1rem; background: rgb(var(--brand-primary, 4 36 64)); }
.alloc-cluster span { line-height: 1; }

/* ---- Estat buit ---- */
.alloc-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 4rem 1rem; }
.alloc-empty .material-icons-outlined { font-size: 3.5rem; color: var(--neutral-border, #cecece); margin-bottom: 1rem; }
.alloc-empty h3 { font-weight: 700; text-transform: uppercase; color: rgb(var(--brand-primary, 4 36 64)); margin: 0 0 .5rem; }
.alloc-empty p { color: rgb(var(--neutral-text-muted, 75 85 99)); font-size: 1rem; line-height: 1.65; margin: 0 0 1rem; }
.alloc-empty button {
  background: none; border: 0; cursor: pointer;
  color: rgb(var(--brand-accent, 128 186 39)); font-weight: 700;
  text-decoration: underline; text-underline-offset: 4px;
}

/* ---- Modal ---- */
.alloc-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .28s; }
.alloc-modal.is-open { opacity: 1; }
.alloc-modal__backdrop { position: absolute; inset: 0; background: rgb(var(--brand-primary, 4 36 64) / .6); backdrop-filter: blur(4px); }
.alloc-modal__box {
  position: relative; background: #fff;
  width: 90%; max-width: 32rem; max-height: 90vh; overflow: hidden;
  border-radius: var(--radius-lg, 2px);
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / .4);
  display: flex; flex-direction: column;
  transform: scale(.95); transition: transform .28s;
}
.alloc-modal.is-open .alloc-modal__box { transform: scale(1); }
.alloc-modal__close {
  position: absolute; top: 1rem; right: 1rem; z-index: 10;
  background: #fff; border: 0; cursor: pointer;
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: rgb(var(--neutral-text-muted, 75 85 99)); box-shadow: 0 1px 4px rgb(0 0 0 / .2);
}
.alloc-modal__media { height: 13rem; position: relative; flex-shrink: 0; }
.alloc-modal__media img { width: 100%; height: 100%; object-fit: cover; }
.alloc-modal__body { padding: 1.5rem 2rem; overflow-y: auto; flex: 1; }
.alloc-modal__eyebrow { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: rgb(var(--neutral-text-muted, 75 85 99)); margin-bottom: .5rem; }
.alloc-modal__name { font-size: clamp(1.6rem, 4vw, 2.25rem); font-weight: 700; color: rgb(var(--brand-primary, 4 36 64)); margin: 0 0 .5rem; }
.alloc-modal__address { display: flex; align-items: flex-start; gap: .4rem; font-size: .9rem; color: rgb(var(--neutral-text-muted, 75 85 99)); margin: 0 0 1rem; }
.alloc-modal__address .material-icons-outlined { font-size: 1.1rem; flex-shrink: 0; }
.alloc-approx { display: block; font-size: .75rem; font-style: italic; color: rgb(var(--brand-accent, 128 186 39)); margin-top: .15rem; }
.alloc-modal__features { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.alloc-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .7rem; border-radius: var(--radius-pill, 2px);
  background: var(--neutral-bg, #f5f7fa); border: 1px solid var(--neutral-border, #e0e4ea);
  font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: rgb(var(--neutral-text-main, 40 40 40));
}
.alloc-badge .material-icons-outlined { font-size: 1rem; color: rgb(var(--brand-accent, 128 186 39)); }
.alloc-modal__desc { color: rgb(var(--neutral-text-muted, 75 85 99)); line-height: 1.6; margin: 0 0 1.25rem; }
.alloc-modal__facts { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.25rem; }
.alloc-fact { display: flex; align-items: center; gap: .4rem; color: rgb(var(--brand-primary, 4 36 64)); }
.alloc-fact .material-icons-outlined { font-size: 1.2rem; color: rgb(var(--brand-accent, 128 186 39)); }
.alloc-fact strong { font-weight: 700; }
.alloc-fact span { color: rgb(var(--neutral-text-muted, 75 85 99)); font-size: .85rem; }
.alloc-modal__contact { border-top: 1px solid var(--neutral-border, #e0e4ea); padding-top: 1.25rem; }
.alloc-modal__contact h3 { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: rgb(var(--brand-accent, 128 186 39)); margin: 0 0 1rem; }
.alloc-contact-rows { display: flex; flex-direction: column; gap: .75rem; }
.alloc-contact-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem; border: 1px solid var(--neutral-border, #e0e4ea); border-radius: var(--radius-sm, 2px);
  background: var(--neutral-bg, #f5f7fa);
}
.alloc-contact-row__ico {
  width: 2.5rem; height: 2.5rem; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: rgb(var(--brand-primary, 4 36 64)); box-shadow: 0 1px 3px rgb(0 0 0 / .08); font-size: 1.1rem;
}
.alloc-contact-row h4 { font-size: .82rem; font-weight: 700; color: rgb(var(--brand-primary, 4 36 64)); margin: 0; }
.alloc-contact-row a, .alloc-contact-row span { font-size: .85rem; color: rgb(var(--neutral-text-muted, 75 85 99)); word-break: break-word; }
.alloc-contact-row a:hover { color: rgb(var(--brand-accent, 128 186 39)); }
.alloc-modal__rtc {
  display: flex; align-items: center; gap: .5rem; margin-top: 1.25rem;
  font-size: .78rem; color: rgb(var(--neutral-text-muted, 75 85 99));
}
.alloc-modal__rtc .material-icons-outlined { color: rgb(var(--brand-accent, 128 186 39)); font-size: 1.1rem; }
.alloc-modal__footer { padding: 1.25rem 1.5rem; background: var(--neutral-bg, #f5f7fa); border-top: 1px solid var(--neutral-border, #e0e4ea); flex-shrink: 0; }
.alloc-modal__mapbtn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem; cursor: pointer;
  background: #fff; color: rgb(var(--brand-primary, 4 36 64));
  border: 1px solid rgb(var(--brand-primary, 4 36 64) / .2);
  border-radius: var(--radius-sm, 2px);
  font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: .82rem;
  transition: background .2s, color .2s;
}
.alloc-modal__mapbtn:hover { background: rgb(var(--brand-primary, 4 36 64)); color: #fff; }

/* Leaflet popup arrodonit (coherent amb tokens) */
.alloc-page .leaflet-popup-content-wrapper { border-radius: var(--radius-md, 2px); }
