/* Mobile and small-screen layout refinements */
*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
video,
svg {
  max-width: 100%;
}

body {
  overflow-x: hidden;
}

.top-bar-content,
.nav-links,
.contact-grid,
.quote-grid,
.resource-grid,
.booking-grid,
.horizontal-content,
.horizontal-left {
  min-width: 0;
}

.contact-text a,
.contact-text p,
.freecontent-link,
.freecontent-link span,
.pdf-title,
.pdf-subtitle,
.legal-disclaimer,
.content-card,
.quote-text,
.horizontal-left p,
.horizontal-left h3,
.service-card p,
.service-card h2,
.service-card h3,
.service-card li,
.service-card .service-details {
  overflow-wrap: anywhere;
}

/* Prevent flex/grid items from expanding beyond their track in service cards */
.service-card > *,
.service-details > * {
  min-width: 0;
}

.horizontal-content {
  display: flex;
}

.resource-icon {
  align-items: flex-start;
  justify-content: flex-start;
}

@media (max-width: 900px) {
  .partners-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .booking-grid {
    grid-template-columns: 1fr;
  }

  .service-card,
  .service-card.expanded,
  .service-card:hover {
    transform: none;
  }

  .service-card,
  .service-card.expanded {
    min-height: auto;
    max-height: none;
  }

  .service-details,
  .service-card.expanded .service-details {
    max-height: none;
    overflow: visible;
  }

  .quote-card.swan-card,
  .quote-card.jokes-card {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .top-bar {
    position: sticky;
    top: 0;
    z-index: 1002;
    padding: 10px 16px;
    background: transparent;
  }

  /* Blur applied via pseudo-element so position:fixed children (hamburger)
     are not re-contained by a backdrop-filter stacking context */
  .top-bar::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(5, 4, 32, 0.96);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }

  .top-bar-content {
    position: relative;
    justify-content: space-between;
    min-height: 52px;
    gap: 14px;
  }

  .logo {
    display: flex;
    align-items: center;
  }

  .hamburger {
    -webkit-appearance: none;
    appearance: none;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    visibility: visible;
    opacity: 1;
    color: #ffffff;
    font-size: 0;
    line-height: 0;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: var(--primary-color);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  }

  .hamburger-lines {
    gap: 5px;
  }

  .hamburger-lines span {
    width: 20px;
    height: 3px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14);
  }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    gap: 8px;
    width: min(calc(100vw - 32px), 320px);
    top: 72px;
    right: 12px;
    padding: 14px;
    background: rgba(11, 24, 61, 0.96);
    backdrop-filter: blur(16px);
    border-radius: 18px;
    border: 1px solid rgba(255, 215, 0, 0.16);
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.35);
    max-height: calc(100vh - 92px);
    overflow-y: auto;
  }

  .nav-links.show {
    display: flex;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 10px 4px;
  }

  .nav-links .language-switcher {
    display: none;
  }

  .language-switcher__option {
    flex: 1 1 0;
    min-height: 40px;
  }

  .nav-links a.active::after {
    bottom: 0;
  }

  .nav-btn {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 4px;
  }

  section {
    padding: 48px 0;
  }

  .hero {
    padding: 96px 20px 72px;
    min-height: auto;
  }

  .hero h1 {
    font-size: clamp(2rem, 7vw, 2.6rem);
  }

  .hero p {
    font-size: 1.05rem;
    margin-bottom: 28px;
  }

  .btn,
  .btn-secondary,
  .cta-button,
  .whatsapp-btn,
  .booking-submit,
  .form-submit {
    max-width: 100%;
    font-size: 1rem;
    text-align: center;
  }

  .services-container {
    gap: 24px;
  }

  .service {
    flex-basis: 100%;
    padding: 0;
  }

  .process {
    width: calc(100% - 32px);
    margin: 40px auto;
    padding: 32px 22px;
  }

  .process h2 {
    margin-top: 0;
    font-size: 1.8rem;
  }

  .process li {
    padding: 20px 16px 20px 52px;
  }

  .process li::before {
    left: 14px;
  }

  .contact {
    width: auto;
    margin: 40px 16px;
    padding: 36px 20px;
  }

  .contact-form,
  .booking-card,
  .service-display,
  .content-card,
  .freecontent-card {
    padding: 24px 20px;
  }

  .page-shell {
    padding: 36px 16px 100px;
  }

  .service-hero,
  .booking-hero,
  .page-hero,
  .faq-hero,
  .career-hero,
  .explore-hero,
  .gallery-hero {
    padding: 64px 20px 40px;
  }

  .service-hero h1,
  .booking-hero h1,
  .page-hero h1,
  .faq-hero h1,
  .career-hero h1 {
    font-size: clamp(1.9rem, 7vw, 2.4rem);
  }

  .page-hero p,
  .booking-hero p,
  .faq-hero p,
  .career-hero p,
  .hero p,
  .subtitle {
    font-size: 1rem;
    max-width: 32ch;
    margin-left: auto;
    margin-right: auto;
    text-wrap: balance;
  }

  .service-details,
  .faq {
    margin: 36px auto 48px;
  }

  .examples-grid,
  .faq-grid,
  .quote-grid,
  .resource-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .about-grid,
  .quote-grid,
  .resource-grid,
  .contact-grid,
  .benefits-grid,
  .job-openings,
  .mission-statement {
    padding-left: 16px;
    padding-right: 16px;
  }

  .about-grid {
    gap: 24px;
    margin: 40px auto;
  }

  .faq-grid {
    gap: 20px;
    margin: 32px auto;
    padding: 0 16px;
  }

  .faq-card,
  .resource-card,
  .mini-service-card,
  .benefit-card,
  .job-card {
    padding: 18px;
  }

  .resource-grid {
    gap: 20px;
    padding-top: 0;
    padding-bottom: 16px;
  }

  .section-title {
    margin: 44px 0 20px;
  }

  .contact-grid {
    gap: 24px !important;
    margin: 32px auto !important;
    padding: 0 16px !important;
  }

  .contact-info-card {
    padding: 24px 20px !important;
  }

  .contact-info-card h2 {
    font-size: 1.7rem !important;
    padding-left: 14px;
  }

  .contact-item {
    gap: 12px;
    align-items: flex-start;
  }

  .contact-grid .contact-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    font-size: 1rem;
  }

  .contact-text a,
  .contact-text p {
    font-size: 1rem !important;
  }

  .quote-grid {
    gap: 20px;
    padding: 24px 16px !important;
  }

  .quote-card,
  .quote-card.swan-card,
  .quote-card.jokes-card {
    max-width: 100%;
    margin: 24px auto;
  }

  .quote-image {
    height: 220px !important;
  }

  .swan-card .quote-image,
  .jokes-card .quote-image {
    height: 240px !important;
  }

  .quote-content {
    padding: 18px !important;
    min-height: 0;
  }

  .category-filter {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
    padding: 16px;
  }

  .filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-width: 0;
    min-height: 48px;
    height: auto;
    padding: 10px 12px !important;
    border-radius: 18px;
    font-size: 0.84rem;
    line-height: 1.3;
    text-align: center;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .services-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    margin: 24px auto 56px !important;
    padding: 0 16px !important;
  }

  .service-card {
    padding: 20px !important;
  }

                .service-card.has-badge,
                .service-card.has-ribbon {
                  padding-top: 72px !important;
                }
        
                .service-card.has-badge.has-ribbon {
                  padding-top: 112px !important;
                }
        
                .service-card.freebie-card.has-badge {
                  padding-top: 20px !important;
                }
  .service-features li {
    font-size: 0.84rem;
  }

  .price-pill {
    white-space: normal;
    text-align: center;
  }

  .merged-badge,
  .advanced-badge {
    position: absolute;
      top: 12px !important;
      right: 12px !important;
      left: auto !important;
      z-index: 3;
    font-size: 0.7rem;
    padding: 4px 10px;
    max-width: calc(100% - 24px);
      line-height: 1.2;
      text-align: center;
  }

  .freebie-horizontal-row {
    margin: 20px auto !important;
    padding: 0 16px !important;
  }

  .service-card.freebie-card .free-badge {
    display: none !important;
  }

  .horizontal-card,
  .service-card.horizontal-card,
  .service-card.freebie-card.horizontal-card {
    display: block !important;
    padding: 20px !important;
    overflow: hidden !important;
  }

  .horizontal-content {
    display: block !important;
  }

  .horizontal-left {
    display: block !important;
    min-width: 0;
    max-width: calc(100vw - 72px);
    text-align: left !important;
  }

  .horizontal-left h3,
  .horizontal-left p {
    text-align: left !important;
    font-size: 1rem !important;
  }

  /* Ensure service card description text fits on mobile */
  .service-card > p,
  .service-card > h3 {
    font-size: 1rem !important;
    overflow-wrap: break-word;
  }

  .horizontal-right {
    width: 100%;
    min-width: 0;
    justify-content: flex-start !important;
  }

  .horizontal-right .price-pill {
    width: 100%;
    margin: 0 !important;
    padding: 14px 20px !important;
  }

        .service-card[data-service="merged-starter-investor"] .price-pill,
        .service-card[data-service="security-check"] .price-pill {
          width: 100%;
          min-width: 0;
          padding: 14px 16px !important;
          font-size: 1.35rem !important;
        }
  .free-badge,
  .sale-ribbon,
  .advanced-badge-ribbon {
    top: 12px !important;
    right: 12px !important;
    bottom: auto !important;
    transform: none !important;
    padding: 6px 12px !important;
    font-size: 0.72rem !important;
    max-width: calc(100% - 24px);
      white-space: normal !important;
      line-height: 1.2;
      text-align: center;
    }
    
    .service-card.has-badge.has-ribbon .sale-ribbon,
    .service-card.has-badge.has-ribbon .advanced-badge-ribbon {
      top: 52px !important;
  }

  .free-badge::before,
  .free-badge::after,
  .advanced-badge-ribbon::before,
  .advanced-badge-ribbon::after {
    display: none;
  }

  .booking-form {
    margin: 24px 16px !important;
    padding: 22px 18px !important;
  }

  .modal-content,
  .popup-content {
    width: min(92vw, 560px) !important;
  }

  .modal-content {
    margin: 8vh auto !important;
    padding: 22px !important;
  }

  .disclaimer-buttons {
    flex-direction: column;
    gap: 12px !important;
  }

  .disclaimer-btn {
    width: 100% !important;
    max-width: none;
  }

  .pdf-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .pdf-content {
    width: 100%;
  }

  .download-badge {
    align-self: flex-start;
  }

  .popup-trigger {
    margin: 12px 0 0;
  }

  .terms-row,
  .form-group.terms {
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
  }

  .terms-row span {
    min-width: 0;
    width: 100%;
    line-height: 1.5;
  }

  .testimonial-controls {
    flex-wrap: wrap;
    gap: 10px;
  }

  .testimonial-image img {
    width: 72px;
    height: 72px;
  }

  .testimonial-header {
    flex-wrap: wrap;
    justify-content: center;
  }

  section.testimonials > h2,
  .mini-services h2,
  .our-partners h2 {
    margin-top: 0;
    font-size: 1.7rem;
  }

  .mini-services,
  .our-partners {
    padding: 56px 16px;
  }

  .mini-services-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .site-footer {
    margin-top: 76px;
    padding-bottom: 88px;
  }

  .footer-topbar {
    grid-template-columns: 1fr;
    padding: 18px 18px;
  }

  .footer-topbar h2 {
    max-width: none;
  }

  .footer-topbar-actions {
    justify-content: flex-start;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-grid > * {
    min-width: 0;
  }

  .footer-brand-copy,
  .legal-disclaimer p {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  .site-footer .social-links {
    justify-content: flex-start;
    gap: 10px;
  }

  .footer-link-list {
    gap: 2px;
  }

  .partners-grid {
    gap: 18px;
  }

  .partner-card {
    padding: 16px;
  }

  .partner-card img {
    width: 96px;
    height: 96px;
  }

  .job-card {
    height: auto;
  }

  .job-type {
    min-width: 0;
    margin-left: 0;
    margin-top: 8px;
  }

  .contact-mail {
    padding: 0 16px;
    text-align: center;
  }

  .back-button-container {
    margin: 16px !important;
    margin-left: 16px !important;
    display: flex;
    justify-content: center;
  }

  .back-button {
    max-width: 100%;
    text-align: center;
  }

  .site-brand img {
    height: 64px;
  }

  .sup {
    right: 12px;
    bottom: 44px;
  }

  .sup a {
    width: 52px;
    height: 52px;
    min-width: 52px;
    padding: 0;
    border-radius: 50%;
  }

  .sup img {
    width: 24px;
    height: 24px;
  }

  .sup-label {
    display: none;
  }

  .mobile-language-switcher {
    display: block;
    position: fixed;
    left: 12px;
    right: auto;
    bottom: 44px;
    z-index: 1001;
  }

  .mobile-language-switcher .language-switcher {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    margin: 0;
    padding: 5px 4px;
    gap: 3px;
    border-radius: 20px;
    background: rgba(11, 24, 61, 0.95);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
  }

  .mobile-language-switcher .language-switcher__option {
    min-width: 40px;
    min-height: 36px;
    padding: 0 6px;
    font-size: 0.74rem;
  }

  .scroll-top {
    right: 12px;
    bottom: 104px;
    margin: 0;
  }

  #scrollToTopBtn {
    width: 52px;
    height: 52px;
    padding: 0;
    font-size: 1.02rem;
  }

  .news-ticker {
    padding: 4px 0;
  }

  .ticker-item {
    margin-right: 24px;
    font-size: 0.82rem;
  }

  .grecaptcha-badge {
    bottom: 84px !important;
    right: 8px !important;
    transform: scale(0.9) !important;
    transform-origin: right bottom !important;
  }
}

