/*
 * DA.PA. ELECTRIC | Mobile usability patch 2026-12-03
 * Scope: visual layout and touch targets ONLY. No changes to forms, CRM, SMTP,
 * jobs, Reonic loader, consent choices, or administrative functionality.
 * Loaded after the original styles. Desktop layout is intentionally unchanged.
 */
@media (max-width: 900px) {
  /* Mobile menu: readable, scrollable if device is short, keyboard accessible. */
  .site-header .main-nav {
    max-height: calc(100dvh - var(--header-mobile-height, 74px) - env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 18px 34px rgba(0, 0, 0, .24);
    visibility: hidden;
  }
  .site-header .main-nav.is-open { visibility: visible; }
  .site-header .main-nav a {
    display: flex;
    align-items: center;
    min-height: 48px;
    line-height: 1.4;
    white-space: normal;
  }
  .site-header .menu-toggle { min-width: 44px; min-height: 44px; }
  .hero-slide h1, .hero-slider--compact .hero-slide h1 {
    font-size: clamp(2.8rem, 7vw, 4.2rem);
    line-height: 1.04;
    letter-spacing: -.045em;
  }
  /* Forms and long content must be able to shrink inside grid columns. */
  main :is(.form-page-grid, .contact-layout, .contact-intro-premium__grid,
    .job-offer-head__grid, .job-detail__grid, .service-detail__grid,
    .article-body__grid, .content-module__grid) > * { min-width: 0; }
  main :is(.lead-form, .form-grid, .form-field, .solar-form, .job-detail__form) { min-width: 0; max-width: 100%; }
  main :is(.lead-form, .solar-form, .contact-form-premium, .job-detail__form) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) {
    max-width: 100%;
    min-width: 0;
    font-size: 16px; /* Prevent unwanted Safari iOS focus zoom. */
  }
  main :is(.lead-form, .solar-form, .job-detail__form) .checkbox-field { line-height: 1.55; }
  main :is(.lead-form, .solar-form, .job-detail__form) .checkbox-field input { flex-shrink: 0; }
  .contact-directory-grid, .jobs-grid--premium, .service-highlights ul { min-width: 0; }
  /* Long contact details must wrap, never force a wide viewport. */
  main :is(.contact-channel, .contact-channel__actions, .contact-address-strip,
    .job-facts, .job-application-note, .solar-card) { min-width: 0; overflow-wrap: anywhere; }
  .site-footer__nav > div { min-width: 0; }
}

