/* ==========================================================================
   FDN Hosting — responsive layer (loaded AFTER style.css so it can override).
   Holds the responsive fixes added 2026-06-29. The site's ORIGINAL @media rules
   live interleaved in style.css (kept there to preserve their cascade order).
   ========================================================================== */

/* --- Card grids: one column on phones so a minmax() track minimum (240–300px)
       can't overflow a narrow viewport. --------------------------------------- */
@media (max-width: 600px) {
  .services-grid,
  .server-tier-grid,
  .features-grid { grid-template-columns: 1fr; }
  /* .pricing-grid is a centered flexbox (see style.css) — one full-width card per row. */
  .pricing-card { flex-basis: 100%; }
}

/* --- Dashboard stat tiles: 2-up on tablets (style.css already does 1-up ≤880,
       which now applies below 601px). ----------------------------------------- */
@media (min-width: 601px) and (max-width: 880px) {
  .portal-stats { grid-template-columns: repeat(2, 1fr); }
}

/* --- Wide data tables (invoices / services / dashboard): scroll horizontally
       on small screens instead of being clipped by body{overflow-x:hidden}. --- */
@media (max-width: 768px) {
  .portal-table,
  .account-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
}

/* --- Header account dropdown: on phones/tablets pin it to the viewport's
       top-right (fixed) so it can never overflow off-screen regardless of where
       the trigger sits in the bar. -------------------------------------------- */
@media (max-width: 768px) {
  .account-dropdown {
    position: fixed;
    top: 66px;            /* just under the sticky header */
    right: 12px;
    left: auto;
    min-width: 0;
    width: min(92vw, 300px);
    max-height: calc(100vh - 84px);
    overflow-y: auto;
  }
}

/* --- Mobile header: instead of cramming/hiding the language switch + CTA in the
       top bar (which overflowed narrow phones and clipped the cart/burger), put
       them INSIDE the slide-down burger menu, below the nav links. The top-bar
       copies are hidden ≤1280; cart + burger always stay in the bar. ---------- */
.nav-menu-extra { display: none; }

@media (max-width: 1280px) {
  /* surfaced inside .main-nav (the slide-down menu) */
  .nav-menu-extra {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    padding-top: 1rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--fdn-grey-200, #E5E7EB);
  }
  /* scoped under .main-nav so these beat the `.main-nav a` divider/colour rules */
  .main-nav .nav-menu-extra a { border-bottom: 0; }
  .nav-menu-extra .lang-switcher { align-self: flex-start; }
  .main-nav .nav-menu-extra .lang-switcher a { padding: 0.375rem 0.75rem; border-bottom: 0; }
  .main-nav .nav-menu-extra a.active::after { display: none; content: none; }
  .main-nav .nav-menu-extra .btn { width: 100%; text-align: center; padding: 0.85rem 1.5rem; }
  .main-nav .nav-menu-extra .btn-primary { color: #fff; }

  /* hide the duplicates that live in the top action bar */
  .nav-actions .lang-switcher,
  .nav-actions > .btn { display: none; }
  .nav-actions { gap: 0.6rem; }
}

/* Keep the logged-in account trigger compact on phones (icon stays clickable). */
@media (max-width: 600px) {
  .account-menu .account-trigger span { display: none; }
}

/* Brand tagline is decorative — show only the «FDN» logo until the header is wide
   enough for everything, so the centered horizontal nav has room (it was clipping
   in the ~1281–1440 range where the tagline reappeared). */
@media (max-width: 1500px) {
  .brand-divider,
  .brand-tagline { display: none; }
}

/* --- Pricing tier-tabs: on phones/tablets keep them on ONE row that scrolls
       horizontally (swipe), instead of wrapping inside the rounded pill. ------ */
@media (max-width: 768px) {
  .tier-tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;   /* must not be `center` when it can overflow */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;               /* fit-content when it fits; scroll when it doesn't */
    scrollbar-width: none;         /* hide scrollbar (Firefox) */
  }
  .tier-tabs::-webkit-scrollbar { display: none; }   /* hide scrollbar (WebKit) */
  .tier-tab { flex: 0 0 auto; }    /* keep natural width so the row can scroll */
  .tier-tabs { cursor: grab; }     /* hint that you can drag it (mouse/pen) */
}
.tier-tabs.dragging { cursor: grabbing; user-select: none; }
.tier-tabs.dragging .tier-tab { pointer-events: none; }   /* no accidental hover/click mid-drag */
