/* =========================================================
   view_more_properties/all_properties.css
   Phase 5 — premium pagination
   ========================================================= */

:root {
  --red: #C62828;
  --red-dark: #9E1F1F;
  --white: #FFFFFF;
  --off-white: #F8F8F8;
  --charcoal: #2B2B2B;
  --grey-200: #EEEEEE;
  --grey-400: #BDBDBD;
  --grey-600: #6b6b6b;

  --ap-hero-text-duration: 900ms;
  --ap-divider-height: 200px;
  --ap-divider-duration: 900ms;
  --ap-ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--charcoal);
  background: var(--white);
}
.container { width: min(1200px, 92%); margin-inline: auto; }

/* =========================
   Site header
   ========================= */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--grey-200);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 0;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { height: 36px; width: auto; display: block; object-fit: contain; }
.brand-name { font-weight: 800; font-family: Montserrat, sans-serif; color: var(--charcoal); }

.nav { display: flex; gap: 18px; align-items: center; }
.nav a {
  color: var(--charcoal); text-decoration: none; font-weight: 600;
  padding: 8px 10px; border-radius: 8px;
  transition: background 240ms ease, color 240ms ease;
}
.nav a:hover { background: #f5f5f5; }
.nav-link.is-active { color: var(--red); }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; align-items: center;
  width: 35px; height: 35px; background: var(--red); border: none;
  border-radius: 6px; cursor: pointer; padding: 0;
  transition: background 0.3s ease, transform 0.2s ease;
}
.nav-toggle:hover { background: var(--red-dark); transform: scale(1.05); }
.nav-toggle span {
  display: block; width: 20px; height: 2px; background: #fff;
  border-radius: 2px; margin: 4px 0; transition: all 0.3s ease;
}
.nav-toggle.is-active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (max-width: 767px) {
  .nav {
    display: flex; flex-direction: column; background: #fff;
    position: absolute; top: 60px; right: 0; left: 0; padding: 1rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); z-index: 999;
    max-height: 0; overflow: hidden;
    opacity: 0; transform: translateY(-10px); pointer-events: none;
    transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.25s ease;
  }
  .nav.nav-open {
    max-height: 500px; opacity: 1; transform: translateY(0); pointer-events: auto;
  }
  .nav-toggle { display: flex; }
}

/* =========================
   HERO
   ========================= */
.ap-hero {
  position: relative;
  min-height: 84vh;
  isolation: isolate;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #2b2b2b;
}
.ap-hero-media { position: absolute; inset: 0; z-index: 0; display: block; }
.ap-hero-media img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block; opacity: 0;
  transition: opacity 500ms ease;
}
.ap-hero--media-ready .ap-hero-media img { opacity: 1; }

.ap-hero::before {
  content: ""; position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.25); z-index: 1;
}
.ap-hero-overlay {
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.35) 35%,
    rgba(0, 0, 0, 0.15) 60%,
    rgba(0, 0, 0, 0) 100%
  );
}
.ap-hero-content {
  position: relative; z-index: 3;
  color: var(--white);
  max-width: 1100px; width: 100%;
  margin: 0 auto; padding: 96px 20px 48px;
  display: flex; flex-direction: column; gap: 10px;
}
.ap-hero-title {
  margin: 0; font-weight: 800; letter-spacing: 0.2px;
  font-family: Montserrat, sans-serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  color: var(--white);
  opacity: 0; transform: translateY(20px);
  transition: opacity var(--ap-hero-text-duration) var(--ap-ease),
              transform var(--ap-hero-text-duration) var(--ap-ease);
}
.ap-hero-subtitle {
  margin: 0; max-width: 720px;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.5; color: #f0f0f0;
  opacity: 0; transform: translateY(20px);
  transition: opacity var(--ap-hero-text-duration) var(--ap-ease),
              transform var(--ap-hero-text-duration) var(--ap-ease);
}
.ap-hero--ready .ap-hero-title { opacity: 1; transform: translateY(0); }
.ap-hero--ready .ap-hero-subtitle {
  opacity: 1; transform: translateY(0);
  transition-delay: 250ms;
}

/* =========================
   DIVIDER (dome)
   ========================= */
