/* =========================================================
   RESPONSIVE STYLES — HAFNIA INSURANCE SERVICES
   Mobile-first breakpoints: 480, 768, 1024, 1280
   ========================================================= */

/* Desktop only line breaks */
.desktop-only { display: inline; }

/* Global overflow safety */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* ----------------------------------------
   SMALL MOBILE (≤ 480px)
   ---------------------------------------- */
@media (max-width: 480px) {
  .desktop-only { display: none; }

  .container {
    padding: 0 var(--space-4);
  }

  /* Header on small mobile */
  .header__inner { height: 68px; }
  body { padding-top: 68px; }
  .mobile-nav { top: 68px; max-height: calc(100vh - 68px); }

  .header__logo img {
    height: 46px;
    max-height: 48px;
    width: auto;
    max-width: 210px;
  }

  /* Footer logo on small mobile */
  .footer__brand img {
    height: 58px;
    max-width: 240px;
    padding: 6px 14px;
  }

  .btn {
    padding: 0.75rem 1rem;
    font-size: var(--text-xs);
    white-space: normal;
    text-align: center;
    width: 100%;
    justify-content: center;
    max-width: 100%;
  }

  .btn-group {
    flex-direction: column;
    width: 100%;
    gap: var(--space-3);
  }

  .btn-group .btn {
    width: 100%;
  }

  .hero { min-height: 480px; }
  .hero--tall { min-height: 520px; }
  .hero__title {
    font-size: clamp(1.75rem, 7vw, 2.25rem);
    line-height: 1.2;
    margin-bottom: var(--space-4);
  }
  .hero__sub { font-size: var(--text-sm); line-height: 1.6; }

  .page-hero { height: 240px; }
  .page-hero__title { font-size: var(--text-2xl); }
  .page-hero__sub { font-size: var(--text-sm); }

  .stat-box__number { font-size: var(--text-4xl); }
  .check-list--two-col { grid-template-columns: 1fr; }

  .card {
    padding: var(--space-5);
  }

  .card--agent {
    padding: var(--space-6) var(--space-4);
  }

  .card--agent .agent-photo {
    width: 130px !important;
    height: 130px !important;
  }

  .notice {
    width: 100%;
    max-width: 100% !important;
    box-sizing: border-box;
    text-align: left;
    margin-left: 0;
    margin-right: 0;
  }

  /* Client Login page — small mobile */
  .client-login {
    padding: var(--space-8) 0;
  }

  .client-login__transfer,
  .client-login__help {
    padding: var(--space-6) var(--space-4);
  }

  .client-login__transfer {
    margin-bottom: var(--space-6);
  }

  .client-login__icon-circle {
    width: 52px;
    height: 52px;
  }

  .client-login__icon-circle svg {
    width: 24px;
    height: 24px;
  }

  .client-login__heading {
    font-size: var(--text-xl);
  }

  .client-login__desc {
    font-size: var(--text-sm);
  }

  .client-login__btn {
    width: 100%;
    min-width: unset;
  }

  .client-login__not-client {
    margin-left: calc(-1 * var(--space-2));
    margin-right: calc(-1 * var(--space-2));
    padding: var(--space-4);
  }

  .disclosure-block__title {
    font-size: var(--text-lg);
  }

  /* Modal — small mobile */
  .modal-dialog {
    width: 95%;
    padding: var(--space-5);
  }

  .modal-dialog__actions {
    flex-direction: column;
  }

  .modal-dialog__cancel,
  .modal-dialog__proceed {
    width: 100%;
    min-width: unset;
    justify-content: center;
    text-align: center;
  }
}

/* ----------------------------------------
   TABLET / MEDIUM (≤ 768px)
   ---------------------------------------- */
