/* ===================================================
   RESPONSIVE.CSS — Morning Sunday Teer
   Premium Mobile-First Responsive Design System
   ===================================================
   Breakpoints:
     Desktop:          1400px+
     Laptop:           1200px–1399px
     Tablet Landscape: 1024px–1199px
     Tablet Portrait:  768px–1023px
     Large Mobile:     481px–767px
     Small Mobile:     ≤480px  (360px floor)
   =================================================== */


/* ─── 1. ROOT VARIABLES ─── */
:root {
  --h1: clamp(32px, 4vw + 12px, 56px);
  --h2: clamp(26px, 3vw + 10px, 42px);
  --h3: clamp(20px, 2vw + 8px, 28px);
  --body: clamp(16px, 0.9vw + 10px, 18px);
  --btn: clamp(16px, 0.9vw + 10px, 18px);
  --section-py: 80px;
  --section-px: 32px;
  --card-pad: 30px;
}


/* ─── 2. BASE RESETS ─── */
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video, svg, canvas {
  max-width: 100%;
  height: auto;
}


/* ─── 3. FULL-SCREEN SLIDE-DOWN MOBILE MENU ─── */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: linear-gradient(180deg, #1E232A 0%, #252A32 50%, #15181C 100%);
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition:
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease,
    visibility 0s linear 0.5s;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  transition:
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease,
    visibility 0s linear 0s;
}

/* Menu — close button */
.mobile-menu .menu-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  z-index: 10;
}
.mobile-menu .menu-close-btn:hover,
.mobile-menu .menu-close-btn:active {
  background: rgba(255,90,54,0.25);
  transform: scale(1.08);
}

/* Menu — header */
.mobile-menu .menu-header {
  padding: 28px 28px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mobile-menu .menu-logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,90,54,0.12);
  border: 2px solid rgba(255,90,54,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FF5A36;
  font-size: 20px;
  flex-shrink: 0;
}
.mobile-menu .menu-brand {
  font-size: clamp(17px, 1.2vw + 10px, 20px);
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
}
.mobile-menu .menu-brand span {
  color: #FF5A36;
}

/* Menu — nav links */
.mobile-menu .menu-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  gap: 6px;
}

.mobile-menu .menu-link {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border-radius: 16px;
  color: rgba(255,255,255,0.65);
  font-size: clamp(16px, 1vw + 10px, 18px);
  font-weight: 600;
  text-decoration: none;
  min-height: 60px;
  transform: translateX(-30px);
  opacity: 0;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.mobile-menu.open .menu-link {
  transform: translateX(0);
  opacity: 1;
}
.mobile-menu.open .menu-link:nth-child(1) { transition-delay: 0.08s; }
.mobile-menu.open .menu-link:nth-child(2) { transition-delay: 0.14s; }
.mobile-menu.open .menu-link:nth-child(3) { transition-delay: 0.20s; }
.mobile-menu.open .menu-link:nth-child(4) { transition-delay: 0.26s; }
.mobile-menu.open .menu-link:nth-child(5) { transition-delay: 0.32s; }

/* Reset delays when closing */
.mobile-menu:not(.open) .menu-link {
  transition-delay: 0s !important;
}

.mobile-menu .menu-link i {
  width: 26px;
  text-align: center;
  font-size: 19px;
  flex-shrink: 0;
}

.mobile-menu .menu-link:hover,
.mobile-menu .menu-link:active {
  background: rgba(255,255,255,0.07);
  color: #fff;
}

.mobile-menu .menu-link.active {
  background: rgba(255,90,54,0.14);
  color: #FF5A36;
}
.mobile-menu .menu-link.active i {
  color: #FF5A36;
}

/* Menu — footer */
.mobile-menu .menu-footer {
  padding: 20px 28px 32px;
  border-top: 1px solid rgba(255,255,255,0.06);
  text-align: center;
}
.mobile-menu .menu-footer p {
  font-size: clamp(13px, 0.7vw + 7px, 15px);
  color: rgba(255,255,255,0.25);
  margin: 0;
}


/* ─── 4. TOUCH OPTIMISATION ─── */
@media (pointer: coarse) {
  a, button, [role="button"],
  .accordion-trigger,
  .menu-link,
  select, input[type="text"], input[type="search"] {
    min-height: 48px;
  }
  a, button { touch-action: manipulation; }
}


/* ─── 5. RESULT CARD RESPONSIVE ─── */
.result-section {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}


/* ─── 6. FEATURE GRID — ALWAYS 3 COLUMNS ─── */
.feature-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
}