.ap-divider {
  position: relative;
  z-index: 3;
  margin-top: calc(-1 * var(--ap-divider-height));
  height: var(--ap-divider-height);
  padding: 0 20px;

  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201200%20240%22%20preserveAspectRatio%3D%22none%22%3E%3Cpath%20d%3D%22M0%20240%20L1200%20240%20L1200%20180%20C900%2020%20300%2020%200%20180%20Z%22%20fill%3D%22%23F8F8F8%22%2F%3E%3C%2Fsvg%3E");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;

  filter: drop-shadow(0 -8px 12px rgba(0, 0, 0, 0.18));

  transform: translateY(100%);
  transition: transform var(--ap-divider-duration) var(--ap-ease);
  will-change: transform, filter;
  visibility: hidden;

  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.ap-divider--in { visibility: visible; transform: translateY(0); }

/* =========================
   MOBILE TRIGGER BAR
   ========================= */
.ap-mobile-bar {
  display: none;
  width: 100%;
  max-width: 640px;
  margin: 0 auto -30px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  align-items: center;
  gap: 12px;
  text-align: left;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--charcoal);
  transition: transform 200ms var(--ap-ease), box-shadow 200ms ease;
}
.ap-mobile-bar:hover { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(0,0,0,0.15); }
.ap-mobile-bar:active { transform: translateY(0); }

.ap-mobile-bar__icon { font-size: 1rem; color: var(--grey-600); flex-shrink: 0; }
.ap-mobile-bar__text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--grey-600);
}
.ap-mobile-bar__badge {
  background: var(--red);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 22px;
  text-align: center;
}
.ap-mobile-bar__chevron {
  color: var(--grey-600);
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: transform 240ms var(--ap-ease);
}
body.ap-sheet-open .ap-mobile-bar__chevron { transform: rotate(180deg); }

/* =========================
   DESKTOP FILTER PANEL
   ========================= */
.ap-filter {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto -60px;
  padding: 20px 24px;

  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr 1fr 1.2fr 1fr auto;
  gap: 12px;
  align-items: end;

  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(1.3) blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);

  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms var(--ap-ease), transform 500ms var(--ap-ease);
}
.ap-filter--in { opacity: 1; transform: translateY(0); }

.ap-field {
  display: flex; flex-direction: column; gap: 6px;
  min-width: 0;
}
.ap-filter .ap-field {
  opacity: 0; transform: translateY(10px);
  transition: opacity 420ms var(--ap-ease), transform 420ms var(--ap-ease);
}
.ap-filter--in .ap-field { opacity: 1; transform: translateY(0); }
.ap-filter--in .ap-field:nth-child(1) { transition-delay: 80ms; }
.ap-filter--in .ap-field:nth-child(2) { transition-delay: 140ms; }
.ap-filter--in .ap-field:nth-child(3) { transition-delay: 200ms; }
.ap-filter--in .ap-field:nth-child(4) { transition-delay: 260ms; }
.ap-filter--in .ap-field:nth-child(5) { transition-delay: 320ms; }
.ap-filter--in .ap-field:nth-child(6) { transition-delay: 380ms; }
.ap-filter--in .ap-field--actions    { transition-delay: 440ms; }

.ap-field-label {
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--grey-600); font-family: Montserrat, sans-serif;
}
.ap-input, .ap-select {
  appearance: none; width: 100%;
  padding: 12px 14px; font-size: 0.95rem; font-weight: 600;
  color: var(--charcoal);
  background: #F5F5F5;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 10px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color 200ms ease, box-shadow 200ms ease, background 200ms ease;
  font-family: inherit;
}
.ap-select {
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 7l5 5 5-5' stroke='%23666' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 38px;
}
.ap-input::placeholder { color: #7a7a7a; font-weight: 500; }
.ap-input:hover, .ap-select:hover { border-color: rgba(0, 0, 0, 0.22); }
.ap-input:focus, .ap-select:focus {
  outline: none; border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.15);
  background: #fff;
}

.ap-field--actions { flex-direction: row; align-items: center; gap: 8px; }

.ap-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 18px; font-weight: 700;
  font-family: Montserrat, sans-serif;
  font-size: 0.9rem; border-radius: 10px;
  border: 1px solid transparent; text-decoration: none; cursor: pointer;
  transition: transform 220ms var(--ap-ease), background 220ms ease,
              color 220ms ease, box-shadow 220ms ease;
  white-space: nowrap;
}
.ap-btn--primary {
  background: var(--red); color: var(--white);
  box-shadow: 0 6px 14px rgba(198, 40, 40, 0.25);
}
.ap-btn--primary:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(198, 40, 40, 0.3);
}
.ap-btn--ghost {
  background: transparent; color: var(--charcoal);
  border-color: rgba(0, 0, 0, 0.12);
}
.ap-btn--ghost:hover { background: rgba(0, 0, 0, 0.04); }

