/*
 * mobile.css — Responsive / mobile-first overrides for eucertify.eu public pages
 * Breakpoints: 768px (mobile), 1024px (tablet)
 * Injected via <link> on all public pages that include main.css
 */

/* ═══════════════════════════════════════════════════════════════
   HAMBURGER BUTTON
═══════════════════════════════════════════════════════════════ */
.hamburger {
  display: none; /* hidden on desktop */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 6px;
  margin-left: auto; /* push to right of logo */
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  cursor: pointer;
  z-index: 1100;
  flex-shrink: 0;
  transition: background 0.2s;
}

.hamburger:hover {
  background: rgba(255,255,255,0.16);
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #e2e8f0;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease, width 0.25s ease;
  transform-origin: center;
}

/* Animate to X when open */
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; width: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ═══════════════════════════════════════════════════════════════
   TABLET (≤ 1024px) — tighten nav, no major layout changes
═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  nav li {
    padding: 0.55rem 1rem;
    font-size: 0.92rem;
  }

  .nav-list {
    gap: 0.2rem 0.4rem;
  }

  .language-name {
    display: none; /* show only flag on tablet to save space */
  }

  .language-dropdown {
    min-width: auto;
    padding: 0 0.6em;
  }
}


/* ═══════════════════════════════════════════════════════════════
   MOBILE (≤ 768px) — hamburger menu, stacked layout
═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Header ── */
  .header-container {
    padding: 0.5rem 1rem;
    gap: 0.5rem;
  }

  .logo-link img {
    height: 38px;
  }

  /* Show hamburger, hide language name */
  .hamburger {
    display: flex;
    order: 2; /* logo | hamburger | lang */
  }

  .header-controls {
    order: 3;
  }

  .language-name {
    display: none;
  }

  .language-dropdown {
    min-width: auto;
    padding: 0 0.5em;
    height: 34px;
  }

  .language-arrow {
    display: none;
  }

  /* ── Mobile nav overlay ── */
  #mainMenu {
    display: none;
    position: fixed;
    top: 60px; /* below header */
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 15, 30, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 999;
    padding: 1rem 1rem 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    /* slide in from top */
    transform: translateY(-8px);
    opacity: 0;
    transition: opacity 0.22s ease, transform 0.22s ease;
  }

  #mainMenu.open {
    display: block;
    transform: translateY(0);
    opacity: 1;
  }

  /* Prevent body scroll when menu is open */
  body.mobile-menu-open {
    overflow: hidden;
  }

  /* ── Nav list: vertical stack ── */
  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
    justify-content: flex-start;
    flex-wrap: nowrap;
  }

  nav li {
    width: 100%;
    padding: 0.85rem 1.2rem;
    font-size: 1rem;
    border-radius: 12px;
    white-space: normal;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    text-align: left;
  }

  nav li:hover,
  nav li:active {
    background: rgba(59, 130, 246, 0.25);
  }

  /* ── Dropdown items on mobile: click to expand ── */
  .nav-dd {
    display: block;
  }

  /* Remove hover-based open (use JS .open class instead) */
  .nav-dd:hover .nav-submenu,
  .nav-dd:focus-within .nav-submenu {
    display: none;
  }

  .nav-dd.open .nav-submenu {
    display: flex !important;
  }

  /* Caret: rotate when open */
  .nav-dd.open .nav-dd-label::after {
    transform: translateY(-50%) rotate(180deg);
  }

  /* Submenu: inline, not absolute */
  .nav-submenu {
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    width: 100%;
    max-width: none;
    margin-top: 0.4rem;
    padding: 0.4rem 0 0.4rem 1rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    box-shadow: none;
    backdrop-filter: none;
  }

  .nav-submenu li {
    padding: 0.7rem 0.8rem;
    font-size: 0.95rem;
    border-radius: 8px;
    background: transparent;
    border: none;
    white-space: normal;
  }

  /* ── Close overlay when clicking scroll area ── */
  #scrollArea.menu-dimmed::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 998;
    background: transparent;
  }

  /* ── Hero section ── */
  .hero-section {
    background-attachment: scroll; /* fixed bg is slow on mobile */
    min-height: calc(100vh - 60px);
  }

  .hero-title {
    white-space: normal;
    word-break: break-word;
    padding: 0.3em 0.8em;
    font-size: clamp(1.4rem, 8vw, 2.2rem);
    line-height: 1.2;
    border-radius: 1em;
    max-width: 96vw;
  }

  .hero-subtitle {
    padding: 0.8em 1.2em;
    font-size: clamp(0.95rem, 3.5vw, 1.1rem);
    max-width: 94vw;
    border-radius: 1em;
    margin: 1.2rem auto;
  }

  /* ── Hero CTA buttons ── */
  .hero-buttons,
  .hero-cta,
  .cta-buttons {
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    padding: 0 1rem;
  }

  .cta-button,
  .hero-btn,
  .btn-primary,
  .btn-secondary {
    width: 100%;
    max-width: 320px;
    text-align: center;
    justify-content: center;
  }

  /* ── Page content container ── */
  #pageContainer,
  .page,
  .wrap,
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* ── Scroll area top offset for mobile header ── */
  #scrollArea {
    top: 60px;
  }

  /* ── Dashboard iframe ── */
  #dashboardIframe,
  .dashboard-iframe {
    top: 60px;
    height: calc(100vh - 60px);
  }

  /* ── Back button ── */
  .back-btn-fixed {
    top: 70px;
    right: 12px;
    font-size: 0.8rem;
    padding: 0.35rem 0.9rem;
  }

  /* ── Modals: full width ── */
  .modal-content {
    max-width: calc(100vw - 24px);
    padding: 24px 18px 20px;
    border-radius: 14px;
  }

  .modal-content-inner {
    max-height: calc(90vh - 80px);
  }

  /* ── Forms: full-width inputs ── */
  input, select, textarea {
    width: 100%;
    box-sizing: border-box;
    font-size: 16px; /* prevents iOS zoom on focus */
  }

  /* ── Footer columns: 2-up on mobile ── */
  .site-footer .footer-col {
    grid-column: span 6;
  }

  .site-footer .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 6px;
  }
}