/* Feature card content scaling */
.feature-grid > a,
.feature-grid > div {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}


/* ─── 7. TABLE SCROLL WRAPPER ─── */
.table-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}
.table-scroll-wrap::-webkit-scrollbar {
  height: 6px;
}
.table-scroll-wrap::-webkit-scrollbar-track {
  background: transparent;
}
.table-scroll-wrap::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}
.table-scroll-wrap table {
  min-width: 420px;
}


/* ─── 8. BUTTON BASE ─── */
.btn-coral,
.btn-primary,
a.btn-coral {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}


/* =================================================================
   BREAKPOINT OVERRIDES
   ================================================================= */


/* ─── LAPTOP ≤1200px ─── */
@media (max-width: 1200px) {
  :root {
    --section-py: 70px;
    --card-pad: 28px;
  }
}


/* ─── TABLET LANDSCAPE ≤1024px ─── */
@media (max-width: 1024px) {
  :root {
    --section-py: 60px;
    --card-pad: 24px;
  }

  /* Editorial: stack vertically */
  .editorial-grid {
    grid-template-columns: 1fr !important;
    gap: 48px !important;
  }
}


/* ─── TABLET PORTRAIT ≤768px ─── */
@media (max-width: 768px) {
  :root {
    --section-py: 50px;
    --section-px: 20px;
    --card-pad: 22px;
  }

  /* Result card */
  .result-section {
    max-width: 460px;
  }

  /* Feature grid gap */
  .feature-grid {
    gap: 14px !important;
  }
  .feature-grid > a,
  .feature-grid > div {
    padding: 20px 14px !important;
    border-radius: 16px;
  }
  .feature-grid .card-icon {
    width: 52px !important;
    height: 52px !important;
    border-radius: 14px !important;
    font-size: 18px !important;
    margin-bottom: 12px !important;
  }
  .feature-grid h3 {
    font-size: clamp(14px, 1.5vw + 4px, 16px) !important;
    line-height: 1.3 !important;
    margin-bottom: 4px !important;
  }
  .feature-grid p {
    font-size: clamp(13px, 1.2vw + 3px, 14px) !important;
    line-height: 1.4 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Trust banner stack */
  .trust-banner-inner {
    flex-direction: column !important;
    text-align: center;
    gap: 8px !important;
    padding: 10px 0 !important;
  }

  /* Testimonial arrows */
  .testimonial-prev,
  .testimonial-next {
    display: none !important;
  }

  /* FAQ touch area */
  .accordion-trigger {
    padding: 18px 20px !important;
  }
}


/* ─── LARGE MOBILE ≤480px ─── */
@media (max-width: 480px) {
  :root {
    --section-py: 40px;
    --card-pad: 18px;
  }

  /* Result card full width */
  .result-section {
    max-width: 95%;
  }

  /* Feature grid compact */
  .feature-grid {
    gap: 10px !important;
  }
  .feature-grid > a,
  .feature-grid > div {
    padding: 16px 10px !important;
    border-radius: 14px;
  }
  .feature-grid .card-icon {
    width: 48px !important;
    height: 48px !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    margin-bottom: 10px !important;
  }
  .feature-grid h3 {
    font-size: clamp(13px, 1.2vw + 4px, 15px) !important;
    line-height: 1.25 !important;
  }
  .feature-grid p {
    font-size: clamp(12px, 1vw + 4px, 13px) !important;
    -webkit-line-clamp: 2;
  }

  /* Remove hover effects on mobile */
  .feature-grid > a:hover,
  .feature-grid > div:hover {
    transform: none !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
  }

  /* Hero section */
  .hero-bg {
    padding-top: 72px !important;
    padding-bottom: 56px !important;
  }
  .hero-bg .target-icon-wrap {
    width: 56px !important;
    height: 56px !important;
  }
  .hero-bg .target-icon-wrap i {
    font-size: 22px !important;
  }

  /* Page header (sub-pages) */
  .page-header {
    padding-top: 80px !important;
    padding-bottom: 40px !important;
  }

  /* Result card numbers */
  .result-circle {
    width: 100px !important;
    height: 100px !important;
  }
  .result-circle span {
    font-size: clamp(30px, 5vw + 10px, 38px) !important;
  }
  .result-vs {
    width: 32px !important;
    height: 32px !important;
  }
  .result-vs span {
    font-size: clamp(12px, 1vw + 4px, 14px) !important;
  }

  /* CTA button full width */
  .result-cta {
    width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* Editorial section */
  .editorial-grid {
    grid-template-columns: 1fr !important;
    gap: 36px !important;
  }

  /* Testimonial responsive */
  .testimonial-slide blockquote {
    font-size: clamp(15px, 1.2vw + 6px, 17px) !important;
    line-height: 1.6 !important;
  }

  /* Footer spacing */
  footer .footer-inner {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
  }

  /* Table text */
  .table-scroll-wrap table {
    font-size: clamp(14px, 1vw + 6px, 16px);
  }
  .table-scroll-wrap th,
  .table-scroll-wrap td {
    padding: 12px 14px !important;
  }
}


/* ─── SMALL MOBILE ≤360px ─── */
@media (max-width: 360px) {
  :root {
    --section-py: 32px;
    --card-pad: 14px;
  }

  /* Feature grid even more compact */
  .feature-grid {
    gap: 8px !important;
  }
  .feature-grid > a,
  .feature-grid > div {
    padding: 12px 8px !important;
    border-radius: 12px;
  }
  .feature-grid .card-icon {
    width: 42px !important;
    height: 42px !important;
    font-size: 14px !important;
    margin-bottom: 8px !important;
  }
  .feature-grid h3 {
    font-size: clamp(12px, 1vw + 4px, 14px) !important;
  }
  .feature-grid p {
    display: none !important;
  }

  /* Result card circles */
  .result-circle {
    width: 88px !important;
    height: 88px !important;
    border-width: 3px !important;
  }
  .result-circle span {
    font-size: clamp(26px, 4vw + 8px, 32px) !important;
  }

  /* Accordion */
  .accordion-trigger {
    padding: 14px 16px !important;
    font-size: clamp(14px, 1vw + 6px, 16px) !important;
  }
  .accordion-content {
    font-size: clamp(14px, 1vw + 6px, 16px) !important;
  }

  /* Mobile menu link size */
  .mobile-menu .menu-link {
    padding: 14px 18px;
    font-size: clamp(15px, 1vw + 8px, 17px);
    min-height: 52px;
  }
}


/* ─── 9. TYPOGRAPHY RESPONSIVE ─── */
/* These use CSS variables so they update at each breakpoint above */
.resp-h1 { font-size: var(--h1) !important; }
.resp-h2 { font-size: var(--h2) !important; }
.resp-h3 { font-size: var(--h3) !important; }
.resp-body { font-size: var(--body) !important; }
.resp-btn { font-size: var(--btn) !important; }

/* Section padding utility */
.resp-section {
  padding-top: var(--section-py) !important;
  padding-bottom: var(--section-py) !important;
}
.resp-card-pad {
  padding: var(--card-pad) !important;
}


/* ─── 10. ANIMATION REDUCTION ─── */
@media (max-width: 768px) {
  /* Reduce heavy animations on mobile */
  .trust-pulse {
    animation: none !important;
  }

  /* Keep only essential animations */
  .accordion-content {
    transition: max-height 0.25s ease, opacity 0.25s ease !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  /* Keep mobile menu animation even with reduced motion (essential) */
  .mobile-menu,
  .mobile-menu.open {
    transition-duration: 0.2s !important;
  }
}


/* ─── 11. SAFE AREA / NOTCH ─── */
@supports (padding: max(0px)) {
  .mobile-menu {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(32px, env(safe-area-inset-bottom));
  }
  header {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
}


/* ─── 12. PRINT ─── */
@media print {
  .mobile-menu,
  header button,
  .trust-pulse,
  .testimonial-prev,
  .testimonial-next {
    display: none !important;
  }
  body { background: #fff; }
}
