/* =====================================================================
   responsive.css  -  makes every MmEx page fit every screen.
   Load it LAST on a page:  <link rel="stylesheet" href="responsive.css">
   (dashboard pages load ../frontend-public-page/responsive.css)

   Breakpoints (your three) + two extras:
     768px - 1024px   tablets / small laptops
     480px -  768px   big phones, small tablets
     up to    480px   phones
     up to    360px   very small phones
     landscape phones (short screens)
   Ideas used: fluid sizes with clamp(), 44px+ touch targets, 16px input text
   (stops iPhones zooming in), grids that wrap, no sideways page scroll.
   ===================================================================== */

/* ---------- 1. safe base for all sizes ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { max-width: 100%; overflow-x: clip; }             /* never scroll sideways */
img, video, svg, canvas, iframe { max-width: 100%; }
img, video { height: auto; }
p, h1, h2, h3, h4, li, td, th, a, label { overflow-wrap: anywhere; }

/* Inputs: comfortable to tap and type in, on every device */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
select, textarea { min-height: 48px; font-size: 16px; max-width: 100%; }
textarea { min-height: 96px; }
button, .btn, [role="button"], input[type="submit"] { min-height: 44px; touch-action: manipulation; }

/* ---------- 2. hero + tracking box (public Home page) ---------- */
.hero-section {
  padding: clamp(24px, 6vw, 80px);
  min-height: clamp(420px, 70vh, 650px);
  min-height: clamp(420px, 70dvh, 650px);
}
.hero-container { width: 100%; }
.hero-container h1 { font-size: clamp(26px, 5vw, 44px); line-height: 1.15; margin-bottom: clamp(16px, 3vw, 30px); }
.MmEx-tabs, .MmEx-form-area { width: 100%; max-width: 750px; }
.MmEx-form-area { background: rgba(0, 0, 0, .45); backdrop-filter: blur(2px); }
.MmEx-tab { font-size: clamp(12px, 1.6vw, 15px); min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#tracking-input, .hero-float #tracking-input { min-height: 56px; font-size: 16px; }
.hero-float { flex: 1 1 260px; }
#track .red-btn, .orange-btn { min-height: 56px; font-size: 16px; padding-inline: 28px; border-radius: 10px; }

/* ---------- 3. tablets: 768px - 1024px ---------- */
@media all and (min-width: 768px) and (max-width: 1024px) {
  .header-container, .hero-container, .why-ship-container, .shipping-container, .cargo-shipping-container { padding-inline: 24px; }
  [class*="grid"], [class*="cards"], [class*="features"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .MmEx-tabs, .MmEx-form-area { max-width: 680px; }
}

/* ---------- 4. big phones: 480px - 768px ---------- */
@media all and (min-width: 480px) and (max-width: 768px) {
  .hero-section { align-items: flex-start; padding-top: 40px; }
  .MmEx-tabs, .MmEx-form-area { max-width: 100%; }
  #track.active { flex-direction: column; }
  #track.active .hero-float, #track.active .red-btn { width: 100%; flex: 1 1 100%; }
  [class*="grid"], [class*="cards"], [class*="features"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  footer [class*="column"], footer [class*="col"] { flex: 1 1 45%; }
}

/* ---------- 5. phones: up to 480px ---------- */
@media all and (max-width: 480px) {
  body { font-size: 16px; }
  .hero-section { padding: 28px 16px 36px; align-items: flex-start; min-height: auto; }
  .hero-container h1 { font-size: 28px; }
  .MmEx-tab { padding: 10px 6px; font-size: 12px; }
  .MmEx-tab i { font-size: 20px; margin-bottom: 6px; }
  .MmEx-form-area { padding: 14px; }
  #track.active { flex-direction: column; }
  #track.active .hero-float, #track.active .red-btn { width: 100%; flex: 1 1 100%; }
  #tracking-input, .hero-float #tracking-input { min-height: 60px; }
  .hero-float label { font-size: 16px; }
  [class*="grid"], [class*="cards"], [class*="features"], [class*="columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  [class*="container"] { padding-inline: 16px; }
  .btn, button { width: auto; }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  footer [class*="column"], footer [class*="col"] { flex: 1 1 100%; }
}

/* ---------- 6. very small phones: up to 360px ---------- */
@media all and (max-width: 360px) {
  .hero-container h1 { font-size: 24px; }
  .MmEx-tab { font-size: 11px; }
  [class*="container"] { padding-inline: 12px; }
}

/* ---------- 7. phones turned sideways (short screens) ---------- */
@media all and (max-height: 480px) and (orientation: landscape) {
  .hero-section { min-height: auto; padding-block: 20px; }
}

/* ---------- 8. big screens: stop lines getting too wide ---------- */
@media all and (min-width: 1600px) {
  .hero-container, .why-ship-container, .shipping-container, .cargo-shipping-container, .header-container { max-width: 1500px; margin-inline: auto; }
}

/* ---------- 8b. the Home page sections (stack on small screens) ---------- */
/* the header is fixed and 70px tall, so the hero must start below it */
.hero-section { padding-top: calc(70px + clamp(20px, 4vw, 60px)); }
.why-ship-section, .shipping-section, .cargo-shipping-section { padding-block: clamp(32px, 6vw, 60px); }
.why-ship-section h2 { font-size: clamp(24px, 4vw, 32px); }
@media all and (max-width: 1024px) {
  .why-ship-container, .shipping-container, .cargo-shipping-container { flex-direction: column; gap: 24px; align-items: stretch; padding-inline: 24px; }
  .why-ship-text, .why-ship-image, .shipping-image, .shipping-item, .cargo-shipping-image, .cargo-shipping-item { flex: 1 1 auto; width: 100%; }
  .why-ship-image img, .shipping-image img, .cargo-shipping-image img { height: auto; max-height: 420px; border-radius: 12px; }
}
@media all and (max-width: 480px) {
  .why-ship-container, .shipping-container, .cargo-shipping-container { padding-inline: 16px; }
  .why-ship-content { grid-template-columns: minmax(0, 1fr); }
  .header-container { padding-inline: 14px; }
}

/* ---------- 8c. About / Contact style two-column grids ---------- */
.ab-story, .ct-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ct-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
@media all and (max-width: 768px) {
  .ab-story, .ct-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 28px; }
  .ab-story-img::after { display: none; }
  .ct-card { padding: 14px; }
}

/* ---------- 9. users who prefer less motion ---------- */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- 10. the HTML "hidden" attribute must always win (e.g. footer social icons with no link yet) ---------- */
[hidden] { display: none !important; }

/* ===== Phone polish (EDIT ME: sizes) ===== */
@media (max-width: 600px) {
  /* Cookie banner: compact, buttons share one row */
  .ck-banner { padding: 10px 12px; font-size: 13px; gap: 8px; flex-direction: column; align-items: stretch; }
  .ck-banner p { margin: 0; line-height: 1.35; }
  .ck-banner-actions { flex-wrap: nowrap; width: 100%; gap: 6px; }
  .ck-banner-actions .pr-btn { flex: 1; padding: 10px 6px; font-size: 12px; min-height: 40px; white-space: nowrap; }
  .ck-manage { padding: 10px 6px; }
  /* Footer and legal links: finger-sized tap area */
  footer a, .footer a { display: inline-block; padding: 8px 0; min-height: 40px; }
}

/* =====================================================================
   PHONE HEADER  (EDIT ME: change 768px to move the breakpoint)
   On phones the header shows only four round icons: language/location, account, search, menu.
   The words "SignUp/Login" are hidden; tapping the account icon still opens the same login / sign-up list.
   ===================================================================== */
@media (max-width: 768px) {
  .header-actions { gap: 10px; }                         /* space between the round icons */
  .header-actions .action-btn {
    font-size: 0;                                        /* hides the words "SignUp/Login" (the icon below brings its own size back) */
    width: 40px; height: 40px;                           /* same size as the search and menu circles */
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.15); border-radius: 50%;
  }
  .header-actions .action-btn i { font-size: 20px; }     /* the account icon: bigger than before (EDIT ME) */
  #actionDropdown { right: 0; }                          /* the login list opens under the icons */
}

/* IPHONE ZOOM FIX for every form on the site: Safari zooms in when a box has text smaller than 16px (EDIT ME: keep 16px). */
@media (max-width: 768px) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: 16px; }
}

/* =====================================================================
   FOOTER SOCIAL ICONS ON PHONES  (EDIT ME: sizes)
   "Follow Us" sits on its own line, and the icons stay in ONE neat horizontal row that shrinks to fit the screen
   (instead of 4 + 2 on two lines). If you ever add many more icons they wrap to a second row rather than overflow.
   ===================================================================== */
@media (max-width: 768px) {
  .footer-social { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 6px; width: 100%; }
  .footer-social h5 { flex: 0 0 100%; margin: 0 0 2px; text-align: center; }
  .footer-social a { margin: 0; flex: 0 0 auto;
    width: clamp(30px, 10.5vw, 44px); height: clamp(30px, 10.5vw, 44px);   /* shrinks on small phones so six icons fit one row */
    font-size: clamp(14px, 4.4vw, 19px); }
  .footer-social a:not([hidden]) { display: inline-flex; }
}
.footer-social a[hidden] { display: none !important; }   /* an icon with no link yet stays hidden */
