/**
 * Mobile & Responsive Styles voor Thuispakket.nl
 * 
 * Doel: Perfecte mobiele ervaring
 * - Touch-vriendelijke knoppen en inputs
 * - Goede leesbaarheid op kleine schermen
 * - Navigatie die werkt op mobile
 */

/* ============================================================================
   MOBILE BREAKPOINTS
   ============================================================================ */

/* Desktop: menu toggle verbergen */
.nav__menu-toggle {
  display: none;
}

/* Tablet en kleiner */
@media (max-width: 1024px) {
  .page {
    padding: 1rem !important;
  }
}

/* Mobile */
@media (max-width: 768px) {
  
  /* ========================================================================
     NAVIGATIE MOBILE
     ======================================================================== */
  
  .nav {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .nav__links {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
    display: none; /* Standaard verborgen op mobile */
  }

  .nav__links.active {
    display: flex;
  }

  .nav__links li {
    width: 100%;
  }

  .nav__links a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    text-align: left;
  }

  /* Mobile menu toggle button */
  .nav__menu-toggle {
    display: block !important;
    background: none;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    margin-left: auto;
    min-width: 44px;
    min-height: 44px;
    transition: all 0.2s ease;
  }

  .nav__menu-toggle:hover,
  .nav__menu-toggle:focus {
    background: var(--color-neutral-50);
    border-color: var(--color-primary);
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
  }

  /* ========================================================================
     HERO SECTIE MOBILE
     ======================================================================== */

  .hero {
    padding: 2rem 1rem !important;
    text-align: center;
  }

  .hero h1 {
    font-size: 1.75rem !important;
    line-height: 1.2 !important;
    margin-bottom: 1rem !important;
  }

  .hero p {
    font-size: 0.9375rem !important;
    margin-bottom: 1rem !important;
  }

  .hero__form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 100% !important;
  }

  .hero__form input {
    font-size: 16px !important; /* Voorkomt zoom op iOS */
    padding: 1rem !important;
    border-radius: var(--radius-md) !important;
  }

  .hero__form button {
    width: 100%;
    padding: 1rem !important;
    font-size: 1rem !important;
  }

  /* ========================================================================
     FORMULIEREN MOBILE
     ======================================================================== */

  .form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .form__label {
    font-size: 0.9375rem !important;
    margin-bottom: 0.5rem !important;
  }

  .form__input,
  .form select,
  .form textarea {
    font-size: 16px !important; /* Voorkomt zoom op iOS */
    padding: 0.875rem !important;
    width: 100% !important;
    min-width: 0 !important;
    border-radius: var(--radius-md) !important;
  }

  /* Grid formulieren op één kolom */
  .form > div[style*="grid"] {
    grid-template-columns: 1fr !important;
  }

  /* ========================================================================
     RISICO PAGINA MOBILE
     ======================================================================== */

  #risk-hero-section {
    padding: 1.5rem 1rem !important;
  }

  #risk-hero-section h1 {
    font-size: 1.75rem !important;
  }

  #risk-hero-section form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  #risk-hero-section form > div[style*="grid"] {
    grid-template-columns: 1fr !important;
  }

  #risk-hero-section button {
    width: 100%;
    padding: 1rem !important;
  }

  /* Kaart sectie mobile */
  /* Map section grid: 1 kolom op mobile */
  #risk-map-section > div[style*="grid-template-columns: 1fr 250px"] {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  #risk-map-section > div[style*="grid"] {
    grid-template-columns: 1fr !important;
  }

  #risk-map-wrapper {
    position: relative;
  }

  #risk-map {
    height: 300px !important;
    margin-bottom: 1rem;
  }

  .map-sidebar {
    order: -1; /* Sidebar boven kaart op mobile */
  }

  /* Cards grid op één kolom */
  .section > div[style*="grid"] {
    grid-template-columns: 1fr !important;
  }

  /* ========================================================================
     CHECKLIST MOBILE
     ======================================================================== */

  .tp-checklist-container {
    padding: 1rem !important;
  }

  .tp-checklist-section {
    margin-bottom: 1.5rem;
  }

  .tp-checklist-section h3 {
    font-size: 1.125rem !important;
    margin-bottom: 1rem !important;
  }

  .tp-checklist-item {
    padding: 0.75rem 0 !important;
    margin-bottom: 0.5rem !important;
  }

  .tp-checklist-item input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    margin-right: 0.75rem !important;
    flex-shrink: 0;
  }

  .tp-checklist-item label {
    font-size: 0.9375rem !important;
    line-height: 1.5 !important;
  }

  /* ========================================================================
     KNOPPEN MOBILE
     ======================================================================== */

  .button,
  button {
    width: 100%;
    padding: 1rem !important;
    font-size: 1rem !important;
    min-height: 48px; /* Touch target size */
    touch-action: manipulation; /* Voorkomt dubbel-tap zoom */
  }

  .actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .actions .button {
    margin-bottom: 0 !important;
  }

  /* ========================================================================
     CARDS MOBILE
     ======================================================================== */

  .card {
    padding: 1.25rem !important;
    margin-bottom: 1rem;
  }

  .card__title {
    font-size: 1.125rem !important;
    margin-bottom: 0.75rem !important;
  }

  .card__body {
    font-size: 0.9375rem !important;
    line-height: 1.6 !important;
  }

  /* ========================================================================
     WIZARD STAPPEN MOBILE
     ======================================================================== */

  .tp-wizard-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }

  .tp-wizard-buttons button {
    width: 100%;
    margin: 0 !important;
  }

  /* ========================================================================
     MODALS MOBILE
     ======================================================================== */

  .modal-content {
    max-width: 95vw !important;
    margin: 1rem !important;
    padding: 1.5rem !important;
    max-height: 90vh;
    overflow-y: auto;
  }

  /* ========================================================================
     FOOTER MOBILE
     ======================================================================== */

  .footer {
    padding: 2rem 1rem 1rem !important;
  }

  .footer__content {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* ========================================================================
     TYPOGRAPHY MOBILE
     ======================================================================== */

  h1 {
    font-size: 1.75rem !important;
    line-height: 1.2 !important;
  }

  h2 {
    font-size: 1.5rem !important;
    line-height: 1.3 !important;
  }

  h3 {
    font-size: 1.25rem !important;
    line-height: 1.4 !important;
  }

  p {
    font-size: 0.9375rem !important;
    line-height: 1.6 !important;
  }

  /* ========================================================================
     SPACING MOBILE
     ======================================================================== */

  .section {
    padding: 1.5rem 1rem !important;
    margin-bottom: 1rem !important;
  }

  .section__title {
    font-size: 1.5rem !important;
    margin-bottom: 1rem !important;
  }
}

