/*
Theme Name: Alistair Properties
Theme URI: https://alistairproperties.co.uk
Description: Premium real estate WordPress theme for Alistair Properties Ltd
Author: Alistair Properties Ltd
Version: 1.0.0
Text Domain: alistair-properties
*/

:root {
  --primary: #137fec;
  --primary-dark: #0d6ac5;
  --primary-light: #e8f4fd;
  --secondary: #0f172a;
  --bg-light: #f6f7f8;
  --bg-white: #ffffff;
  --text-dark: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .08);
  --shadow: 0 4px 12px rgba(0, 0, 0, .10);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .12);
  --shadow-blue: 0 8px 24px rgba(19, 127, 236, .25);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  width: 100%;
}

/* WordPress admin bar offset */
.admin-bar .site-nav {
  top: 32px;
}

@media (max-width: 600px) {
  .admin-bar .site-nav {
    top: 46px;
  }
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  font-size: 16px;
  /* Sticky footer: body takes full viewport height */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

main,
.site-main {
  flex: 1;
  width: 100%;
}

section {
  width: 100%;
  box-sizing: border-box;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* ── Container ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-sm {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  line-height: 1;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-blue);
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}

.btn-secondary:hover {
  background: #1e293b;
}

.btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

.btn-ghost {
  background: #f1f5f9;
  color: var(--text-dark);
  border-color: transparent;
}

.btn-ghost:hover {
  background: #e2e8f0;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* ── Cards ── */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.card-padded {
  padding: 24px;
}

/* ── Property Card ── */
.property-card {
  background: #fff;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.property-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.property-card__image {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.property-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.property-card:hover .property-card__image img {
  transform: scale(1.08);
}

.property-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.property-card__badge.for-sale {
  background: var(--primary);
}

.property-card__badge.for-rent {
  background: #10b981;
}

.property-card__badge.commercial {
  background: #8b5cf6;
}

.property-card__badge.featured {
  background: #f59e0b;
}

.property-card__price {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(6px);
  color: var(--text-dark);
  font-weight: 800;
  font-size: 18px;
  padding: 6px 14px;
  border-radius: var(--radius);
}

.property-card__fav {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, .9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.property-card__fav:hover {
  background: #fff;
}

.property-card__fav.active .material-symbols-outlined {
  color: #ef4444;
}

.property-card__body {
  padding: 16px 20px 20px;
}

.property-card__title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.property-card__address {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 14px;
}

.property-card__address .material-symbols-outlined {
  font-size: 16px;
  color: var(--primary);
}

.property-card__specs {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.property-card__spec {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.property-card__spec .material-symbols-outlined {
  font-size: 16px;
  color: var(--primary);
}

.property-card__actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

/* ── Status badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.badge-active {
  background: #d1fae5;
  color: #065f46;
}

.badge-pending {
  background: #fef3c7;
  color: #92400e;
}

.badge-sold {
  background: #f1f5f9;
  color: #475569;
}

.badge-new {
  background: #e0f2fe;
  color: #0c4a6e;
}

/* ── Form elements ── */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 14px;
  background: #f8fafc;
  transition: all 0.2s;
  outline: none;
  color: var(--text-dark);
}

.form-input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(19, 127, 236, .12);
}

.form-input::placeholder {
  color: #94a3b8;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%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;
  padding-right: 40px;
}

/* ── Section utilities ── */
.section {
  padding: 80px 0;
}

.section-sm {
  padding: 48px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  margin-bottom: 12px;
}

.section-title {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

/* ── Grid helpers ── */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  margin-top: 40px;
}

.page-btn {
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: var(--text-dark);
}

.page-btn:hover,
.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Map container ── */
#property-map,
#search-map {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-xl);
}

.map-price-pin {
  background: #fff;
  border: 2px solid var(--primary);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 13px;
  color: var(--primary);
  box-shadow: var(--shadow);
  white-space: nowrap;
  cursor: pointer;
}

/* ── Sidebar layout ── */
.sidebar-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.sidebar-layout .sidebar {
  width: 280px;
  flex-shrink: 0;
}

.sidebar-layout .main-content {
  flex: 1;
  min-width: 0;
}

/* ── Admin sidebar ── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 240px;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.admin-main {
  margin-left: 240px;
  flex: 1;
  min-height: 100vh;
  background: var(--bg-light);
}

.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.admin-content {
  padding: 32px;
}

/* ── Stat card ── */
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.stat-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card__change {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

.stat-card__change.up {
  background: #d1fae5;
  color: #065f46;
}

.stat-card__change.down {
  background: #fee2e2;
  color: #991b1b;
}

.stat-card__label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-card__value {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1;
}

/* ── Data table ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 12px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: #f8fafc;
}

.data-table__thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  object-fit: cover;
}

/* ── Gallery grid — left main large (rowspan 2), right 2×2 thumbs ── */
.property-gallery {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 225px 225px;
  gap: 8px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 28px;
}

.property-gallery__main {
  grid-column: 1;
  grid-row: 1 / span 2;
  overflow: hidden;
}

.property-gallery__thumb {
  grid-column: 2;
  position: relative;
  overflow: hidden;
  min-height: 225px;
}

.property-gallery__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.4s;
}

.property-gallery__img:hover {
  transform: scale(1.04);
}

.property-gallery__placeholder {
  width: 100%;
  height: 100%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.property-gallery__more {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

/* ── Contact / Mortgage sidebar ── */
.agent-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.mortgage-card {
  background: #0f172a;
  color: #fff;
  border-radius: var(--radius-2xl);
  padding: 24px;
  margin-top: 16px;
}

/* ── Search results split view ── */
.search-layout {
  display: flex;
  height: calc(100vh - 64px);
}

.search-results-panel {
  width: 420px;
  flex-shrink: 0;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 20px;
}

.search-map-panel {
  flex: 1;
}

/* ── Compare toolbar ── */
.compare-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, .08);
}

/* ── Login page ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
}

.auth-card {
  background: #fff;
  border-radius: var(--radius-2xl);
  padding: 48px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.auth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.auth-image-panel {
  position: relative;
  background: var(--secondary);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 40px;
  overflow: hidden;
}

.auth-image-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .2), rgba(0, 0, 0, .7));
}

.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 28px;
}

.auth-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.auth-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ── Nav ── */
.site-nav {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-nav__logo-icon {
  width: 38px;
  height: 38px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.site-nav__brand {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-dark);
}

.site-nav__brand span {
  color: var(--primary);
}

.site-nav__menu {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.site-nav__link {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  transition: color 0.2s;
}

.site-nav__link:hover,
.site-nav__link.active {
  color: var(--primary);
}

.site-nav__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-nav__hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

/* ── Footer ── */
.site-footer {
  background: var(--secondary);
  color: #fff;
  padding: 64px 0 32px;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 48px;
  margin-bottom: 48px;
}

.site-footer__brand {
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.7;
  margin-top: 16px;
}

.site-footer__heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
  margin-bottom: 20px;
}

.site-footer__links {
  list-style: none;
}

.site-footer__links li {
  margin-bottom: 12px;
}

.site-footer__links a {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  transition: color 0.2s;
}

.site-footer__links a:hover {
  color: #fff;
}

.site-footer__bottom {
  border-top: 1px solid #1e293b;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-footer__copy {
  font-size: 12px;
  color: #64748b;
}

.site-footer__social {
  display: flex;
  gap: 12px;
}

.site-footer__social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  transition: all 0.2s;
}

.site-footer__social a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

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

  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .admin-sidebar {
    width: 200px;
  }

  .admin-main {
    margin-left: 200px;
  }
}

@media (max-width: 768px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .grid-4 {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 48px 0;
  }

  .section-title {
    font-size: 26px;
  }

  .site-nav__menu {
    display: none;
  }

  .site-nav__hamburger {
    display: block;
  }

  .site-nav__menu.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 16px;
    box-shadow: var(--shadow);
  }

  .sidebar-layout {
    flex-direction: column;
  }

  .sidebar-layout .sidebar {
    width: 100%;
  }

  .search-layout {
    flex-direction: column;
    height: auto;
  }

  .search-results-panel {
    width: 100%;
    height: 60vh;
  }

  .search-map-panel {
    height: 50vh;
  }

  .auth-split {
    grid-template-columns: 1fr;
  }

  .auth-image-panel {
    display: none;
  }

  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }

  .admin-main {
    margin-left: 0;
  }

  .property-gallery {
    grid-template-columns: 1fr;
    height: auto;
  }

  .property-gallery__main {
    grid-row: auto;
    height: 280px;
  }

  .site-footer__grid {
    grid-template-columns: 1fr;
  }
}