/**
 * GSH Developers Real Estate Marketplace
 * Responsive Styles: Mobile Drawer, Bottom Bar & Touch Layouts
 */

@media (max-width: 1024px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: flex !important; }

  .gsh-footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .gsh-hero-headline {
    font-size: 38px;
  }

  .search-fields-grid {
    grid-template-columns: 1fr 1fr;
  }

  .search-field-action {
    grid-column: span 2;
  }

  .search-purpose-tabs {
    flex-wrap: wrap;
    gap: 6px;
  }

  .gsh-tab-btn {
    font-size: 13px;
    padding: 8px 14px;
  }

  .about-flex-layout {
    flex-direction: column;
  }

  .gsh-search-layout {
    flex-direction: column;
  }

  .gsh-single-grid {
    flex-direction: column;
  }

  .gsh-single-sidebar-col {
    width: 100%;
  }

  .contact-page-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {
  .gsh-topbar {
    display: none;
  }

  .gsh-header-inner {
    height: 70px;
  }

  .gsh-hero-section {
    padding: 50px 0 70px 0;
  }

  .gsh-hero-headline {
    font-size: 30px;
  }

  .gsh-hero-subtext {
    font-size: 15px;
  }

  /* Search Box - fully stacked on mobile */
  .gsh-hero-search-box {
    padding: 12px 14px 18px 14px;
    border-radius: 12px;
  }

  .search-purpose-tabs {
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 10px;
    margin-bottom: 12px;
  }

  .gsh-tab-btn {
    font-size: 12px;
    padding: 7px 12px;
    gap: 5px;
  }

  .search-fields-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .search-field-action {
    grid-column: span 2;
  }

  .gsh-btn-search {
    padding: 12px 16px;
    font-size: 14px;
  }

  .gsh-properties-grid {
    grid-template-columns: 1fr;
  }

  .single-prop-title-row {
    flex-direction: column;
    gap: 15px;
  }

  .single-price-box {
    text-align: left;
    width: 100%;
  }

  .single-hero-img {
    height: 280px;
  }

  .gsh-specs-ribbon {
    grid-template-columns: 1fr 1fr;
  }

  .specs-table-grid {
    grid-template-columns: 1fr;
  }

  .cta-banner-box {
    flex-direction: column;
    text-align: center;
    padding: 30px 20px;
  }

  .cta-action-buttons {
    flex-direction: column;
    width: 100%;
  }

  .gsh-footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .gsh-footer-bottom {
    flex-direction: column;
    gap: 14px;
    text-align: center;
    padding-bottom: 70px; /* Space for mobile bottom bar */
  }

  .gsh-compare-floating-bar {
    bottom: 60px;
  }

  /* MOBILE FILTER DRAWER */
  .gsh-filter-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 360px;
    height: 100vh;
    z-index: 10001;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: 0 0 30px rgba(0,0,0,0.3);
  }

  .gsh-filter-sidebar.open {
    left: 0;
  }

  .sidebar-header.mobile-only {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gsh-gray-200);
  }

  .drawer-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: var(--gsh-navy);
  }

  .tools-quick-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* MOBILE STICKY BOTTOM ACTION BAR */
.gsh-mobile-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #FFFFFF;
  border-top: 1px solid var(--gsh-gray-200);
  box-shadow: 0 -4px 15px rgba(0,0,0,0.08);
  display: flex;
  z-index: 9999;
}

.mob-action-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--gsh-navy);
  gap: 2px;
}

.mob-action-btn .dashicons {
  font-size: 20px;
  width: 20px;
  height: 20px;
}

.mob-action-btn.btn-call {
  background: var(--gsh-navy);
  color: #fff;
}

.mob-action-btn.btn-whatsapp {
  background: #25D366;
  color: #fff;
}

.mob-action-btn.btn-inquiry,
.mob-action-btn.btn-search {
  background: var(--gsh-gold);
  color: var(--gsh-navy);
}

/* MOBILE DRAWER NAVIGATION */
.gsh-mobile-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}

.gsh-mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gsh-navy);
  border-radius: 2px;
}

.gsh-mobile-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 85%;
  max-width: 340px;
  height: 100vh;
  background: #fff;
  z-index: 10002;
  box-shadow: -5px 0 25px rgba(0,0,0,0.2);
  transition: right 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.gsh-mobile-drawer.open {
  right: 0;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--gsh-gray-200);
}

.drawer-title {
  font-family: var(--gsh-font-heading);
  font-weight: 800;
  color: var(--gsh-navy);
  font-size: 16px;
}

.drawer-content {
  padding: 20px;
  flex: 1;
}

.drawer-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-nav-list li a {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--gsh-navy);
  padding: 6px 0;
}

.drawer-contact-info {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--gsh-gray-200);
}

.drawer-contact-info p {
  margin: 4px 0 14px 0;
  font-size: 13px;
  color: var(--gsh-gray-500);
}

