/* ============================================
   PREOWNED PROPERTIES — RESPONSIVE STYLES
   Breakpoints: 320, 375, 425, 576, 768, 992, 1200, 1400
   ============================================ */

/* --------------------------------------------
   PAGE LOADER — RESPONSIVE
   -------------------------------------------- */
@media (max-width: 575.98px) {
  .brand-lockup-loader .brand-icon-img {
    height: 56px;
    margin-right: -8px;
  }

  .brand-lockup-loader .brand-logo {
    height: 56px;
    margin-left: -12px;
  }

  .page-loader-tagline {
    margin-top: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-lockup-loader,
  .page-loader-tagline,
  .page-loader-line {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .page-loader {
    transition-duration: 0.2s;
  }
}

/* --------------------------------------------
   LARGE DESKTOP (1400px+)
   -------------------------------------------- */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }

  .hero-title {
    font-size: 4.5rem;
  }

  .search-box {
    padding: 32px;
  }
}

/* --------------------------------------------
   DESKTOP (1200px - 1399px)
   -------------------------------------------- */
@media (max-width: 1199.98px) {
  .how-flow-path {
    display: none;
  }

  .how-flow-marker {
    display: none;
  }

  .how-flow {
    min-height: auto;
    padding: 0;
  }

  .how-flow-steps {
    min-height: auto;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px 24px;
  }

  .how-step:nth-child(odd),
  .how-step:nth-child(even) {
    padding: 20px 12px;
  }
}

/* --------------------------------------------
   TABLET LANDSCAPE (992px - 1199px)
   -------------------------------------------- */
