/* ==========================================================================
   NIGHTLIFE HOSPITALITY - ADVANCED MOBILE RESPONSIVE DESIGN SYSTEM
   Complete overhaul: Every page, every card, every grid fully responsive.
   ========================================================================== */

/* --- Prevent Horizontal Scrolling Globally --- */
html, body {
  overflow-x: hidden !important;
  width: 100% !important;
  position: relative;
}

/* --- Touch-friendly base for all interactive elements --- */
@media (pointer: coarse) {
  button, .btn-primary, .btn-secondary, .payment-tab-btn, .auth-tab-btn,
  .quantity-stepper button, .select-venue-btn, .btn-download-pass, .btn-print-pass {
    min-height: 44px;
  }
}

/* ==========================================================================
   1. TABLET & LAPTOP RESPONSIVE RULES (max-width: 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  /* ===== GLOBAL LAYOUT COMPONENTS ===== */
  .hero-content {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero-text {
    text-align: center;
  }

  .hero-tagline-box {
    text-align: center;
    border-left: none;
    border-top: 3px solid var(--gold-primary);
    border-radius: var(--radius-sm);
  }

  .hero-buttons {
    justify-content: center;
  }

  .how-it-works-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .showcase-block, 
  .showcase-block.reverse {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .showcase-block.reverse .showcase-text {
    order: 1;
  }

  .showcase-block.reverse .showcase-media {
    order: 2;
  }

  .contact-section-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }

  /* ===== CART PAGE: 2-col cart+checkout → stacked ===== */
  .cart-checkout-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* Checkout terminal not sticky on tablet */
  #checkout-terminal {
    position: static !important;
  }

  /* ===== ACTIVE PASSES grid ===== */
  #passes-grid-container {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* ===== VENUES CONTAINER (tickets page) ===== */
  #venues-container {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 1.5rem !important;
  }
}

/* ==========================================================================
   2. TABLET PORTRAIT & MOBILE OVERLAY RULES (max-width: 1150px)
   ========================================================================== */
@media (max-width: 1150px) {
  .header-top-bar {
    display: none;
  }

  .mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }

  .main-nav {
    position: fixed;
    top: 65px;
    left: 0;
    width: 100%;
    height: calc(100vh - 65px);
    background: rgba(13, 14, 21, 0.98);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5rem;
    padding: 2.5rem 1.5rem;
    transform: translateX(100%);
    transition: var(--transition-normal);
    z-index: 999;
    overflow-y: auto;
  }

  .main-nav.active {
    transform: translateX(0);
  }

  .nav-item {
    width: 100%;
    text-align: center;
  }

  .nav-link {
    font-size: 1.1rem;
    padding: 0.75rem 0;
    justify-content: center;
  }

  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    box-shadow: none;
    text-align: center;
    margin-top: 0.75rem;
    min-width: 100%;
    border-radius: var(--radius-sm);
    padding: 0.5rem 0;
  }

  .dropdown-item a {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }

  .dropdown-item a:hover {
    padding-left: 1rem;
    background: rgba(204, 170, 106, 0.2);
  }

  .protocol-timeline {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1.25rem;
    text-align: center;
  }

  /* Footer bottom links row */
  .footer-bottom > div:last-child {
    flex-direction: column !important;
    gap: 0.5rem !important;
    align-items: center !important;
  }
}

