/* ===== 12-COLUMN GRID SYSTEM FOR PROPERTY DETAILS ===== */

/* Header adjustments for property pages */
.header:has(.property-secondary-nav) {
  flex-wrap: wrap;
}

/* Secondary Property Navigation inside header */
.property-secondary-nav {
  width: 100%;
  display: none; /* Hidden by default */
  justify-content: center;
  align-items: center;
  gap: 2rem;
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  order: 3;
}

/* Make header sticky when scrolling */
.header.sticky {
  position: fixed !important;
  top: 0 !important;
  left: 0;
  right: 0;
  width: 100%;
  margin-bottom: 0;
  z-index: 1001;
  padding-bottom: 1rem;
}

/* Hide brand and main nav when sticky, show secondary nav */
.header.sticky .brand,
.header.sticky .nav-menu {
  display: none;
}

.header.sticky .property-secondary-nav {
  display: flex; /* Only show when sticky */
  margin-top: 0;
  padding-top: 5px;
  padding-bottom: 5px;
  border-top: none;
}

/* Mobile styles for sticky nav */
@media (max-width: 768px) {
  .property-secondary-nav {
    gap: 0.25rem;
    font-size: 0.75rem;
    flex-wrap: nowrap;
  }
  
  .header.sticky .property-secondary-nav {
    display: flex !important;
    gap: 0.25rem;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  
  .property-secondary-nav a,
  .property-secondary-nav .nav-link {
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem !important;
    display: inline-block;
    color: var(--text) !important;
    text-decoration: none;
    white-space: nowrap;
  }
  
  .property-secondary-nav a.active,
  .property-secondary-nav .nav-link.active {
    color: var(--primary) !important;
  }
}

/* Hide main nav when sticky, only show secondary nav */
.header.sticky .brand,
.header.sticky > nav:first-of-type {
  display: none;
}

.header.sticky .property-secondary-nav {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.property-sticky-nav .nav-link {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.property-sticky-nav .nav-link:hover {
  color: #fff;
}

.property-sticky-nav .nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Mobile styles for sticky nav */
@media (max-width: 768px) {
  .property-sticky-nav {
    gap: 1rem !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    justify-content: flex-start !important;
    padding: 0.75rem 1rem !important;
  }
  
  .property-sticky-nav::-webkit-scrollbar {
    display: none;
  }
  
  .property-sticky-nav .nav-link {
    white-space: nowrap;
  }
}

@media (max-width: 768px) {
  /* Hide the original secondary nav on mobile - only show sticky version */
  .property-secondary-nav {
    display: none !important;
  }
  
  /* Adjust header padding since secondary nav is hidden */
  .header:has(.property-secondary-nav) {
    padding-bottom: 1rem !important;
  }
  
  /* Reduce gap on mobile sticky nav */
  .property-nav-sticky-scroll {
    gap: 1rem;
  }
  
  .property-nav-sticky {
    top: 60px;
  }
  
  /* Make sticky nav more mobile-friendly */
  .property-nav-sticky-scroll {
    gap: 1rem;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .property-nav-sticky-scroll::-webkit-scrollbar {
    display: none;
  }
  
  .property-nav-links {
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .property-nav-links::-webkit-scrollbar {
    display: none;
  }
  
  .property-nav-links .nav-link {
    padding: 12px 16px;
    font-size: 0.875rem;
    white-space: nowrap;
  }
}

/* 12-Column Grid Container */
.grid-container {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
}

/* Column Spans */
.col-1 { grid-column: span 1; }
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }

/* Responsive Grid */
@media (max-width: 1024px) {
  .col-md-12 { grid-column: span 12; }
  .col-md-6 { grid-column: span 6; }
  .col-md-4 { grid-column: span 4; }
}

@media (max-width: 768px) {
  .grid-container {
    grid-template-columns: 1fr;
    padding: 0 16px;
    gap: 16px;
  }
  
  .col-sm-12 { grid-column: span 1; }
}

/* Property Page Layout */
.property-page-layout {
  display: grid;
  grid-template-columns: 1fr 400px; /* Main content + Sidebar */
  gap: 32px;
  padding: 32px;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

/* Main Content Area (Left) */
.property-main {
  min-width: 0; /* Prevent grid blowout */
}

/* Sticky Sidebar (Right) */
.property-sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 8px;
  transition: top 0.3s ease;
}

/* Adjust sidebar position when header is sticky */
.header.sticky ~ * .property-sidebar,
body:has(.header.sticky) .property-sidebar {
  top: 40px;
  max-height: calc(100vh - 30px);
}

/* Custom Scrollbar Styling for Sidebar */
.property-sidebar::-webkit-scrollbar {
  width: 8px;
}

.property-sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.property-sidebar::-webkit-scrollbar-thumb {
  background: rgba(79, 159, 248, 0.3);
  border-radius: 4px;
  transition: background 0.3s ease;
}

.property-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(79, 159, 248, 0.5);
}

/* Firefox Scrollbar */
.property-sidebar {
  scrollbar-width: thin;
  scrollbar-color: rgba(79, 159, 248, 0.3) rgba(255, 255, 255, 0.05);
}

/* Mobile: Stack layout */
@media (max-width: 1024px) {
  .property-page-layout {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  
  .property-sidebar {
    position: static;
    max-height: none;
  }
}

/* ===== MOBILE RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
  /* Full width containers on mobile to match properties page */
  .container {
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: 100% !important;
  }
  
  .property-page-layout {
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }
  
  /* Page title spacing */
  .page-title {
    padding: 0 16px;
    margin-bottom: 16px;
  }
  
  /* Hide thumbnails on mobile */
  .property-thumbnails {
    display: none !important;
  }
  
  /* Hero image full width */
  .property-hero-card {
    margin-bottom: 0;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }
  
  .property-hero-image {
    border-radius: 0 !important;
    margin-bottom: 0;
  }
  
  /* Reorder mobile layout: title, gallery, booking, rating, description, facilities, reviews, location */
  .property-page-layout {
    display: flex !important;
    flex-direction: column !important;
  }
  
  .property-main,
  .property-sidebar {
    display: contents; /* Make children part of parent flex container */
  }
  
  /* Order for all cards - ensure proper stacking */
  .property-hero-card {
    order: 1; /* Gallery - after title, before booking */
  }
  
  .booking-card {
    order: 2; /* Booking - after gallery */
  }
  
  .rating-card {
    order: 3; /* Rating - after booking */
  }
  
  .property-description-card {
    order: 4; /* Description - after rating */
  }
  
  .facilities-card {
    order: 5; /* Facilities - after description */
  }
  
  .explore-nearby-card {
    order: 6; /* Explore Nearby - after facilities, before reviews */
  }
  
  .reviews-card {
    order: 7; /* Reviews - after explore nearby */
  }
  
  .map-card {
    order: 8; /* Location - last */
  }
  
  /* Cards full width with consistent spacing */
  .card {
    border-radius: 12px !important;
    border-left: 1px solid var(--glass-border) !important;
    border-right: 1px solid var(--glass-border) !important;
    margin-bottom: 8px !important;
    padding: 20px 16px !important;
  }
  
  /* Reduce gap between cards */
  .property-page-layout {
    gap: 8px !important;
  }
  
  /* Larger rating number on mobile */
  .rating-score {
    font-size: clamp(56px, 15vw, 72px) !important;
  }
  
  /* Update padding for facilities and map cards on mobile */
  .facilities-card.card {
    padding: 20px 0 !important;
    margin-top: 0 !important;
    margin-bottom: 8px !important;
  }
  
  .map-card.card {
    padding: 20px 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
  
  /* Remove padding from internal elements */
  .facilities-card .section-title,
  .facilities-card .facilities-list,
  .facilities-card .facilities-show-more,
  .map-card .section-title,
  .map-card .property-address,
  .map-card .map-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  
  /* Add padding to facility items for spacing */
  .facilities-card .facilities-list {
    padding: 16px !important;
  }
  
  .map-card .section-title,
  .map-card .property-address {
    padding: 0 16px !important;
  }
  
  /* Sticky nav on mobile - hidden by default until scroll */
  .property-nav-sticky-scroll {
    padding: 0.75rem 16px !important;
    gap: 0.75rem !important;
    justify-content: center !important;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Note: display is controlled by scroll JavaScript, default is 'none' from base style */
  }
  
  .property-nav-sticky-scroll::-webkit-scrollbar {
    display: none;
  }
  
  .property-nav-sticky-scroll .nav-link {
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  /* Section titles */
  .section-title {
    font-size: clamp(1.25rem, 5vw, 1.5rem) !important;
  }
  
  /* Reviews section */
  .reviews-header {
    flex-direction: column;
    gap: 12px;
  }
  
  .review-counters {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .review-counters::-webkit-scrollbar {
    display: none;
  }
  
  /* Pagination on mobile */
  .pagination {
    gap: 6px;
  }
  
  .page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    font-size: 0.85rem;
  }
}

/* Card Styling */
.card {
  background: rgba(255,255,255,0.00);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: clamp(15px, 4vw, 24px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-bottom: 24px;
}

.card .section-title {
  margin-top: 0;
  margin-bottom: 10px;
}

.property-card {
  background: rgba(255,255,255,0.01);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-bottom: 24px;
}

/* Hero Image Section */
.property-hero-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}

/* Thumbnail Carousel */
.property-thumbnails {
  position: relative;
  margin-top: 16px;
  overflow: hidden;
}

.thumbnails-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  padding: 4px 0;
}

.thumbnails-track::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Opera */
}

.thumbnail {
  position: relative;
  flex-shrink: 0;
  width: 80px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.01);
  cursor: pointer;
  transition: all 0.2s ease;
}

.thumbnail:hover {
  transform: scale(1.05);
  border-color: rgba(255,255,255,0.3);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

@media (max-width: 768px) {
  .thumbnail {
    width: 70px;
    height: 52px;
  }
}

/* Booking Widget Card */
.booking-widget-card {
  background: rgba(255,255,255,0.01);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-bottom: 16px;
}

/* Rating Card */
.rating-card {
  background: rgba(255,255,255,0.01);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
}

.rating-score {
  font-size: 48px;
  font-weight: 700;
  color: #4f9ff8;
  margin-bottom: 8px;
}

.rating-label {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
}

/* Property Description */
.property-description {
  line-height: 1.8;
  color: rgba(255,255,255,0.9);
  margin-bottom: 32px;
}

.property-description h2 {
  margin-top: 32px;
  margin-bottom: 16px;
  color: #fff;
}

.property-description p {
  margin-bottom: 16px;
}

/* Reviews Section */
.reviews-section-grid {
  display: grid;
  gap: 16px;
}

.review-card {
  background: rgba(255,255,255,0.01);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 20px;
}

/* Map Section */
.map-card {
  background: rgba(255,255,255,0.01);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 20px;
  margin-top: 24px;
}

.property-address {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 1rem 0 1.5rem 0;
  line-height: 1.6;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid var(--primary);
  border-radius: 4px;
}

.map-card iframe {
  width: 100%;
  height: 400px;
  border-radius: 8px;
  border: none;
}

/* Utilities */
.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: #fff;
  margin-top: 10px;
  margin-bottom: 10px;
}

.text-muted {
  color: rgba(255,255,255,0.6);
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* Facilities & Features Card */
.facilities-card {
  margin-top: 24px;
}

.facilities-card .section-title {
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.facilities-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.facility-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
}

@media (max-width: 768px) {
  .facilities-list {
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 8px;
  }
  
  .facility-item {
    padding: 4px;
    gap: 8px;
  }
  
  .facilities-show-more {
    margin-top: 0 !important;
    padding: 8px;
  }
}

.facility-icon {
  font-size: 1.5rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.facility-text {
  color: var(--text);
  font-size: 0.95rem;
}

/* Facilities Show More Button */
.facilities-show-more {
  display: flex;
  justify-content: center;
  margin-top: 10px;
  padding-top: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.show-more-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(79,159,248,0.15), rgba(126,231,181,0.15));
  color: var(--text);
  border: 1px solid rgba(79,159,248,0.35);
  border-radius: var(--radius);
  padding: clamp(12px, 2.5vw, 14px) clamp(24px, 5vw, 32px);
  font-size: clamp(0.9rem, 2vw, 1rem);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.show-more-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(79,159,248,0.25), rgba(126,231,181,0.25));
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(79,159,248,0.25);
}

.show-more-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

.show-more-icon {
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.show-more-btn:hover .show-more-icon {
  transform: translateY(2px);
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