@media (max-width: 991.98px) {
  :root {
    --nav-height: 70px;
  }

  html,
  body {
    max-width: 100%;
    overscroll-behavior-x: none;
  }

  .site-main {
    overflow-x: clip;
    max-width: 100%;
  }

  .scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1050;
  }

  .scroll-progress.scrolled {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .glass-nav {
    position: fixed;
    top: 3px;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1040;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }

  .glass-nav.scrolled {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid rgba(9, 0, 89, 0.06);
  }

  section,
  .container,
  .hero-content,
  .search-box,
  .categories-section .container,
  .partners-section,
  .experts-section,
  .featured-section,
  .why-section,
  .how-section,
  .stats-section,
  .testimonials-section,
  .faq-section,
  .path-cards-section,
  .site-footer {
    max-width: 100%;
  }

  .categories-section .container {
    overflow-x: clip;
  }

  .categories-strip-outer {
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .section-padding {
    padding: 80px 0;
  }

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

  .glass-nav .navbar-collapse {
    background: var(--surface);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-top: 16px;
    border: 1px solid var(--border);
  }

  .glass-nav .navbar-toggler,
  .glass-nav .navbar-collapse {
    display: none !important;
  }

  .glass-nav {
    padding: 12px 0;
  }

  .glass-nav .navbar-brand {
    margin: 0 auto;
  }

  .glass-nav > .container {
    justify-content: center;
  }

  body {
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
  }

  .site-footer {
    padding-bottom: calc(24px + var(--mobile-nav-height) + env(safe-area-inset-bottom));
  }

  .back-to-top {
    bottom: calc(var(--mobile-nav-height) + 16px + env(safe-area-inset-bottom));
    right: 16px;
    width: 44px;
    height: 44px;
    z-index: 1030;
  }

  .nav-link-animated::after {
    display: none;
  }

  .hero-section {
    min-height: auto;
    padding-bottom: calc(100px + var(--mobile-nav-height));
  }

  .search-form {
    flex-direction: column;
  }

  .search-field {
    min-width: 100%;
  }

  .btn-search {
    width: 100%;
    justify-content: center;
    padding: 16px;
  }

  .how-step {
    padding: 20px 12px;
  }

  .testimonial-card {
    padding: 28px 20px;
  }

  .path-card {
    padding: 28px 22px;
  }

  .path-card-desc {
    margin-bottom: 22px;
  }
}

/* --------------------------------------------
   TABLET PORTRAIT (768px - 991px)
   -------------------------------------------- */
@media (max-width: 767.98px) {
  .section-padding {
    padding: 64px 0;
  }

  .how-flow-steps {
    gap: 24px 16px;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .hero-cta .btn {
    width: 100%;
    max-width: 300px;
  }

  .search-box {
    padding: 20px;
    border-radius: var(--radius-md);
  }

  .search-toggle {
    width: 100%;
    justify-content: center;
  }

  .search-toggle-btn {
    flex: 1;
    text-align: center;
  }

  .property-meta {
    gap: 10px;
  }

  .property-footer {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }

  .btn-view-details {
    text-align: center;
    justify-content: center;
  }

  .why-section-bg,
  .stats-bg {
    background-attachment: scroll;
  }

  .why-section-header {
    margin-bottom: 40px;
  }

  .why-card {
    padding: 24px 20px;
  }

  .stat-number {
    font-size: 2rem;
  }

  .testimonial-author {
    flex-direction: column;
    text-align: center;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer-legal {
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
  }

  .back-to-top {
    bottom: calc(var(--mobile-nav-height) + 16px + env(safe-area-inset-bottom));
    right: 16px;
    width: 44px;
    height: 44px;
  }
}

/* --------------------------------------------
   MOBILE LARGE (576px - 767px)
   -------------------------------------------- */
@media (max-width: 575.98px) {
  .section-title {
    font-size: 1.75rem;
  }

  .section-desc {
    font-size: 0.95rem;
  }

  .hero-badge {
    font-size: 0.75rem;
    padding: 6px 14px;
  }

  .hero-title {
    font-size: 1.9rem;
  }

  .brand-icon-img {
    height: 36px;
    margin-right: -5px;
  }

  .brand-logo {
    height: 36px;
    margin-left: -8px;
  }

  .brand-lockup-footer .brand-icon-img {
    height: 48px;
    margin-right: -6px;
  }

  .brand-logo-footer {
    height: 48px;
    margin-left: -10px;
  }

  .property-body {
    padding: 18px;
  }

  .property-title {
    font-size: 1.15rem;
  }

  .property-price {
    font-size: 1.3rem;
  }

  .category-card {
    padding: 24px 16px;
  }

  .categories-strip .category-card-slot {
    flex: 0 0 146px;
    min-width: 146px;
    padding: 6px;
  }

  .categories-strip .category-card {
    padding: 20px 10px;
  }

  .category-icon {
    width: 52px;
    height: 52px;
  }

  .category-icon i {
    font-size: 1.2rem;
  }

  .category-card h3 {
    font-size: 0.95rem;
  }

  .amenity-card {
    padding: 24px 16px;
  }

  .amenity-icon {
    width: 48px;
    height: 48px;
  }

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

  .site-footer {
    padding: 60px 0 0;
  }

  .faq-accordion .accordion-button {
    font-size: 0.9rem;
    padding: 16px 18px;
  }

  .faq-accordion .accordion-body {
    padding: 0 18px 16px;
    font-size: 0.9rem;
  }
}

/* --------------------------------------------
   MOBILE MEDIUM (425px - 575px)
   -------------------------------------------- */
@media (max-width: 424.98px) {
  .section-padding {
    padding: 56px 0;
  }

  .hero-section {
    padding-top: calc(var(--nav-height) + 24px);
    padding-bottom: 60px;
  }

  .hero-title {
    font-size: 1.7rem;
    line-height: 1.25;
  }

  .hero-subtitle {
    font-size: 0.9rem;
    margin-bottom: 24px;
  }

  .search-box {
    padding: 16px;
    margin: 0;
    max-width: 100%;
  }

  .search-field {
    padding: 0 12px;
  }

  .search-field input {
    padding: 12px 0;
    font-size: 0.9rem;
  }

  .search-field .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding: 12px 28px 12px 0;
    font-size: 0.9rem;
  }

  .mobile-nav-item {
    font-size: 0.62rem;
    padding: 6px 1px;
  }

  .mobile-nav-item span:not(.mobile-nav-menu-icon) {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-nav-menu-icon {
    width: 46px;
    height: 46px;
    font-size: 1.1rem;
  }

  .partner-logo {
    font-size: 0.95rem;
    gap: 8px;
  }

  .partner-logo i {
    font-size: 1.2rem;
  }

  .experts-logo-grid {
    margin-left: 0;
    margin-right: 0;
    gap: clamp(8px, 2.5vw, 16px);
  }

  .experts-desc {
    max-width: 100%;
  }

  .property-meta {
    font-size: 0.8rem;
    gap: 8px;
  }

  .property-meta span {
    flex: 1 1 auto;
  }

  .how-step-icon i {
    font-size: 1.6rem;
  }

  .stat-card {
    padding: 24px 12px;
  }

  .stat-icon {
    width: 48px;
    height: 48px;
  }

  .stat-number {
    font-size: 1.75rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  .testimonial-card blockquote {
    font-size: 0.95rem;
  }
}

/* --------------------------------------------
   MOBILE SMALL (375px - 424px)
   -------------------------------------------- */
@media (max-width: 374.98px) {
  body {
    font-size: 15px;
  }

  .hero-title {
    font-size: 1.55rem;
  }

  .section-tag {
    font-size: 0.7rem;
    letter-spacing: 1.5px;
  }

  .section-title {
    font-size: 1.55rem;
  }

  .btn-premium,
  .btn-outline-premium {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .search-toggle-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .property-badge,
  .property-type-badge {
    font-size: 0.65rem;
    padding: 4px 10px;
  }

  .favorite-btn {
    width: 36px;
    height: 36px;
  }

  .category-count {
    font-size: 0.7rem;
  }

  .how-step-label {
    font-size: 0.88rem;
  }

  .footer-heading {
    font-size: 0.95rem;
  }

  .newsletter-form .input-group {
    flex-direction: column;
  }

  .newsletter-form .form-control {
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
  }

  .newsletter-form .btn-premium {
    border-radius: var(--radius-sm);
    width: 100%;
  }
}

/* --------------------------------------------
   MOBILE EXTRA SMALL (320px - 374px)
   -------------------------------------------- */
@media (max-width: 319.98px) {
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero-title {
    font-size: 1.4rem;
  }

  .hero-subtitle {
    font-size: 0.85rem;
  }

  .search-field label {
    display: none;
  }

  .search-field {
    padding: 0 14px;
  }

  .property-meta {
    flex-direction: column;
    gap: 6px;
  }

  .agent-info span {
    font-size: 0.8rem;
  }

  .btn-view-details {
    font-size: 0.8rem;
    padding: 8px 12px;
  }

  .partners-track {
    gap: 40px;
  }

  .path-card-btn {
    align-self: stretch;
  }
}

/* --------------------------------------------
   TOUCH DEVICE OPTIMIZATIONS
   -------------------------------------------- */
@media (hover: none) and (pointer: coarse) {
  .gallery-nav {
    opacity: 0.92;
  }

  .property-card:hover,
  .offplan-card:hover {
    transform: none;
  }

  .category-card:hover {
    transform: scale(1.03);
  }

  .category-card:hover .category-icon {
    transform: scale(1.06);
    box-shadow: 0 2px 6px rgba(var(--accent-rgb), 0.15);
  }

  .magnetic-btn {
    transform: none !important;
  }

  .favorite-btn,
  .btn-premium,
  .btn-search,
  .back-to-top {
    min-height: 44px;
    min-width: 44px;
  }

  .nav-link {
    padding: 12px 16px !important;
  }
}

/* --------------------------------------------
   REDUCED MOTION
   -------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal-fade-up,
  .reveal-fade-left,
  .reveal-fade-right,
  .reveal-zoom-in {
    opacity: 1;
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }

  .partners-track {
    animation: none;
  }
}

/* --------------------------------------------
   PRINT STYLES
   -------------------------------------------- */
@media print {
  .glass-nav,
  .mobile-bottom-nav,
  .mobile-nav-overlay,
  .mobile-nav-sheet,
  .scroll-progress,
  .back-to-top,
  .cta-shape {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }

  .hero-section {
    min-height: auto;
    padding: 20px 0;
  }

  .hero-title,
  .hero-subtitle {
    color: #000;
  }
}

/* --------------------------------------------
   HIGH CONTRAST MODE
   -------------------------------------------- */
@media (prefers-contrast: high) {
  :root {
    --border: #000;
  }

  .btn-premium,
  .btn-search {
    border: 2px solid currentColor;
  }

  .property-card,
  .category-card,
  .amenity-card {
    border-width: 2px;
  }
}

/* --------------------------------------------
   LANDSCAPE MOBILE
   -------------------------------------------- */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-section {
    min-height: auto;
    padding: calc(var(--nav-height) + 20px) 0 40px;
  }

  .hero-cta {
    margin-bottom: 24px;
  }
}