/* ==========================================================================
   3. SMALL TABLET & PHABLET RULES (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .section-padding {
    padding: 3.5rem 0;
  }

  .page-header-banner {
    padding: 120px 0 35px;
  }

  .page-header-banner h1 {
    font-size: clamp(1.6rem, 6vw, 2.2rem);
  }

  .legal-layout {
    grid-template-columns: 1fr;
  }

  .legal-sidebar {
    position: static;
  }

  .legal-sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .legal-contact-card {
    grid-template-columns: 1fr;
  }

  .legal-document {
    padding: 1.25rem;
  }

  /* ===== ALL INLINE 3-COL GRIDS → SINGLE COL =====
     (tickets steps, about pillars, reservation benefits, contact legal) */
  .how-it-works-grid,
  .protocol-timeline {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  /* ===== CART PAGE: Checkout contact fields 2-col → 1-col ===== */
  .checkout-contact-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  /* ===== CART PAGE: Card details grid (Expiry/CVC/ZIP) stays 3-col ===== */
  .card-details-grid {
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 0.5rem !important;
  }

  /* ===== PAYMENT TABS ===== */
  .payment-tabs {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem !important;
  }

  .payment-tab-btn {
    padding: 0.65rem 0.5rem !important;
    font-size: 0.8rem !important;
  }

  .payment-tab-btn i {
    font-size: 1.1rem !important;
  }

  /* ===== CART ITEM CARDS ===== */
  .cart-item-row {
    flex-direction: column !important;
    gap: 1rem !important;
  }

  .cart-item-controls {
    width: 100% !important;
    justify-content: space-between !important;
  }

  /* ===== CART HEADER ROW ===== */
  .cart-header-row {
    flex-direction: column !important;
    gap: 1rem !important;
    text-align: center !important;
  }

  .cart-header-row > div:last-child {
    justify-content: center !important;
    flex-wrap: wrap !important;
  }

  /* ===== GUEST LOGIN BANNER ===== */
  .guest-login-banner {
    flex-direction: column !important;
    text-align: center !important;
    gap: 1rem !important;
    padding: 1.25rem 1rem !important;
  }

  .guest-login-banner > div:first-child {
    flex-direction: column !important;
    text-align: center !important;
  }

  /* ===== WALLET SUMMARY CARD ===== */
  .wallet-summary-card {
    flex-direction: column !important;
    text-align: center !important;
  }

  .wallet-summary-card > div:last-child {
    flex-direction: column !important;
    gap: 1rem !important;
  }

  .wallet-summary-card div[style*="text-align: right"] {
    text-align: center !important;
  }

  /* ===== PROMO CODE INPUT ROW ===== */
  .promo-input-row {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

  .promo-input-row .btn-secondary {
    width: 100% !important;
    justify-content: center !important;
  }

  /* ===== CHECKOUT BADGES ROW ===== */
  .checkout-badges-row {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

  /* ===== PASSES HEADER ROW ===== */
  .passes-header-row {
    flex-direction: column !important;
    gap: 1rem !important;
    text-align: center !important;
  }

  .passes-header-row > div:last-child {
    justify-content: center !important;
  }

  /* ===== PASS ACTION BUTTONS ===== */
  .pass-action-buttons {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }

  /* ===== HERO VISUAL CARD ===== */
  .hero-visual-card > div[style*="display: flex; justify-content: space-between"] {
    flex-direction: column !important;
    text-align: center !important;
    gap: 0.75rem !important;
  }

  /* ===== VENUES CONTAINER: stack cards on mobile ===== */
  #venues-container {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  /* ===== TICKET MODAL form grids ===== */
  #ticket-reservation-form div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  /* ===== CONTACT FORM 2-col fields ===== */
  #page-contact-form div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  /* ===== CONSULTATION MODAL form 2-col ===== */
  #modal-consultation-form div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  /* ===== AUTH MODAL ===== */
  #auth-modal .modal-container {
    max-width: 100% !important;
    padding: 1.5rem 1rem !important;
  }

  /* ===== INLINE 3-COL GRIDS (about, services, reservation, tickets steps) ===== */
  div[style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* ===== INLINE 2-COL GRIDS (services, index expertise, concierge) ===== */
  div[style*="grid-template-columns: repeat(2, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  div[style*="grid-template-columns: 1fr 1fr; gap: 3rem"] {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  div[style*="grid-template-columns: 1fr 1fr; gap: 2.5rem"] {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* ===== DATE PICKER CARD (tickets page) ===== */
  .glass-card div[style*="display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap"] {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  .glass-card div[style*="min-width: 240px"] {
    min-width: 100% !important;
    max-width: 100% !important;
  }

  /* ===== VENUE SEARCH BAR (tickets page) ===== */
  .glass-card div[style*="display: flex; align-items: center; gap: 1rem"]:not(.cart-item-controls) {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

  /* ===== ACTION TOAST on mobile ===== */
  .action-toast {
    left: 1rem !important;
    right: 1rem !important;
    bottom: 1rem !important;
    max-width: none !important;
  }

  /* ===== SERVICES PAGE: Service card header ===== */
  .glass-card > div[style*="display: flex; gap: 1.25rem; align-items: flex-start"] {
    flex-direction: column !important;
    gap: 0.75rem !important;
    align-items: center !important;
    text-align: center !important;
  }
}

/* ==========================================================================
   4. SMARTPHONE MOBILE RULES (max-width: 480px)
   ========================================================================== */
@media (max-width: 480px) {
  h1 {
    font-size: clamp(1.5rem, 7vw, 2rem);
  }

  h2 {
    font-size: clamp(1.25rem, 5.5vw, 1.7rem);
  }

  h3 {
    font-size: clamp(1.05rem, 4.5vw, 1.3rem);
  }

  p {
    font-size: 0.92rem;
    line-height: 1.6;
  }

  .container {
    padding: 0 0.85rem;
  }

  .section-padding {
    padding: 2.75rem 0;
  }

  .brand-logo img {
    height: 38px;
  }

  .brand-name {
    font-size: 0.95rem;
    letter-spacing: 1px;
  }

  .hero-section {
    min-height: auto;
    padding-top: 100px;
    padding-bottom: 40px;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }

  .btn-primary, 
  .btn-secondary {
    width: 100%;
    min-height: 48px;
    font-size: 0.92rem;
    padding: 0.85rem 1.25rem;
    justify-content: center;
  }

  /* Prevent auto-zoom on iOS inputs */
  .form-control,
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px !important;
    padding: 0.85rem 1rem;
    min-height: 48px;
  }

  textarea.form-control {
    min-height: 110px;
  }

  .step-card {
    padding: 2rem 1.25rem 1.75rem;
  }

  .step-number {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }

  .feature-list li {
    font-size: 0.92rem;
  }

  .glass-card {
    padding: 1.25rem;
  }

  .breadcrumb-nav {
    flex-wrap: wrap;
    font-size: 0.82rem;
    justify-content: flex-start;
  }

  .page-header-banner {
    padding: 110px 0 30px;
  }

  .page-header-banner h1 {
    font-size: clamp(1.4rem, 6vw, 1.9rem);
  }

  .badge-tag {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
  }

  .escalation-protocol-box {
    padding: 1rem;
  }

  .terminal-highlight-card {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    padding: 1.25rem 1rem;
  }

  .terminal-icon {
    width: 50px;
    height: 50px;
    font-size: 1.4rem;
  }

  /* ===== CART: Card fields compact styling ===== */
  .card-details-grid {
    gap: 0.4rem !important;
  }

  #card-fields-container .form-control {
    font-size: 14px !important;
    padding: 0.65rem 0.4rem !important;
    letter-spacing: 0.5px !important;
    min-height: 42px !important;
  }

  #card-number {
    font-size: 14px !important;
    letter-spacing: 0.5px !important;
  }

  .card-input-wrapper .card-icon {
    font-size: 1rem !important;
    right: 0.6rem !important;
  }

  /* ===== CHECKOUT TERMINAL ===== */
  #checkout-terminal {
    padding: 1.25rem !important;
  }

  #checkout-terminal h3 {
    font-size: 1.15rem !important;
  }

  #checkout-total-display {
    font-size: 1.25rem !important;
  }

  /* ===== PAYMENT TABS COMPACT ===== */
  .payment-tabs {
    gap: 0.4rem !important;
  }

  .payment-tab-btn {
    padding: 0.5rem 0.35rem !important;
    font-size: 0.75rem !important;
    gap: 0.2rem !important;
  }

  .payment-tab-btn i {
    font-size: 1rem !important;
  }

  /* ===== PASS CARD: action buttons ===== */
  .btn-download-pass, .btn-print-pass {
    font-size: 0.8rem !important;
    padding: 0.55rem 0.85rem !important;
  }

  /* ===== VENUE CARDS ===== */
  .venue-card {
    padding: 1.25rem !important;
  }

  .venue-card h3 {
    font-size: 1.05rem !important;
  }

  .venue-card .feature-list li {
    font-size: 0.8rem !important;
    gap: 0.5rem !important;
    margin-bottom: 0.6rem !important;
  }

  /* ===== CONTACT PAGE ===== */
  .contact-detail-item {
    gap: 0.85rem;
  }

  .contact-detail-item i {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  /* ===== MODALS ===== */
  .modal-overlay {
    padding: 0.5rem;
  }

  .modal-container {
    padding: 1.25rem 1rem;
    max-width: 100vw;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--radius-md);
  }

  .modal-close-btn {
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
  }

  .modal-container form div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  /* ===== CONCIERGE PAGE: channel badges ===== */
  div[style*="display: flex; gap: 1rem; margin: 1.5rem 0; flex-wrap: wrap"],
  div[style*="display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap"] {
    gap: 0.5rem !important;
    justify-content: center !important;
  }

  /* ===== FLATPICKR ===== */
  .flatpickr-calendar {
    width: calc(100vw - 2rem) !important;
    max-width: 340px !important;
  }

  /* ===== AUTH MODAL TABS ===== */
  .auth-tab-btn {
    font-size: 0.85rem !important;
    padding: 0.65rem 1rem !important;
  }
}