@media (max-width: 480px) {
  .top-bar {
    padding-left: 12px;
    padding-right: 12px;
  }

  .top-bar-content {
    min-height: 48px;
  }

  .hamburger {
    width: 40px;
    height: 40px;
  }

  .nav-links {
    width: calc(100vw - 24px);
    top: 64px;
    right: 12px;
  }

  .hero {
    padding: 88px 16px 56px;
  }

  .hero h1 {
    font-size: 1.85rem;
  }

  .hero p,
  .quote-text {
    font-size: 0.98rem;
  }

  .page-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .content-card,
  .contact-form,
  .booking-card,
  .service-display,
  .contact-info-card,
  .freecontent-card {
    padding: 20px 16px;
  }

  .mini-services,
  .our-partners {
    padding: 48px 12px;
  }

  .mini-services h2,
  .our-partners h2 {
    font-size: 1.55rem;
  }

  .partners-grid {
    grid-template-columns: 1fr;
  }

  .partner-card img {
    width: 84px;
    height: 84px;
  }

  .filter-btn {
    min-height: 46px;
    padding: 10px 8px !important;
    font-size: 0.8rem;
  }

  .quote-grid,
  .resource-grid,
  .contact-grid,
  .about-grid,
  .benefits-grid,
  .job-openings,
  .mission-statement {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .quote-image {
    height: 190px !important;
  }

  .swan-card .quote-image,
  .jokes-card .quote-image {
    height: 210px !important;
  }

  .quote-author {
    align-self: stretch;
  }

  .back-button {
    width: 100%;
  }

  .price-pill,
  .horizontal-right .price-pill {
    width: 100%;
  }

  .contact-info-card h2 {
    font-size: 1.5rem !important;
  }

  .site-footer {
    margin-top: 72px;
    padding: 0 16px 104px;
  }

  .sup {
    bottom: 40px;
  }

  .sup a {
    width: 48px;
    height: 48px;
    min-width: 48px;
  }

  .sup img {
    width: 22px;
    height: 22px;
  }

  .mobile-language-switcher {
    left: 10px;
    bottom: 40px;
  }

  .mobile-language-switcher .language-switcher {
    padding: 4px 3px;
    gap: 2px;
    border-radius: 18px;
  }

  .mobile-language-switcher .language-switcher__option {
    min-width: 36px;
    min-height: 32px;
    padding: 0 4px;
    font-size: 0.7rem;
  }

  .scroll-top {
    bottom: 94px;
  }

  #scrollToTopBtn {
    width: 48px;
    height: 48px;
    font-size: 0.96rem;
  }

  .footer-topbar,
  .footer-panel {
    padding: 18px 16px;
    border-radius: 18px;
  }

  .footer-topbar h2 {
    font-size: 1.55rem;
  }

  .footer-topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .footer-button {
    width: 100%;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .footer-brand {
    grid-column: auto;
  }

  .footer-brand-heading {
    align-items: flex-start;
  }

  .footer-logo-shell {
    width: 60px;
    height: 60px;
    border-radius: 18px;
  }

  .site-footer .social-links {
    gap: 8px;
  }

  .contact-method {
    padding: 9px 10px;
  }

                                .site-footer .footer-contact .contact-link--email {
                                  white-space: normal;
                                  overflow-wrap: anywhere;
                                }
  .legal-disclaimer {
    grid-template-columns: 1fr;
    text-align: left;
    padding-top: 14px;
  }

  .site-footer--rtl .legal-disclaimer {
    text-align: right;
  }

  .disclaimer-content {
    padding: 18px;
  }

  .disclaimer-content h3 {
    font-size: 1.25rem;
  }

  .grecaptcha-badge {
    bottom: 74px !important;
    transform: scale(0.82) !important;
  }

  .site-brand img {
    height: 54px;
  }
}
