/* ==========================================================================
   SugarDatingGlobal.com — Luxury Responsive Design & Mobile UI/UX Engine
   Optimized for Fluid Mobile Touch, iOS/Android Safe Areas & Zero CLS
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Global Mobile Reset & Touch Standards
   -------------------------------------------------------------------------- */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

html {
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  position: relative;
}

/* --------------------------------------------------------------------------
   2. Mobile Navigation Drawer
   -------------------------------------------------------------------------- */
.mobile-drawer {
  display: none;
  position: fixed;
  top: 0;
  right: -100%;
  width: 86%;
  max-width: 360px;
  height: 100vh;
  height: 100dvh;
  background: #FFFFFF;
  z-index: 2500;
  box-shadow: -10px 0 35px rgba(24, 24, 36, 0.18);
  transition: right 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  flex-direction: column;
  padding: max(1.25rem, var(--safe-top)) 1.25rem max(1.5rem, var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-drawer.open {
  display: flex !important;
  right: 0;
}

.drawer-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(24, 24, 36, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2400;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.drawer-overlay.active {
  display: block !important;
  opacity: 1;
  visibility: visible;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.25rem;
}

.drawer-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border);
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.drawer-close:active {
  background: var(--color-pink);
  color: #FFFFFF;
  transform: scale(0.95);
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.drawer-link {
  font-size: 1.025rem;
  font-weight: 700;
  color: var(--color-text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  min-height: 46px;
}

.drawer-link:hover, .drawer-link:active {
  color: var(--color-pink);
  background: rgba(224, 62, 108, 0.06);
}

.drawer-link-highlight {
  background: var(--bg-accent-subtle);
  border: 1px solid rgba(224, 62, 108, 0.15);
}

/* --------------------------------------------------------------------------
   3. Sticky Mobile Bottom Action Bar
   -------------------------------------------------------------------------- */
.mobile-sticky-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(224, 62, 108, 0.15);
  padding: 0.65rem 1rem max(0.65rem, var(--safe-bottom));
  z-index: 1500;
  box-shadow: 0 -4px 20px rgba(24, 24, 36, 0.08);
}

.mobile-sticky-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 520px;
  margin: 0 auto;
}

.mobile-sticky-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mobile-sticky-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--color-text-main);
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.mobile-sticky-sub {
  font-size: 0.725rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   4. Breakpoint: Large Tablets & Laptops (< 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .hero-visual-card {
    max-width: 540px;
    margin: 0 auto;
  }
  
  .discovery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .discovery-grid .filter-btn-wrap {
    grid-column: span 2;
  }
  
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .footer-brand {
    grid-column: span 3;
    margin-bottom: 1rem;
  }
}

/* --------------------------------------------------------------------------
   5. Breakpoint: Tablets & Mobile (< 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Prevent iOS auto-zoom on input focus */
  input, select, textarea, .form-input {
    font-size: 16px !important;
  }

  /* Header & Navigation */
  .site-header {
    padding: 0.65rem 0;
    background: rgba(250, 248, 245, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .main-nav, .header-actions .btn-secondary {
    display: none;
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .header-actions .btn-primary {
    display: inline-flex;
    padding: 0.42rem 0.95rem;
    font-size: 0.825rem;
    height: 38px;
    white-space: nowrap;
    border-radius: var(--radius-full);
  }

  .btn-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--color-border);
    background: #FFFFFF;
    color: var(--color-text-main);
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-fast);
  }

  .btn-mobile-toggle:active {
    background: var(--bg-accent-subtle);
    transform: scale(0.96);
  }

  /* Hero Section */
  .hero {
    padding: 2.25rem 0 2.75rem;
  }

  .hero h1 {
    font-size: clamp(2rem, 7vw, 2.85rem);
    line-height: 1.15;
    margin-bottom: 1rem;
  }

  .hero p.lead {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
  }

  .hero-actions {
    gap: 0.75rem;
    margin-bottom: 2rem;
  }

  .hero-actions .btn {
    min-height: 48px;
    padding: 0.75rem 1.5rem;
  }

  /* Hero Floating Badges Overflow Containment */
  .hero-visual-card {
    position: relative;
    max-width: 100%;
    border-radius: var(--radius-lg);
  }

  .hero-float-badge {
    top: 12px;
    right: 12px;
    font-size: 0.78rem;
    padding: 0.4rem 0.85rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  }

  .hero-float-card-left {
    bottom: 12px;
    left: 12px;
    right: 12px;
    max-width: calc(100% - 24px);
    padding: 0.6rem 0.9rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  }

  /* Trust Strip */
  .trust-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.25rem 1rem;
  }

  /* Interactive Discovery Filter System */
  .discovery-card {
    margin-top: 1.5rem;
    padding: 1.25rem 1rem;
    border-radius: var(--radius-lg);
  }

  .discovery-quick-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }

  /* Smooth Horizontal Swipeable Chips on Mobile */
  .filter-chips, .filter-chips-scroll {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 0.5rem !important;
    padding: 0.25rem 0.25rem 0.65rem !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .filter-chips::-webkit-scrollbar, .filter-chips-scroll::-webkit-scrollbar {
    display: none;
  }

  .discovery-quick-filters .chip-btn, .filter-chips-scroll .chip-btn {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    scroll-snap-align: start;
    font-size: 0.825rem !important;
    padding: 0.48rem 1rem !important;
    min-height: 38px;
  }

  .discovery-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .discovery-grid .filter-btn-wrap {
    grid-column: 1;
  }

  .discovery-grid .btn {
    width: 100%;
    min-height: 48px;
  }

  /* Profile Cards Grid */
  .profiles-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .profile-media {
    height: 290px;
  }

  .profile-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
  }

  .profile-actions .btn {
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    min-height: 42px;
  }

  .profile-headline {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Profile Details Modal & Banner */
  .profile-modal-banner {
    margin: -1.75rem -1.25rem 1.25rem !important;
    height: 210px !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  }

  .profile-modal-banner-overlay {
    padding: 1rem 1.25rem !important;
  }

  /* Modal Dialog & Bottom Sheet */
  .modal-overlay {
    padding: 1rem 0.75rem;
  }

  .modal-content {
    padding: 1.75rem 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    width: 100%;
    max-height: 88vh;
  }

  .modal-close {
    top: 1rem;
    right: 1rem;
    width: 38px;
    height: 38px;
  }

  .role-cards-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin: 1.25rem 0;
  }

  .role-select-card {
    padding: 1.25rem 1rem;
  }

  .tags-selector {
    gap: 0.5rem;
    margin: 1rem 0 1.5rem;
  }

  .tag-btn {
    padding: 0.45rem 0.95rem;
    font-size: 0.825rem;
    min-height: 38px;
  }

  /* Audience & Steps */
  .audience-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  /* Articles Directory & Layout */
  .articles-directory-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .article-layout-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .article-sidebar {
    position: static;
  }

  .guide-hero-img-wrap {
    height: 220px;
    border-radius: var(--radius-md);
  }

  .guide-hero-img {
    height: 220px;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .footer-brand {
    grid-column: span 2;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  /* Sticky Bottom Bar Display */
  .mobile-sticky-bar {
    display: block;
  }

  body {
    padding-bottom: calc(75px + var(--safe-bottom));
  }
}

/* --------------------------------------------------------------------------
   6. Breakpoint: Small Mobile (< 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .trust-strip {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .footer-brand {
    grid-column: 1;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .brand-logo span {
    font-size: 1.1rem;
  }

  .brand-logo svg {
    width: 30px;
    height: 30px;
  }

  .mobile-sticky-signin {
    display: none;
  }

  .mobile-sticky-join {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   7. Breakpoint: Ultra-Compact Mobile (< 360px)
   -------------------------------------------------------------------------- */
@media (max-width: 360px) {
  .header-actions .btn-primary {
    padding: 0.38rem 0.75rem;
    font-size: 0.775rem;
  }

  .brand-logo span {
    font-size: 1rem;
  }

  .hero h1 {
    font-size: 1.85rem;
  }

  .discovery-card {
    padding: 1rem 0.75rem;
  }
}
