/* ==========================================================================
   SAVVUN — RESPONSIVE MEDIA QUERIES (PRESERVING DESKTOP UX)
   ========================================================================== */

/* Large Desktop Displays (1440px - 1920px) — UNTOUCHED */
@media (max-width: 1440px) {
  .hero-title { font-size: 3.5rem; }
}

/* Standard Laptops & Desktops (1024px - 1400px) */
@media (max-width: 1400px) {
  .nav-links {
    gap: 0.25rem;
  }
  .nav-link {
    font-size: 0.8rem;
    padding: 0.35rem 0.55rem;
    white-space: nowrap;
  }
  .nav-actions {
    gap: 0.35rem;
  }
  .nav-actions .btn {
    padding: 0.4rem 0.65rem !important;
    font-size: 0.775rem !important;
  }
}

@media (max-width: 1280px) {
  .hero-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .ecosystem-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
}

/* ==========================================================================
   TABLET & MOBILE RESPONSIVE SUITE (<= 1024px)
   ========================================================================== */
/* ==========================================================================
   TABLET & MOBILE RESPONSIVE SUITE (<= 1180px)
   ========================================================================== */
/* Background overlay backdrop for mobile menu */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 10, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 1340px) {
  .nav-links { display: none !important; }
  .nav-actions .btn { display: none !important; } /* Hide desktop header action buttons on mobile header bar */
  .mobile-toggle { display: block !important; }

  /* Mobile Glass Drawer Menu */
  .nav-drawer {
    display: flex !important;
    position: fixed;
    top: calc(5rem + env(safe-area-inset-top, 0px));
    left: 1rem;
    right: 1rem;
    max-height: calc(85vh - env(safe-area-inset-top, 0px));
    border-radius: 24px;
    border: 1px solid rgba(0, 240, 255, 0.25);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(0, 240, 255, 0.15);
    background: rgba(5, 9, 20, 0.97);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    padding: 1.75rem 1.25rem;
    flex-direction: column;
    gap: 0.75rem;
    transform: translateY(-20px) scale(0.96);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-drawer.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-drawer .nav-link {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    transition: color 0.2s ease, padding-left 0.2s ease;
  }

  .nav-drawer .nav-link:hover,
  .nav-drawer .nav-link.active {
    color: var(--color-cyan);
    padding-left: 0.5rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2.5rem;
  }

  .hero-title { 
    font-size: clamp(2.2rem, 6vw, 3.25rem); 
    hyphens: manual;
    word-break: break-word;
  }
  
  .hero-cta-group { 
    justify-content: center; 
  }

  .security-core-container {
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
  }

  .status-bar-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr !important;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

/* ==========================================================================
   SMARTPHONES & TABLETS (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  .container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .navbar { 
    height: auto; 
    top: calc(0.75rem + env(safe-area-inset-top, 0px));
  }

  .nav-container {
    padding: 0.5rem 1rem;
  }

  .nav-drawer { 
    top: calc(4.5rem + env(safe-area-inset-top, 0px)); 
    left: 0.75rem;
    right: 0.75rem;
    padding: 1.5rem 1rem; 
  }

  .hero-section { 
    padding-top: calc(90px + env(safe-area-inset-top, 0px)); 
    padding-bottom: 40px; 
  }
  
  .hero-content-box {
    padding: 1.5rem;
    border-radius: var(--radius-md);
  }

  .hero-title { 
    font-size: clamp(1.85rem, 5.5vw, 2.5rem); 
    line-height: 1.18;
    letter-spacing: -0.02em;
  }

  .hero-subtitle { 
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
    align-items: stretch;
  }

  .hero-cta-group .btn,
  .hero-cta-group a.btn {
    width: 100%;
    min-height: 48px; /* Touch target accessibility */
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hero-link-secondary {
    display: inline-block;
    padding: 0.5rem;
    text-align: center;
  }

  .section-title {
    font-size: clamp(1.5rem, 4.5vw, 2.25rem);
  }

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

  .section-tag {
    font-size: 0.7rem;
    padding: 0.35rem 0.75rem;
    margin-bottom: 1rem;
  }

  .security-core-container {
    max-width: 320px;
    height: 320px !important;
  }

  .status-bar-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .status-bar-card {
    padding: 1rem 1.25rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .ecosystem-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .ecosystem-card {
    padding: 1.25rem;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 100%;
  }

  .pricing-card {
    padding: 1.5rem 1.25rem;
  }

  .pricing-header h3 {
    font-size: 1.35rem;
  }

  .price-amount {
    font-size: 2.25rem;
  }

  /* Responsive Tables Wrapper */
  .table-responsive,
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  /* Form controls touch optimization (prevents iOS auto-zoom on inputs) */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
    min-height: 48px;
    padding: 0.75rem 1rem;
  }

  .form-group {
    margin-bottom: 1.15rem;
  }

  /* Modals on Mobile */
  .modal-content,
  .glass-modal {
    width: 92% !important;
    max-width: 100% !important;
    padding: 1.5rem 1.25rem !important;
    margin: 1rem auto !important;
    max-height: 90vh;
    overflow-y: auto;
  }

  .hotel-node-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .mockup-frame {
    border-radius: var(--radius-sm);
  }

  .mockup-header {
    height: 32px;
    padding: 0 0.75rem;
  }

  .mockup-title {
    font-size: 0.65rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mockup-body {
    padding: 1rem;
  }

  .code-terminal {
    font-size: 0.75rem;
    padding: 0.85rem;
    word-break: break-all;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Contact Page Mobile Specifics */
  .contact-section {
    padding-top: calc(95px + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: 2.5rem !important;
  }

  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }

  .contact-card {
    padding: 1.5rem 1.15rem !important;
  }

  .contact-info-box {
    text-align: center;
  }

  .contact-info-box .section-desc {
    margin-left: auto;
    margin-right: auto;
  }

  /* Global Overflow Safety for Mobile */
  *, *::before, *::after {
    max-width: 100%;
  }

  body {
    overflow-x: hidden !important;
  }

  .hero-title, 
  .section-title, 
  h1, h2, h3, h4 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: manual !important;
  }

  .hero-title {
    font-size: clamp(1.6rem, 5vw, 2.3rem) !important;
    line-height: 1.2 !important;
  }

  .section-title {
    font-size: clamp(1.4rem, 4.2vw, 2rem) !important;
  }

  /* Form & Input Overflow fix for Mobile */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  select,
  textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    font-size: 16px !important;
    min-height: 48px;
  }

  .form-group, .input-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .contact-info-box span,
  .contact-info-box strong {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1.25rem;
    text-align: center;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }

  /* Disable hover cursor glows on touch devices */
  .custom-cursor-dot,
  .custom-cursor-ring {
    display: none !important;
  }
}

/* ==========================================================================
   COMPACT MOBILE SCREENS (320px - 430px)
   ========================================================================== */
@media (max-width: 430px) {
  .container { 
    padding-left: 0.85rem !important; 
    padding-right: 0.85rem !important; 
  }

  .brand-logo { font-size: 1.15rem; }
  .brand-icon, .brand-icon-img { width: 26px; height: 26px; }

  .hero-title { font-size: 1.55rem !important; }
  .section-title { font-size: 1.35rem !important; }
  
  .security-core-container {
    max-width: 270px;
    height: 270px !important;
  }

  .btn {
    padding: 0.65rem 1rem;
  }

  .contact-card, .glass-panel {
    padding: 1.25rem 0.85rem !important;
  }
}

/* Micro Mobile Screens (320px - 360px) */
@media (max-width: 360px) {
  .hero-title { font-size: 1.4rem !important; }
  .section-title { font-size: 1.25rem !important; }
  .nav-drawer { padding: 1.25rem 0.75rem; }
  .nav-drawer .nav-link { font-size: 1rem; }
}