/* ==========================================================================
   5. ULTRA-SMALL SMARTPHONES (max-width: 360px)
   ========================================================================== */
@media (max-width: 360px) {
  .container {
    padding: 0 0.65rem;
  }

  .brand-name {
    font-size: 0.82rem;
    letter-spacing: 0.5px;
  }

  .brand-logo img {
    height: 34px;
  }

  .badge-tag {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
  }

  .glass-card {
    padding: 1rem;
  }

  .modal-container {
    padding: 1rem 0.75rem;
  }

  h1 {
    font-size: clamp(1.3rem, 6.5vw, 1.75rem);
  }

  h2 {
    font-size: clamp(1.15rem, 5vw, 1.5rem);
  }

  /* ===== CART: Card fields ultra compact ===== */
  .card-details-grid {
    gap: 0.3rem !important;
  }

  #card-fields-container .form-control {
    padding: 0.55rem 0.3rem !important;
    font-size: 13px !important;
    min-height: 38px !important;
  }

  #card-fields-container .form-label {
    font-size: 0.72rem !important;
  }

  .payment-tab-btn {
    padding: 0.45rem 0.25rem !important;
    font-size: 0.7rem !important;
  }

  .payment-tab-btn i {
    font-size: 0.9rem !important;
  }

  .quantity-stepper button {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  .quantity-stepper span {
    width: 28px;
    font-size: 0.8rem;
  }

  /* ===== PASS DETAILS GRID single col on ultra small ===== */
  .pass-details-grid {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }

  /* ===== CONTACT MAP ===== */
  .glass-card iframe {
    height: 180px !important;
  }
}

/* ==========================================================================
   6. LANDSCAPE MOBILE SPECIAL RULES
   ========================================================================== */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-section {
    min-height: auto;
    padding-top: 80px;
    padding-bottom: 30px;
  }

  .page-header-banner {
    padding: 90px 0 25px;
  }

  .modal-container {
    max-height: 95vh;
    overflow-y: auto;
  }
}

/* ==========================================================================
   7. PRINT OPTIMIZATIONS
   ========================================================================== */
@media print {
  .hero-section,
  .header-top-bar,
  .mobile-toggle,
  .main-nav {
    display: none !important;
  }

  .glass-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