@media (max-width: 640px) {
  /* Site-wide issue: existing 16px shell margin PLUS 20px shell padding
     causes a double 36px inset on each side on small screens. */
  .shell { width: calc(100% - 32px); padding-inline: 0; }
  .section { padding-top: 58px; padding-bottom: 58px; }
  .site-header .site-header__inner { width: calc(100% - 28px); padding-inline: 0; gap: 7px; }
  main [id] { scroll-margin-top: calc(var(--header-mobile-height, 74px) + 16px); }
  .site-header .brand, .site-header .brand picture { min-width: 0; }
  .site-header .site-header__actions { min-width: 0; gap: 7px; }
  .site-header .header-call { white-space: nowrap; }
  .site-header .menu-toggle { flex: 0 0 44px; border-radius: 12px; }
  /* Readable hierarchy instead of oversized headings squeezed into narrow columns. */
  .hero-slide h1,
  .hero-slider--compact .hero-slide h1 {
    font-size: clamp(2.4rem, 10.5vw, 3.2rem);
    line-height: 1.01;
    letter-spacing: -.042em;
    overflow-wrap: break-word;
  }
  .display-title,
  .section-heading h2,
  .contact-cta h2,
  .energy-banner h2 {
    font-size: clamp(2.05rem, 9.1vw, 3rem);
    line-height: 1.08;
    letter-spacing: -.042em;
    overflow-wrap: break-word;
  }
  .hero-slide__description { max-width: 100%; font-size: 1rem; line-height: 1.58; }
  .hero-slide__content { padding-bottom: 92px; }
  .hero-slider, .hero-slider--compact {
    height: clamp(560px, 78svh, 720px);
    min-height: 0;
  }
  .hero-slider--compact { height: clamp(520px, 71svh, 665px); }
  .hero-slide__actions { gap: 12px; margin-top: 20px; }
  .hero-slide__actions .button { max-width: 100%; white-space: normal; text-align: center; }
  .hero-slider__controls { bottom: 14px; }
  /* Make slide selectors easier to tap without enlarging the visible blue/yellow bars. */
  .hero-slider__dots button {
    min-width: 36px;
    width: 36px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    background: linear-gradient(90deg,rgba(255,255,255,.32),rgba(255,255,255,.32)) center/100% 3px no-repeat;
  }
  .hero-slider__dots button.is-active {
    width: 48px;
    background: linear-gradient(90deg,#087eff,#ffb000) center/100% 3px no-repeat;
    box-shadow: none;
  }
  .eyebrow { overflow-wrap: break-word; }
  main :is(.editorial-lead, .form-page-intro, .prose p,
    .section-heading > p, .service-card__body > p:not(.eyebrow),
    .contact-channel > p, .contact-channel__actions a,
    .job-card--premium > p, .job-detail-list li,
    .contact-form-premium__note, .solar-page .solar-custom p:not(.eyebrow),
    .solar-page .solar-contact__intro > p:not(.eyebrow)) {
    font-size: 1rem;
    line-height: 1.65;
  }
  .button, .lead-form button[type="submit"] { min-height: 48px; }
  .text-link { min-height: 44px; align-items: center; line-height: 1.4; }
  .services-grid { margin: 0; }
  .service-card__body { padding: 26px 22px 30px; }
  .service-card h3 { font-size: clamp(1.7rem, 8vw, 2.2rem); line-height: 1.1; }
  .service-card__image { height: 210px; }
  .process-grid__body { padding: 24px; }
  .process-grid h3 { margin-top: 16px; }
  .project-card figcaption { padding: 20px; }
  .contact-hub { padding: 56px 0; }
  .contact-hub__head h2 { font-size: clamp(2.05rem, 9vw, 2.8rem); line-height: 1.08; }
  .contact-channel { padding: 22px 18px; }
  .contact-channel__actions a { min-height: 48px; }
  .contact-hub__main-call { max-width: 100%; }
  .form-page-grid, .job-detail__grid, .job-offer-head__grid { gap: 30px; }
  .lead-form, .solar-page .solar-form { padding: 23px 18px; }
  .lead-form label, .solar-form label, .form-field > label { font-size: .83rem; line-height: 1.4; }
  .lead-form :is(input, select, textarea), .solar-form :is(input, select, textarea) { min-height: 46px; }
  .lead-form textarea, .solar-form textarea { min-height: 120px; }
  .lead-form__footer { flex-direction: column; align-items: stretch; gap: 14px; }
  .lead-form__footer button { width: 100%; }
  .form-status { line-height: 1.5; overflow-wrap: anywhere; }
  .job-offer-head__grid, .job-detail__grid { grid-template-columns: minmax(0, 1fr); }
  .job-facts { grid-template-columns: minmax(0,1fr); }
  .job-copy-section { gap: 12px; }
  .job-copy-section h2 { font-size: clamp(1.7rem, 8vw, 2.6rem); line-height: 1.12; }
  .job-detail__form-intro h2 { font-size: clamp(1.8rem, 8vw, 2.4rem); }
  .job-application-note { padding: 22px 18px; }
  .job-application-note h2 { font-size: 1.6rem; line-height: 1.18; }
  .career-email-box { padding: 22px 18px; }
  .career-email-box .button { width: 100%; }
  /* Footer: single readable column, readable links, keep existing separators. */
  .site-footer { padding-top: 56px; }
  .site-footer__top { gap: 30px; padding-bottom: 38px; }
  .site-footer__nav { grid-template-columns: minmax(0,1fr); gap: 30px; }
  .site-footer__nav > div:last-child,
  .site-footer__nav .site-footer__contacts { grid-column: auto; }
  .site-footer__nav :is(a,button) { font-size: .95rem; line-height: 1.5; min-height: 42px; display: inline-flex; align-items: center; }
  .site-footer__nav h3 { font-size: .8rem; line-height: 1.45; }
  .site-footer__contacts .footer-contact-label { width: 100%; }
  .site-footer .site-footer__bottom { font-size: .9rem; line-height: 1.6; }
  .site-footer .site-footer__utility-links a { min-height: 44px; }
  /* Cookie and privacy panels: comfortable scrolling on short phones. */
  /* The assistant stays functional but takes less space over the page. */
  .volt-launcher:not(.is-suspended) { padding: 7px 12px 7px 7px; gap: 8px; max-width: calc(100vw - 110px); }
  .volt-launcher__bolt { width: 34px; height: 34px; font-size: 1.05rem; }
  .volt-launcher__label strong { font-size: .76rem; }
  .cookie-banner { max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; padding: 20px; }
  .cookie-banner h2 { font-size: 1.35rem; }
  .cookie-banner > p:not(.eyebrow) { font-size: .92rem; }
  .consent-modal { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); bottom: 10px; border-radius: 16px; }
  .consent-modal__header { padding: 18px 18px 14px; }
  .consent-modal__body { -webkit-overflow-scrolling: touch; }
  /* Solar offers: smaller headline, larger form copy, deliberate scroll for comparison. */
  .solar-page .solar-hero h1 { font-size: clamp(2.4rem, 10vw, 3.25rem); line-height: 1.06; letter-spacing: -.045em; }
  .solar-page .solar-hero__intro { font-size: 1rem; line-height: 1.6; }
  .solar-page .solar-actions .button { width: 100%; max-width: 100%; }
  .solar-page .solar-hero__stamp { min-width: 0; }
  .solar-page .solar-card { padding: 22px 18px; }
  .solar-page .solar-card__description, .solar-page .solar-specs { font-size: .98rem; line-height: 1.55; }
  .solar-page .solar-capacity strong { font-size: 1.65rem; }
  .solar-page .solar-price>strong { font-size: clamp(2.05rem, 10vw, 3rem); overflow-wrap: anywhere; }
  .solar-page .solar-comparison { padding: 18px 10px; }
  .solar-page .solar-table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .solar-page .solar-table-wrap:focus-visible { outline: 2px solid #087eff; outline-offset: 3px; }
  /* Reonic external widget: improve host only, do not attempt to restyle iframe. */
  .deh-page .deh-hero { padding-block: 44px; }
  .deh-page .deh-hero h1 { font-size: clamp(2.1rem, 8.8vw, 3rem); line-height: 1.12; }
  .deh-page :is(.deh-intro, .deh-config, .deh-outro) h2 { font-size: clamp(1.8rem, 7.8vw, 2.55rem); line-height: 1.14; }
  .deh-page .deh-hero__lead { font-size: 1rem; line-height: 1.65; }
  .deh-page .deh-step p { font-size: 1rem; line-height: 1.6; }
  .deh-page .deh-embed__widget { padding: 8px; overflow: visible; }
  .deh-page .deh-embed__widget iframe { display: block; max-width: 100%; }
  .deh-page .deh-embed__welcome { padding: 30px 18px; }
  .deh-page .deh-embed__welcome > p { font-size: .95rem; line-height: 1.6; }
  .deh-page .deh-button { min-height: 48px; }
}

@media (max-width: 380px) {
  .site-header .site-header__inner { width: calc(100% - 20px); gap: 5px; }
  .site-header .brand { width: 98px !important; }
  .site-header .brand img { max-width: 98px !important; }
  .site-header .site-header__actions { gap: 5px; }
  .site-header .header-call { min-height: 44px; padding: 5px 7px; gap: 5px; }
  .site-header .header-call__icon { width: 14px; flex-basis: 14px; }
  .site-header .header-call__text strong { font-size: .59rem; }
  .site-header .header-call__text small { font-size: .57rem; display: block; }
  .site-header .menu-toggle { width: 40px; min-width: 40px; flex-basis: 40px; }
  .hero-slide h1, .hero-slider--compact .hero-slide h1 { font-size: 2.4rem; }
  .solar-page .solar-hero h1 { font-size: 2.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header .main-nav { scroll-behavior: auto; }
}
