/* ==========================================================================
   Real Estate Template Stylesheet
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --secondary: #0f172a;
  --accent: #10b981;
  --accent-dark: #059669;
  --accent-rent: #f59e0b;
  --text-main: #334155;
  --text-muted: #64748b;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.3s ease;
  --max-width: 1200px;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-light);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--secondary);
  line-height: 1.25;
  font-weight: 700;
}

.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-title h2 {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
}

.section-title p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

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

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

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

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

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

.btn-accent:hover {
  background-color: var(--accent-dark);
}

/* Navbar */
.header {
  background-color: var(--bg-white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.logo {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  font-weight: 600;
  color: var(--text-main);
  position: relative;
  padding: 0.5rem 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--primary);
  border-radius: 2px;
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--secondary);
}

/* Hero Section */
.hero {
  position: relative;
  background: linear-gradient(rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.7)),
              url('https://images.unsplash.com/photo-1600585154340-be6161a56a0c?auto=format&fit=crop&w=1600&q=80') center/cover no-repeat;
  padding: 6rem 0 8rem 0;
  color: #fff;
  text-align: center;
}

.hero h1 {
  font-size: 3.2rem;
  color: #fff;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.25rem;
  color: #cbd5e1;
  max-width: 650px;
  margin: 0 auto 2.5rem auto;
}

/* Search Filter Box */
.search-box {
  background: var(--bg-white);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 1000px;
  margin: 0 auto;
  color: var(--text-main);
}

.search-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.search-tab {
  padding: 0.5rem 1.25rem;
  background: transparent;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.search-tab.active {
  background-color: var(--primary-light);
  color: var(--primary);
}

.search-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) auto;
  gap: 1rem;
  align-items: end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  width: 100%;
  background-color: #fff;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Feature Badges & Quick Stats */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.feature-card {
  background: var(--bg-white);
  padding: 2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  text-align: center;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 60px;
  height: 60px;
  background-color: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem auto;
  font-size: 1.5rem;
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Section Spacing */
.section {
  padding: 5rem 0;
}

.section-alt {
  background-color: var(--bg-white);
}

/* Property Cards & Grid */
.properties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.property-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

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

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

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

.property-card:hover .property-thumb img {
  transform: scale(1.05);
}

.property-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
}

.badge-sale {
  background-color: var(--accent);
}

.badge-rent {
  background-color: var(--accent-rent);
}

.property-price {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1.1rem;
  backdrop-filter: blur(4px);
}

.property-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.property-location {
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}

.property-title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.property-title a:hover {
  color: var(--primary);
}

.property-specs {
  display: flex;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.spec-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Agent / Team Section */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.agent-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

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

.agent-img {
  height: 260px;
  overflow: hidden;
}

.agent-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agent-info {
  padding: 1.25rem;
}

.agent-info h4 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.agent-info p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.agent-contact {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
}

/* Testimonials */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.testimonial-card {
  background: var(--bg-light);
  padding: 2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  position: relative;
}

.testimonial-card p {
  font-style: italic;
  margin-bottom: 1.5rem;
  color: var(--text-main);
}

.client-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.client-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

.client-info h5 {
  font-size: 1rem;
}

.client-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Page Header (Subpages) */
.page-header {
  background: linear-gradient(rgba(15, 23, 42, 0.75), rgba(15, 23, 42, 0.75)),
              url('https://images.unsplash.com/photo-1512917774080-9991f1c4c750?auto=format&fit=crop&w=1600&q=80') center/cover no-repeat;
  padding: 4rem 0;
  color: #fff;
  text-align: center;
}

.page-header h1 {
  color: #fff;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.breadcrumb {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #cbd5e1;
}

.breadcrumb a {
  color: #fff;
}

.breadcrumb a:hover {
  color: var(--primary-light);
}

/* Property Detail Layout */
.property-detail-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2.5rem;
}

.gallery-main {
  height: 420px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1rem;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.thumb-item {
  height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  opacity: 0.7;
  transition: var(--transition);
  border: 2px solid transparent;
}

.thumb-item.active,
.thumb-item:hover {
  opacity: 1;
  border-color: var(--primary);
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.detail-title h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.detail-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

.specs-bar {
  display: flex;
  gap: 2rem;
  padding: 1.25rem;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.specs-bar-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.detail-section {
  background: var(--bg-white);
  padding: 2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.detail-section h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.amenities-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.amenity-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
  font-weight: 500;
}

.amenity-item svg {
  color: var(--accent);
}

/* Sidebar Box */
.sidebar-box {
  background: var(--bg-white);
  padding: 2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.sidebar-box h3 {
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
}

.agent-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.agent-profile img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
}

/* Contact Grid */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2.5rem;
}

.contact-card {
  background: var(--bg-white);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.contact-card-icon {
  width: 45px;
  height: 45px;
  background-color: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.map-container {
  height: 350px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Stats Counter */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  text-align: center;
}

.stat-item {
  background: var(--bg-white);
  padding: 2.5rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.stat-number {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.stat-label {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.page-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  font-weight: 600;
  color: var(--text-main);
}

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

/* Footer */
.footer {
  background-color: var(--secondary);
  color: #cbd5e1;
  padding: 4rem 0 2rem 0;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-brand h3 {
  color: #fff;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.footer-brand span {
  color: var(--primary);
}

.footer-brand p {
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.footer-column h4 {
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  position: relative;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a:hover {
  color: #fff;
  padding-left: 5px;
}

.footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: #94a3b8;
}

/* Responsive Media Queries */
@media (max-width: 992px) {
  .property-detail-container,
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.2rem;
  }

  .nav-menu {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background-color: var(--bg-white);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
  }

  .nav-menu.active {
    left: 0;
  }

  .hamburger {
    display: block;
  }

  .nav-cta {
    display: none;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .detail-header {
    flex-direction: column;
    gap: 1rem;
  }
}