/* ============================================================================
   EXTRA SMALL SCREENS (< 480px)
   ============================================================================ */

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.5rem !important;
  }

  .hero p {
    font-size: 0.875rem !important;
  }

  h1 {
    font-size: 1.5rem !important;
  }

  h2 {
    font-size: 1.25rem !important;
  }

  .card {
    padding: 1rem !important;
  }

  /* Stepper mobile */
  .tp-steps {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .tp-step {
    font-size: 0.85rem;
    padding-inline: 0.6rem;
  }

  /* Plan saved blok mobile */
  .tp-plan-saved {
    padding: 1.5rem !important;
  }

  .tp-plan-saved-actions {
    flex-direction: column;
  }

  .tp-plan-saved-actions .button {
    width: 100%;
    min-height: 44px;
  }
}

/* ============================================================================
   LANDSCAPE MOBILE ORIENTATIE
   ============================================================================ */

@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    padding: 1.5rem 1rem !important;
  }

  .hero h1 {
    font-size: 1.5rem !important;
  }
}

/* ============================================================================
   TOUCH DEVICE OPTIMIZATIES
   ============================================================================ */

@media (hover: none) and (pointer: coarse) {
  /* Touch devices */
  
  /* Grotere touch targets */
  a, button, input[type="checkbox"], input[type="radio"] {
    min-height: 44px;
    min-width: 44px;
  }

  /* Geen hover effecten op touch */
  a:hover,
  button:hover {
    opacity: 1;
  }

  /* Focus states belangrijker op touch */
  a:focus,
  button:focus,
  input:focus {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
  }
}