@media (max-width: 768px) {
  .desktop-only { display: none; }

  /* Header */
  .primary-nav { display: none; }
  .menu-toggle { display: flex; }

  .header__inner { height: 72px; }
  body { padding-top: 72px; }
  .mobile-nav { top: 72px; max-height: calc(100vh - 72px); }

  .header__logo img {
    height: 50px;
    max-height: 52px;
    width: auto;
    max-width: 230px;
  }

  /* Hero */
  .hero { min-height: 500px; }
  .hero__content { padding: var(--space-12) 0; }
  .hero__sub { max-width: 100%; }

  /* Trust bar */
  .trust-bar__inner {
    flex-direction: column;
    gap: 0;
  }
  .trust-bar__item {
    justify-content: flex-start;
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
    padding: var(--space-4) var(--space-6);
  }
  .trust-bar__item:last-child { border-bottom: none; }

  /* Grids */
  .grid-2, .grid-3, .grid-4,
  .process-steps, .stat-grid,
  .state-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .grid-2--featured {
    gap: var(--space-6) !important;
  }

  .process-steps::before { display: none; }

  /* Agent section */
  .agent-section {
    grid-template-columns: 1fr;
  }
  .agent-sidebar {
    position: static;
    max-width: 380px;
    margin: 0 auto;
  }

  /* Cards */
  .card {
    padding: var(--space-6);
  }

  .card--agent {
    padding: var(--space-8) var(--space-6);
  }

  .btn {
    white-space: normal;
    word-wrap: break-word;
    max-width: 100%;
  }

  .btn-group {
    justify-content: center;
  }

  /* Footer */
  .footer__top {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer__brand img {
    height: 64px;
    max-width: 260px;
    padding: 8px 16px;
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--space-3);
    text-align: center;
  }

  /* Section padding */
  .section { padding: var(--space-10) 0; }
  .section--lg { padding: var(--space-16) 0; }
  .section--sm { padding: var(--space-6) 0; }

  .cta-banner { padding: var(--space-12) 0; }

  /* Photo divider & SVG visuals */
  .photo-divider { height: 200px; }
  .svg-visual { margin: var(--space-4) auto; }

  /* Check list */
  .check-list--two-col { grid-template-columns: 1fr; }

  /* Client Login page — tablet */
  .client-login {
    padding: var(--space-10) 0;
  }

  .client-login__card {
    max-width: 100%;
  }

  .client-login__transfer,
  .client-login__help {
    padding: var(--space-8) var(--space-6);
  }

  .client-login__btn {
    width: 100%;
    min-width: unset;
  }

  .client-login__not-client {
    margin-left: calc(-1 * var(--space-2));
    margin-right: calc(-1 * var(--space-2));
  }

  .disclosure-block {
    max-width: 100%;
  }

  /* Modal — tablet */
  .modal-dialog {
    width: 92%;
    padding: var(--space-6);
  }

  .modal-dialog__actions {
    flex-direction: column-reverse;
  }

  .modal-dialog__cancel,
  .modal-dialog__proceed {
    width: 100%;
    min-width: unset;
    justify-content: center;
    text-align: center;
  }
}

/* ----------------------------------------
   LARGE TABLET (769px - 1024px)
   ---------------------------------------- */
@media (max-width: 1024px) {

  .grid-3 { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
  .grid-4 { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
  .process-steps { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
  .process-steps::before { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; }

  .trust-bar__item {
    padding: var(--space-3) var(--space-4);
  }

  .agent-section {
    grid-template-columns: 260px 1fr;
    gap: var(--space-10);
  }

  .agent-section--reverse,
  #jonathan-garcia .agent-section {
    grid-template-columns: 1fr 260px;
  }

  .footer__top { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
  .footer__brand { grid-column: 1 / -1; }
  .footer__brand img {
    height: 66px;
    max-width: 270px;
    padding: 8px 16px;
  }

  /* Header compact for large tablet */
  .header__inner { height: 76px; }
  body { padding-top: 76px; }
  .mobile-nav { top: 76px; max-height: calc(100vh - 76px); }
  .header__logo img {
    height: 52px;
    max-height: 54px;
    width: auto;
    max-width: 240px;
  }

  /* Header nav compact */
  .primary-nav ul { gap: 0; }
  .primary-nav ul li > a { padding: var(--space-2) var(--space-3); font-size: var(--text-xs); }
}

/* ----------------------------------------
   DESKTOP (≥ 1025px)
   ---------------------------------------- */
@media (min-width: 1025px) {
  .grid-2--featured {
    gap: 4rem;
  }
}

/* ----------------------------------------
   LARGE DESKTOP (≥ 1280px)
   ---------------------------------------- */
@media (min-width: 1280px) {
  .container { padding: 0 var(--space-8); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .process-steps { grid-template-columns: repeat(4, 1fr); }
}

/* ----------------------------------------
   TINY MOBILE (≤ 360px)
   ---------------------------------------- */
@media (max-width: 360px) {
  .header__inner { height: 64px; }
  body { padding-top: 64px; }
  .mobile-nav { top: 64px; }
  .header__logo img {
    height: 42px;
    max-height: 44px;
    max-width: 180px;
  }
  .footer__brand img {
    height: 52px;
    max-width: 210px;
    padding: 5px 12px;
  }

  /* Client Login page — tiny mobile */
  .client-login__transfer,
  .client-login__help {
    padding: var(--space-5) var(--space-3);
  }

  .client-login__heading {
    font-size: var(--text-lg);
  }

  .client-login__help-icon-circle {
    width: 44px;
    height: 44px;
  }

  .client-login__contact-link {
    font-size: var(--text-sm);
  }

  .modal-dialog {
    width: 96%;
    padding: var(--space-4);
  }

  .modal-dialog__title {
    font-size: var(--text-lg);
  }
}

/* ----------------------------------------
   PRINT
   ---------------------------------------- */
@media print {
  #site-header, #cookie-banner, .mobile-nav, .btn-group { display: none !important; }
  body { padding-top: 0 !important; }
}