/* ═══════════════════════════════════════════════════════════════
   SMALL MOBILE (≤ 480px) — further tightening
═══════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {

  .header-container {
    padding: 0.4rem 0.75rem;
  }

  .logo-link img {
    height: 32px;
  }

  .hamburger {
    width: 36px;
    height: 36px;
  }

  /* Full-width footer cols */
  .site-footer .footer-col {
    grid-column: span 12;
  }

  /* Hero */
  .hero-title {
    font-size: clamp(1.2rem, 9vw, 1.8rem);
    padding: 0.25em 0.6em;
  }

  .hero-subtitle {
    font-size: clamp(0.88rem, 4vw, 1rem);
    padding: 0.7em 1em;
  }

  /* Modal: full-screen almost */
  .modal-content {
    max-width: calc(100vw - 16px);
    padding: 20px 14px 16px;
  }

  /* Larger tap targets for nav */
  nav li {
    padding: 1rem 1rem;
    font-size: 1.02rem;
  }

  .nav-submenu li {
    padding: 0.85rem 0.8rem;
  }
}


/* ═══════════════════════════════════════════════════════════════
   CONTENT SECTIONS — cards, grids, tables
═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Generic card grids → single column */
  .cards-grid,
  .features-grid,
  .roles-grid,
  .benefits-grid,
  .steps-grid,
  .services-grid,
  .about-overview,
  .process-flow {
    grid-template-columns: 1fr !important;
    flex-direction: column;
    gap: 1rem;
  }

  /* Role/feature cards: full width */
  .role-card,
  .feature-card,
  .service-card,
  .benefit-block,
  .step-card,
  .glass,
  .card {
    width: 100%;
    box-sizing: border-box;
  }

  /* Section padding */
  .section,
  .sec-hdr,
  .page-section,
  [class*="-section"] {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Headings scale down */
  h1 { font-size: clamp(1.6rem, 6vw, 2.4rem); }
  h2 { font-size: clamp(1.3rem, 5vw, 1.9rem); }
  h3 { font-size: clamp(1.1rem, 4vw, 1.5rem); }

  /* Process arrows: rotate */
  .process-arrow {
    transform: rotate(90deg);
    margin: 0.3rem auto;
  }

  /* Tables: horizontal scroll */
  .table-wrapper,
  .tbl-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 480px;
  }

  /* Normative requirements table — can be very wide */
  .normative-table {
    font-size: 0.82rem;
  }

  /* FAQ accordion */
  .faq-item,
  .accordion-item {
    border-radius: 10px;
  }

  /* Guide article */
  .guide-content,
  .guide-article {
    padding: 1rem;
  }

  /* How it works steps */
  .steps-list,
  .how-steps {
    flex-direction: column;
    gap: 1rem;
  }

  .step-item,
  .how-step {
    width: 100%;
  }

  /* News cards */
  .news-grid,
  .news-list {
    grid-template-columns: 1fr !important;
  }

  /* Investor/applicant/provider page two-column sections */
  .two-col,
  .split-layout,
  .info-columns {
    flex-direction: column;
    gap: 1.2rem;
  }

  /* Advantages grid → 1 col on mobile */
  .advantages-grid,
  .coverage-highlights {
    grid-template-columns: 1fr !important;
  }

  /* Coverage numbers / stats */
  .coverage-number,
  .stat-number {
    font-size: 2rem;
  }
}


/* ═══════════════════════════════════════════════════════════════
   GUIDE PAGES
═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .guide-hero,
  .guide-header {
    padding: 1.5rem 1rem;
  }

  .guide-hero h1,
  .guide-header h1 {
    font-size: clamp(1.4rem, 6vw, 2rem);
  }

  .guide-body,
  .guide-main {
    padding: 1rem;
  }

  .guide-toc {
    position: static;
    width: 100%;
    margin-bottom: 1.5rem;
  }

  .guide-layout,
  .guide-with-toc {
    flex-direction: column;
    gap: 1rem;
  }

  .guide-sidebar {
    width: 100%;
    order: -1; /* TOC above content on mobile */
  }
}


/* ═══════════════════════════════════════════════════════════════
   CHATBOT — adjust position for mobile bottom bar
═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .chatbot-toggle {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
  }

  .chatbot-widget {
    bottom: 76px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
  }
}


/* ═══════════════════════════════════════════════════════════════
   MISC UTILITIES
═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Hide decorative separators on mobile */
  .footer-sep {
    display: none;
  }

  /* Wider badges/pills */
  .badge,
  .tag,
  .chip {
    white-space: normal;
  }

  /* Notification modal */
  #notificationModal .modal-content {
    max-width: calc(100vw - 20px);
  }

  /* Cookie consent */
  .cookie-banner,
  .cookie-consent {
    padding: 1rem;
    flex-direction: column;
    gap: 0.75rem;
  }

  .cookie-banner .cookie-buttons,
  .cookie-consent .cookie-buttons {
    flex-direction: column;
    width: 100%;
  }

  .cookie-banner button,
  .cookie-consent button {
    width: 100%;
  }
}