.drawer-phones {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.phone-btn, .wa-btn {
  display: block;
  text-align: center;
  padding: 10px;
  border-radius: var(--gsh-radius-sm);
  font-weight: 700;
  font-size: 13px;
}

.phone-btn { background: var(--gsh-navy); color: #fff; }
.wa-btn { background: #25D366; color: #fff; }

.gsh-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  z-index: 10000;
  display: none;
}

.gsh-drawer-backdrop.show {
  display: block;
}

.gsh-mobile-filter-trigger {
  background: var(--gsh-navy);
  color: #fff;
  border: none;
  border-radius: var(--gsh-radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Extra small phones: single column search */
@media (max-width: 480px) {
  .gsh-hero-section {
    padding: 30px 0 50px 0;
  }

  .gsh-hero-headline {
    font-size: 26px;
  }

  .gsh-hero-search-box {
    padding: 10px 12px 16px 12px;
  }

  .search-purpose-tabs {
    gap: 5px;
  }

  .gsh-tab-btn {
    font-size: 11px;
    padding: 6px 10px;
    gap: 4px;
  }

  .search-fields-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .search-field-action {
    grid-column: span 1;
  }

  .search-select {
    height: 44px;
    font-size: 14px;
  }

  .gsh-hero-pills {
    gap: 6px;
    font-size: 12px;
  }

  .pill-link {
    padding: 4px 10px;
  }
}

@media (max-width: 1024px) {
  .gsh-nav-login-link,
  .gsh-header-actions > .gsh-nav-cta-btn {
    display: none !important;
  }

  .gsh-header-inner {
    gap: 12px;
  }

  .gsh-properties-grid,
  .gsh-props-cards-grid,
  .gsh-category-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gsh-container > div[style*="grid-template-columns:250px 1fr"],
  .gsh-container > div[style*="grid-template-columns:260px 1fr"] {
    grid-template-columns: 220px minmax(0, 1fr) !important;
    gap: 20px !important;
  }

  .gsh-container > div[style*="grid-template-columns:250px 1fr"] > aside,
  .gsh-container > div[style*="grid-template-columns:260px 1fr"] > aside {
    width: auto !important;
    min-width: 0;
  }

  .gsh-single-sidebar-col {
    flex: 1 1 100%;
  }

  .gsh-home-announcement {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 1fr);
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .gsh-container {
    padding-left: 18px;
    padding-right: 18px;
  }

  .gsh-header-inner {
    height: 64px !important;
    padding-left: 14px;
    padding-right: 14px;
  }

  .gsh-brand .custom-logo,
  .gsh-brand img {
    max-width: 150px;
    max-height: 42px;
    width: auto;
    height: auto;
  }

  .gsh-header-actions {
    gap: 12px;
  }

  .gsh-hero-section {
    background-position: center;
  }

  .gsh-properties-grid,
  .gsh-props-cards-grid,
  .gsh-category-cards-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .gsh-container > div[style*="grid-template-columns:250px 1fr"],
  .gsh-container > div[style*="grid-template-columns:260px 1fr"] {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 18px !important;
  }

  .gsh-container > div[style*="grid-template-columns:250px 1fr"] > aside,
  .gsh-container > div[style*="grid-template-columns:260px 1fr"] > aside {
    position: static !important;
    width: 100% !important;
  }

  .gsh-container > div[style*="grid-template-columns:1fr 1fr"],
  .gsh-container > div[style*="grid-template-columns:1fr 1fr;"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .gsh-container > div[style*="display:flex;justify-content:space-between"] {
    align-items: stretch !important;
    flex-direction: column;
    gap: 14px;
  }

  .gsh-container > div[style*="grid-template-columns:250px 1fr"] > main,
  .gsh-container > div[style*="grid-template-columns:260px 1fr"] > main {
    min-width: 0;
    padding: 22px !important;
  }

  .gsh-container table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }

  .gsh-wizard-wrap,
  .gsh-wizard-step-body,
  .gsh-wizard-nav {
    max-width: 100%;
  }

  .gsh-wizard-steps-nav {
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .gsh-specs-ribbon {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gsh-single-grid {
    gap: 22px;
  }

  .gsh-home-announcement {
    grid-template-columns: minmax(0, 1fr);
  }

  .gsh-home-announcement-content {
    padding: 20px;
  }

  .single-content-box {
    padding: 22px 18px;
  }

  .gsh-compare-table-wrap,
  .gsh-table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .gsh-register-grid,
  .gsh-profile-fields,
  .agent-profile-form-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .gsh-auth-container,
  .gsh-submit-wizard,
  .gsh-wizard-wrap {
    width: 100%;
    max-width: 100%;
  }

  img,
  video,
  iframe {
    max-width: 100%;
  }

  .gsh-mobile-drawer {
    height: 100vh;
    height: 100dvh;
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  .gsh-container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .gsh-header-actions {
    gap: 8px;
  }

  .gsh-brand .brand-title {
    font-size: 15px !important;
  }

  .gsh-brand .brand-tagline {
    font-size: 9px !important;
  }

  .header-icon-btn svg {
    width: 20px;
    height: 20px;
  }

  .gsh-hero-headline {
    font-size: 26px;
    line-height: 1.18;
  }

  .gsh-hero-pills {
    justify-content: center;
  }

  .gsh-specs-ribbon,
  .specs-table-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .gsh-container > div[style*="grid-template-columns:250px 1fr"] > main,
  .gsh-container > div[style*="grid-template-columns:260px 1fr"] > main {
    padding: 18px 14px !important;
  }

  .gsh-footer-bottom {
    padding-bottom: 76px;
  }

  .gsh-mobile-bottom-bar {
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: content-box;
  }
}
