/* Overlay */
.gs-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 99990;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

 .gs-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;

  /* 🔒 HIDE BY DEFAULT */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition: opacity 0.3s ease;
}


/* Modal Box */
.gs-modal-content {
  background: #fff;
  width: min(95%, 1400px);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 18px;
  box-shadow: 0 40px 120px rgba(0,0,0,0.25);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

/* Close Button */
.gs-close {
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 2.25rem;
  background: none;
  border: none;
  color: var(--navy);
  cursor: pointer;
  z-index: 2;
}

/* Active State */
.gs-modal.active,
.gs-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.gs-modal.active .gs-modal-content {
  transform: scale(1);
}

/* Mobile Fix */
@media (max-width: 768px) {
  .gs-modal-content {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
}

/* Inner padding system */
.gs-modal-inner {
  padding: 3rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Tablet */
@media (max-width: 1024px) {
  .gs-modal-inner {
    padding: 2.5rem 2rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .gs-modal-inner {
    padding: 2rem 1.25rem;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .gs-modal-inner {
    padding: 1.5rem 1rem;
  }
}
/* Modal-safe layout overrides */
.gs-modal-inner #contact-section > div > div {
  grid-template-columns: 1fr !important;
  gap: 2.5rem !important;
}

/* Desktop enhancement */
@media (min-width: 1024px) {
  .gs-modal-inner #contact-section > div > div {
    grid-template-columns: 1.1fr 0.9fr !important;
  }
}

/* Prevent horizontal scrolling */
* {
box-sizing: border-box;
}

html, body {
overflow-x: hidden;
width: 100%;
max-width: 100vw;
}

main {
overflow-x: hidden;
width: 100%;
max-width: 100vw;
}

/* Ensure section doesn't overflow */
section[style*="padding: 5rem 2rem"] {
max-width: 100vw;
overflow-x: hidden;
}

section[style*="padding: 5rem 2rem"] > div {
max-width: 100%;
overflow-x: hidden;
}

section[style*="padding: 5rem 2rem"] > div > div {
max-width: 100%;
overflow-x: hidden;
}

/* Ensure all child elements are constrained */
section[style*="padding: 5rem 2rem"] * {
max-width: 100%;
}

/* Fix inputs and form elements */
input, textarea, button {
max-width: 100%;
box-sizing: border-box;
}

@media (max-width: 968px) {
section[style*="padding: 5rem 2rem"] {
    padding: 3rem 1rem !important;
    max-width: 100vw !important;
}

section[style*="padding: 5rem 2rem"] > div {
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

section[style*="padding: 5rem 2rem"] > div > div {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    max-width: 100% !important;
    width: 100% !important;
}

section[style*="padding: 5rem 2rem"] > div > div > div {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

section[style*="padding: 5rem 2rem"] > div > div > div:last-child {
    position: relative !important;
    top: 0 !important;
    padding: 1.5rem 1rem !important;
}

/* Fix contact cards padding on mobile */
section[style*="padding: 5rem 2rem"] > div > div > div > div[style*="padding: 1.25rem 1.5rem"] {
    padding: 1rem !important;
}

/* Fix form inputs on mobile */
input[type="text"],
input[type="email"],
textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
}

@media (max-width: 480px) {
section[style*="padding: 5rem 2rem"] {
    padding: 2rem 1rem !important;
}

section[style*="padding: 5rem 2rem"] > div > div {
    gap: 1.5rem !important;
}

section[style*="padding: 5rem 2rem"] > div > div > div:last-child {
    padding: 1.25rem 0.75rem !important;
}

/* Reduce font sizes on very small screens */
h2 {
    font-size: 1.5rem !important;
}

h3 {
    font-size: 1.2rem !important;
}
}
@media (max-width: 768px) {
  /* Stack columns with form first */
  .gs-grid {
      display: flex !important;
      flex-direction: column-reverse;
      gap: 1rem !important;
  }
  .gs-grid > .gs-left,
  .gs-grid > .gs-right {
      width: 100%;
      max-width: 100%;
  }

  /* Limit modal width and center it so it doesn't span full screen */
  .gs-modal-content {
      width: calc(100% - 40px) !important;
      max-width: 440px !important;
      margin: 18px auto !important;
      padding: 12px !important;
      border-radius: 12px !important;
      box-shadow: 0 12px 40px rgba(0,0,0,0.35) !important;
  }

  /* Reduce inner spacing for compact mobile layout */
  .gs-modal-inner {
      padding: 0 !important;
  }

  /* Disable sticky behavior so content flows naturally */
  .gs-right {
      position: static !important;
      top: auto !important;
  }

  /* Slightly tighten form button and card spacing */
  .gs-right form { gap: 0.9rem !important; }
  .gs-grid { gap: 0.8rem !important; }
}