/* =========================
   Results meta
   ========================= */
.ap-results-meta { padding: 80px 0 8px; }
.ap-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ap-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 12px;
  background: rgba(198, 40, 40, 0.08);
  color: var(--red-dark);
  border: 1px solid rgba(198, 40, 40, 0.18);
  border-radius: 999px;
  font-size: 0.82rem; font-weight: 600;
}
.ap-chip-text { white-space: nowrap; }
.ap-chip-remove {
  background: transparent; border: none; color: inherit;
  cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 2px;
  border-radius: 50%; transition: background 180ms ease;
}
.ap-chip-remove:hover { background: rgba(198, 40, 40, 0.15); }

.ap-result-count {
  margin: 0 0 8px; color: var(--grey-600);
  font-size: 0.9rem; font-weight: 600;
}

/* =========================
   CARD GRID
   ========================= */
.ap-grid-wrap { padding: 16px 0 40px; }
.ap-empty {
  text-align: center; padding: 40px 20px;
  color: var(--grey-600); font-size: 1rem;
}

.ap-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.ap-grid .card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.ap-grid .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}
.ap-grid .card img {
  width: 100%; height: 200px;
  object-fit: cover; display: block;
}
.ap-grid .overlay {
  padding: 12px 14px 14px;
  background: #fff; flex: 1;
  display: flex; flex-direction: column; gap: 4px;
}
.ap-grid .overlay h3 {
  font-size: 1rem; font-weight: 700;
  margin: 0 0 4px; color: #333; line-height: 1.3;
}
.ap-grid .overlay p {
  margin: 0; font-size: 0.88rem; color: #666; line-height: 1.4;
}
.ap-grid .stars { font-size: 0.95rem; color: gold; margin-top: 4px; }
.ap-grid .star { display: inline-block; color: #ccc; }
.ap-grid .star.filled { color: gold; }

.ap-grid .card-link { text-decoration: none; color: inherit; display: block; }

.motion-in { opacity: 0; transform: translateY(16px); }
.motion-in.appear {
  opacity: 1; transform: translateY(0);
  transition: opacity 600ms var(--ap-ease), transform 600ms var(--ap-ease);
}

/* =========================================================
   PAGINATION — premium circular design
   Idle: white circle, soft grey border, dark grey number
   Current: solid red circle, white number, red glow
   Hover: red border + red number + faint red tint
   ========================================================= */
.ap-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 32px 0 48px;
  animation: apPageFadeIn 500ms var(--ap-ease) both;
}
@keyframes apPageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Base button */
.ap-page-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: #ffffff;
  color: var(--charcoal);
  font-weight: 700;
  font-family: Montserrat, sans-serif;
  font-size: 0.9rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition:
    background 220ms var(--ap-ease),
    color 220ms var(--ap-ease),
    border-color 220ms var(--ap-ease),
    box-shadow 220ms var(--ap-ease),
    transform 220ms var(--ap-ease);
}
.ap-page-link:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(198, 40, 40, 0.04);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(198, 40, 40, 0.12);
}
.ap-page-link:active {
  transform: translateY(0);
}

/* Current page — solid red, white number, subtle glow */
.ap-page-link.is-current {
  background: var(--red);
  color: #ffffff;
  border-color: var(--red);
  box-shadow: 0 8px 18px rgba(198, 40, 40, 0.32);
  transform: scale(1.05);
  cursor: default;
}
.ap-page-link.is-current:hover {
  background: var(--red);
  color: #ffffff;
  border-color: var(--red);
  transform: scale(1.05);
  box-shadow: 0 8px 18px rgba(198, 40, 40, 0.32);
}

/* Prev / Next — pill shape, wider */
.ap-page-link.ap-page-prev,
.ap-page-link.ap-page-next {
  min-width: auto;
  padding: 0 18px;
  gap: 6px;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

/* Ellipsis between windowed pages */
.ap-page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 44px;
  color: var(--grey-400);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.06em;
  user-select: none;
}

/* =========================
   MOBILE FILTER SHEET
   ========================= */
