:root {
  --brand-red: #EF1010;
  --brand-gold: #C9A24A;
  --brand-black: #111111;
  --brand-white: #FFFFFF;
  --brand-gray: #F5F5F5;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--brand-black);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6,
.font-display {
  font-family: 'Playfair Display', 'Poppins', serif;
}

.font-heading {
  font-family: 'Poppins', sans-serif;
}

/* Navbar */
.navbar {
  transition: background 0.35s ease, box-shadow 0.35s ease, padding 0.35s ease;
  background: rgba(17, 17, 17, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(17, 17, 17, 0.12);
}

.navbar.scrolled {
  background: rgba(17, 17, 17, 0.7);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.navbar:not(.scrolled) {
  background: rgba(17, 17, 17, 0.28);
}

.nav-link {
  position: relative;
  transition: color 0.25s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--brand-gold);
  transition: width 0.3s ease, left 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
  left: 0;
}

.nav-link.active {
  color: var(--brand-gold) !important;
}

/* Hero */
.hero-slide {
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}

.hero-slide.active {
  opacity: 1;
}

.hero-overlay {
  background: linear-gradient(135deg, rgba(17, 17, 17, 0.85) 0%, rgba(17, 17, 17, 0.55) 50%, rgba(239, 16, 16, 0.25) 100%);
}

/* Cards */
.property-card {
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease;
}

.property-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
}

.property-card .card-image img {
  transition: transform 0.6s ease;
}

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

.service-card {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  background: linear-gradient(145deg, #ffffff 0%, #fafafa 100%);
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(201, 162, 74, 0.15);
}

.category-card {
  transition: all 0.35s ease;
}

.category-card:hover {
  transform: scale(1.03);
  border-color: var(--brand-gold);
}

/* Glass */
.glass {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
  background: rgba(17, 17, 17, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Forms */
.form-input {
  width: 100%;
  padding: 0.875rem 1.125rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.75rem;
  font-size: 0.9375rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  background: #fff;
}

.form-input:focus {
  outline: none;
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 74, 0.15);
}

.newsletter-input {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem 0 0 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.newsletter-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--brand-red) 0%, #c40d0d 100%);
  color: #fff;
  padding: 0.875rem 1.75rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(239, 16, 16, 0.35);
}

.btn-gold {
  background: linear-gradient(135deg, var(--brand-gold) 0%, #a8863a 100%);
  color: #111;
  padding: 0.875rem 1.75rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(201, 162, 74, 0.35);
}

.btn-outline {
  border: 2px solid #fff;
  color: #fff;
  padding: 0.875rem 1.75rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.25s ease;
}

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

/* Badges */
.badge-sale {
  background: var(--brand-red);
  color: #fff;
}

.badge-rent {
  background: var(--brand-gold);
  color: #111;
}

.badge-featured {
  background: linear-gradient(135deg, #111 0%, #333 100%);
  color: var(--brand-gold);
  border: 1px solid var(--brand-gold);
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Counter */
.counter-value {
  font-variant-numeric: tabular-nums;
}

/* Testimonial slider */
.testimonial-track {
  display: flex;
  width: 100%;
  overflow: hidden;
  contain: paint;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.testimonial-track > * {
  flex: 0 0 100%;
  min-width: 0;
}

/* Gallery */
.gallery-thumb {
  opacity: 0.6;
  transition: opacity 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
}

.gallery-thumb.active,
.gallery-thumb:hover {
  opacity: 1;
  border-color: var(--brand-gold);
}

/* Page loader */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--brand-black);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(201, 162, 74, 0.3);
  border-top-color: var(--brand-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Lazy load */
img.lazy {
  opacity: 0;
  transition: opacity 0.4s ease;
}

img.lazy.loaded {
  opacity: 1;
}

/* Mobile menu */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.mobile-menu.open {
  max-height: 500px;
}

/* Pagination */
.pagination-link {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: all 0.25s ease;
}

.pagination-link.active {
  background: var(--brand-red);
  color: #fff;
}

.pagination-link:not(.active):hover {
  background: var(--brand-gray);
}

/* Timeline */
.timeline-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand-gold);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--brand-gold);
}

/* Filter sidebar */
.filter-panel {
  position: sticky;
  top: 100px;
}

/* Ripple */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Section spacing consistency */
.section-padding {
  padding-top: 5rem;
  padding-bottom: 5rem;
  overflow-x: clip;
}

@media (min-width: 768px) {
  .section-padding {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
}

/* Prevent overflow */
img, video {
  max-width: 100%;
  height: auto;
}

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

/* Brand logo */
.brand-logo-link {
  line-height: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.brand-logo-link:hover {
  opacity: 0.92;
  transform: scale(1.02);
}

.brand-logo {
  display: block;
  height: auto;
  max-height: 52px;
  object-fit: contain;
  object-position: left center;
  background: transparent;
  border: none;
  box-shadow: none;
}

.brand-logo--footer {
  max-height: 68px;
  filter: none !important;
}

.brand-logo--nav {
  filter: none !important;
  height: 52px;
  max-height: 52px;
}

/* Premium page heroes */
.page-hero__overlay {
  background: linear-gradient(115deg, rgba(17, 17, 17, 0.92) 0%, rgba(17, 17, 17, 0.75) 45%, rgba(239, 16, 16, 0.2) 100%);
}

.page-hero__overlay--services {
  background: linear-gradient(125deg, rgba(17, 17, 17, 0.96) 0%, rgba(17, 17, 17, 0.82) 50%, rgba(201, 162, 74, 0.12) 100%);
}

/* Stronger overlay for properties hero */
.page-hero__overlay--properties {
  background: linear-gradient(125deg, rgba(10, 10, 10, 0.96) 0%, rgba(17, 17, 17, 0.88) 45%, rgba(0, 0, 0, 0.6) 100%);
}

/* Home-specific hero overlay for cinematic warm look */
.home-hero__overlay {
  background: linear-gradient(115deg, rgba(10,10,10,0.88) 0%, rgba(17,17,17,0.6) 50%, rgba(201,162,74,0.06) 100%);
}

/* Improve services hero typography readability */
.page-hero--services .font-display,
.page-hero--services p {
  text-shadow: 0 6px 18px rgba(0,0,0,0.6);
}

/* Footer: premium styling */
.footer-gradient {
  background: linear-gradient(180deg, #0d0d0d 0%, #090909 55%, #070707 100%);
  border-top: 1px solid rgba(201,162,74,0.06);
}
.footer-top {
  box-shadow: 0 -6px 30px rgba(201,162,74,0.03) inset;
}
.footer-top > .max-w-7xl > * {
  min-width: 0;
}
.newsletter-form {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex-wrap: nowrap;
}
.newsletter-form .btn-gold {
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
}
.footer-social a {
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.footer-social a:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(201,162,74,0.12);
  background: linear-gradient(135deg, rgba(201,162,74,0.12), rgba(201,162,74,0.06));
}
.newsletter-input {
  border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.02));
  padding: 0.75rem 1rem;
  border-radius: 0.5rem 0 0 0.5rem;
  color: #fff;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.04);
}

@media (max-width: 639px) {
  .newsletter-form {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }

  .newsletter-input {
    width: 100%;
    border-radius: 0.5rem;
  }

  .newsletter-form .btn-gold {
    width: 100%;
    flex: 0 0 auto;
    border-radius: 0.5rem;
  }
}

.page-hero__grain {
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.floating-card {
  animation: floatCard 6s ease-in-out infinite;
}

.floating-card--main {
  animation-delay: 0.5s;
}

.floating-card--stat { animation-delay: 0s; }
.floating-card--stat2 { animation-delay: 1.2s; }
.floating-card--stat3 { animation-delay: 2s; }

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.service-float-card {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.service-float-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 40px rgba(201, 162, 74, 0.2);
}

.animate-float-slow { animation: floatCard 7s ease-in-out infinite; }
.animate-float-medium { animation: floatCard 5s ease-in-out infinite; }
.animate-float-fast { animation: floatCard 4s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .floating-card,
  .service-float-card,
  .animate-float-slow,
  .animate-float-medium,
  .animate-float-fast {
    animation: none;
  }
  .page-hero__bg {
    background-attachment: scroll !important;
  }
}

/* AJAX property results */
.property-results-inner {
  transition: opacity 0.35s ease;
}

.property-results-inner--loading {
  opacity: 0.35;
  pointer-events: none;
}

.property-results-inner--loaded {
  opacity: 1;
}

.property-results-loader {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(245, 245, 245, 0.85);
  backdrop-filter: blur(4px);
  padding: 0.5rem;
}

.property-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 2rem;
}

@media (min-width: 768px) {
  .property-skeleton-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.property-skeleton-card {
  background: #fff;
  border-radius: 1rem;
  padding: 1rem;
  animation: skeletonPulse 1.2s ease-in-out infinite;
}

.property-skeleton-image {
  aspect-ratio: 4/3;
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
  background-size: 200% 100%;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  animation: skeletonShimmer 1.4s infinite;
}

.property-skeleton-line {
  height: 14px;
  background: #eee;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes skeletonPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

.property-page-btn {
  cursor: pointer;
  border: none;
  font: inherit;
}

/* Categories Grid Centering */
@media (min-width: 1024px) {
  .categories-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-items: stretch;
  }

  .categories-grid .category-card:nth-child(5),
  .categories-grid .category-card:nth-child(6),
  .categories-grid .category-card:nth-child(7) {
    grid-column: auto;
  }

  .categories-grid .category-card:nth-child(5) {
    grid-column: 2 / 3;
  }
}


/* Categories Grid - Center last 3 items on desktop */
@media (min-width: 1024px) {
  .categories-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .categories-grid .category-card:nth-child(n+5) {
    grid-column: calc((4 - 3 + 1) / 2) / span 1;
  }

  .categories-grid .category-card:nth-child(5) {
    grid-column: 2;
  }

  .categories-grid .category-card:nth-child(6) {
    grid-column: 3;
  }

  .categories-grid .category-card:nth-child(7) {
    grid-column: 4;
  }
}