.ap-sheet {
  position: fixed;
  inset: 0;
  z-index: 100;

  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms ease, visibility 0s linear 300ms;
}
.ap-sheet.is-open {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 300ms ease, visibility 0s linear 0s;
}

.ap-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.ap-sheet__panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: 90vh;
  overflow-y: auto;

  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 20px 20px 0 0;
  padding: 12px 20px 24px;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.2);

  transform: translateY(100%);
  transition: transform 340ms var(--ap-ease);
  will-change: transform;
}
.ap-sheet.is-open .ap-sheet__panel { transform: translateY(0); }

.ap-sheet__handle {
  width: 44px; height: 4px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 999px;
  margin: 4px auto 12px;
}
.ap-sheet__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.ap-sheet__title {
  margin: 0; font-family: Montserrat, sans-serif;
  font-size: 1.2rem; font-weight: 800; color: var(--charcoal);
}
.ap-sheet__close {
  background: transparent; border: none;
  font-size: 1.6rem; line-height: 1;
  color: var(--charcoal); cursor: pointer;
  padding: 4px 10px; border-radius: 8px;
  transition: background 180ms ease;
}
.ap-sheet__close:hover { background: rgba(0, 0, 0, 0.06); }

.ap-sheet__form { display: flex; flex-direction: column; gap: 14px; }
.ap-sheet__form .ap-field-label { color: var(--charcoal); font-weight: 700; }

.ap-sheet__actions {
  display: flex; flex-direction: column; gap: 10px; margin-top: 8px;
}
.ap-sheet__actions .ap-btn { width: 100%; justify-content: center; }

/* =========================
   Reduced motion
   ========================= */
@media (prefers-reduced-motion: reduce) {
  .ap-hero-title,
  .ap-hero-subtitle,
  .ap-divider,
  .ap-filter,
  .ap-field,
  .ap-hero-media img,
  .ap-sheet,
  .ap-sheet__panel,
  .ap-page-link {
    transition: none !important;
    transform: none !important;
  }
  .ap-pagination { animation: none; }
  .ap-hero-title,
  .ap-hero-subtitle { opacity: 1; }
  .ap-divider { visibility: visible; }
  .ap-filter { opacity: 1; }
  .ap-field { opacity: 1; }
  .ap-hero-media img { opacity: 1; }
}

/* =========================
   Tablet
   ========================= */
@media (max-width: 1024px) {
  .ap-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .ap-filter {
    grid-template-columns: repeat(3, 1fr);
    padding: 18px 20px;
    margin-bottom: -50px;
  }
  .ap-field--actions { grid-column: 1 / -1; justify-content: flex-end; }
  .ap-results-meta { padding-top: 68px; }
}

/* =========================
   Mobile
   ========================= */
@media (max-width: 900px) {
  .ap-filter--desktop { display: none; }
  .ap-mobile-bar { display: flex; }
  .ap-divider { align-items: flex-end; padding-bottom: 20px; }
  .ap-results-meta { padding: 60px 0 8px; }
}

@media (max-width: 640px) {
  .ap-hero { min-height: 78vh; }
  .ap-hero-content { padding: 72px 20px 40px; }
  :root { --ap-divider-height: 140px; }

  .ap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .ap-grid .card img { height: 140px; }
  .ap-grid .overlay { padding: 10px 12px 12px; }
  .ap-grid .overlay h3 { font-size: 0.9rem; }
  .ap-grid .overlay p { font-size: 0.78rem; }

  /* Pagination: smaller circles, arrows only for prev/next */
  .ap-pagination { gap: 8px; padding: 24px 0 32px; }
  .ap-page-link { min-width: 40px; height: 40px; font-size: 0.85rem; }
  .ap-page-link.ap-page-prev,
  .ap-page-link.ap-page-next {
    padding: 0 12px;
    font-size: 0.8rem;
  }

  .ap-mobile-bar {
    max-width: 92%;
    margin-bottom: -24px;
    padding: 12px 16px;
  }
  .ap-results-meta { padding-top: 52px; }
}

/* =========================
   Footer
   ========================= */
.site-footer {
  background: #f8f8f8; padding: 1rem 0;
  font-size: 0.85rem; color: #666;
  text-align: center; border-top: 1px solid #e0e0e0;
}
.site-footer .footer-inner {
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
}
.site-footer .admin-login a {
  color: #999; text-decoration: none; font-size: 0.8rem;
}
.site-footer .admin-login a:hover { color: #333; text-decoration: underline; }