/**
 * Azzurra — ottimizzazioni mobile (MOB-03+)
 * Breakpoint principale: 768px · esteso 320px per CER
 */

/* --- 1. Complianz banner compatto --- */
@media (max-width: 768px) {
  #cmplz-cookiebanner-container {
    align-items: flex-end !important;
  }
  #cmplz-cookiebanner-container .cmplz-cookiebanner {
    max-width: 100% !important;
    width: calc(100% - 16px) !important;
    margin: 8px !important;
    max-height: 42vh !important;
    overflow-y: auto !important;
    padding: 14px 16px 16px !important;
    border-radius: 12px 12px 0 0 !important;
  }
  .cmplz-cookiebanner .cmplz-title {
    font-size: 14px !important;
    margin-bottom: 6px !important;
    line-height: 1.3 !important;
  }
  .cmplz-cookiebanner .cmplz-message {
    font-size: 12px !important;
    line-height: 1.45 !important;
    margin-bottom: 10px !important;
  }
  .cmplz-cookiebanner .cmplz-buttons {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .cmplz-cookiebanner .cmplz-btn {
    flex: 1 1 calc(50% - 4px) !important;
    min-height: 44px !important;
    padding: 10px 12px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
  }
  .cmplz-cookiebanner .cmplz-btn.cmplz-view-preferences,
  .cmplz-cookiebanner .cmplz-btn.cmplz-manage-consent {
    flex: 1 1 100% !important;
  }
}

/* --- 2. Breadcrumb hero duplicato nascosto (nav breadcrumb sostituita da hamburger) --- */
@media (max-width: 768px) {
  .azzurra-page .breadcrumb-hero {
    display: none !important;
  }
  .azzurra-page .section-hero-page {
    padding-top: 40px !important;
    padding-bottom: 48px !important;
  }
}

/* --- 2b. Header mobile: solo logo, hamburger tema (no reset Hello #c36) --- */
@media (max-width: 767px) {
  .elementor-location-header .stl-header-brand,
  .elementor-location-header .stl-header-brand > .e-con-inner,
  .elementor-location-header .stl-brand-tagline-widget,
  .elementor-location-header .stl-brand-tagline,
  .elementor-location-header .stl-brand-name-link {
    display: none !important;
  }
  .elementor-location-header .stl-header-logo-row,
  .elementor-location-header .stl-header-logo-row > .e-con-inner {
    gap: 0 !important;
  }
  .elementor-location-header .stl-mobile-menu__toggle,
  .elementor-location-header .stl-mobile-menu__close {
    background: #fff !important;
    background-color: #fff !important;
    border-color: #DCE3EB !important;
    color: #053D66 !important;
  }
  .elementor-location-header .stl-mobile-menu__toggle:hover,
  .elementor-location-header .stl-mobile-menu__toggle:focus,
  .elementor-location-header .stl-mobile-menu__toggle:active,
  .elementor-location-header .stl-mobile-menu__close:hover,
  .elementor-location-header .stl-mobile-menu__close:focus,
  .elementor-location-header .stl-mobile-menu__close:active {
    background: #F4F7FA !important;
    background-color: #F4F7FA !important;
    color: #08548C !important;
    border-color: #94AECA !important;
  }
  .elementor-location-header .stl-mobile-menu__link,
  .elementor-location-header .stl-mobile-menu__link:visited {
    color: #053D66 !important;
  }
  .elementor-location-header .stl-mobile-menu__link:hover,
  .elementor-location-header .stl-mobile-menu__link:focus,
  .elementor-location-header .stl-mobile-menu__link:active {
    color: #08548C !important;
    background: #F4F7FA !important;
  }
  .elementor-location-header .stl-mobile-menu__cta,
  .elementor-location-header .stl-mobile-menu__cta:visited {
    background: #08548C !important;
    color: #fff !important;
  }
  .elementor-location-header .stl-mobile-menu__cta:hover,
  .elementor-location-header .stl-mobile-menu__cta:focus,
  .elementor-location-header .stl-mobile-menu__cta:active {
    background: #053D66 !important;
    color: #fff !important;
  }
}

@media (max-width: 768px) {
  .stl-home-cards {
    margin-top: -20px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .stl-home-cards > .e-con-inner {
    gap: 12px !important;
  }
  .stl-home-cards .e-con {
    flex-direction: column !important;
  }
  .stl-kpi-strip {
    grid-template-columns: 1fr !important;
    margin-left: 16px !important;
    margin-right: 16px !important;
  }
}

/* --- 4. Form Contatti / HR --- */
@media (max-width: 768px) {
  .elementor-form-azzurra .elementor-form-fields-wrapper,
  .elementor-form-azzurra--hr .elementor-form-fields-wrapper {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .elementor-form-azzurra .elementor-field-type-acceptance label {
    gap: 14px;
    align-items: flex-start;
    padding: 4px 0;
  }
  .elementor-form-azzurra .elementor-field-type-acceptance input[type="checkbox"] {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px;
    min-height: 22px;
    margin-top: 2px;
    flex: none;
  }
  .elementor-form-azzurra .elementor-field-type-submit .elementor-button,
  .elementor-form-azzurra .elementor-button {
    width: 100% !important;
    min-height: 48px !important;
    justify-content: center;
  }
  .elementor-form-azzurra--hr .elementor-field-type-upload .elementor-field-label {
    min-height: 48px !important;
    padding: 14px 16px !important;
  }
  .stl-hr-form-lead,
  .stl-hr-form-wrap,
  .stl-hr-form-fields,
  .azzurra-page .stl-hr-form-wrap,
  .azzurra-page .stl-hr-form-fields {
    flex: 1 1 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .stl-contact-cards__item {
    padding: 24px 20px !important;
  }
}

/* --- 5. Mappa --- */
@media (max-width: 768px) {
  .stl-google-map.elementor-widget-google_maps iframe,
  .stl-map-iframe {
    aspect-ratio: 16 / 10;
    min-height: 220px;
    max-height: 280px;
    touch-action: manipulation;
  }
}

/* --- 6. News sidebar --- */
@media (max-width: 768px) {
  .azzurra-page .e-con.grid-sidebar {
    flex-direction: column !important;
    gap: 32px !important;
  }
  .azzurra-page .e-con.grid-sidebar > .e-con:first-child,
  .azzurra-page .e-con.grid-sidebar > .e-con:last-child {
    flex: 1 1 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .azzurra-page .e-con.grid-sidebar > .e-con:last-child {
    order: 2;
  }
  .stl-news-cat-link {
    padding: 12px 0;
    min-height: 44px;
    align-items: center;
  }
  .panel-navy .stl-linkedin-embed {
    min-height: 100px;
  }
  .azzurra-page .card-bordered[style*="width: 48%"],
  .azzurra-page .e-con[style*="width: 48%"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
  }
}

/* --- 7. Pre-footer CTA stack --- */
@media (max-width: 768px) {
  .elementor-location-footer .stl-pre-footer,
  .stl-pre-footer {
    padding: 36px 0 !important;
  }
  .elementor-location-footer .stl-pre-footer-inner,
  .elementor-location-footer .stl-pre-footer-inner > .e-con-inner {
    flex-direction: column !important;
    align-items: stretch !important;
    text-align: center;
    gap: 24px !important;
  }
  .stl-pre-footer-title .elementor-heading-title {
    font-size: 26px !important;
  }
  .stl-pre-footer-actions,
  .elementor-location-footer .stl-pre-footer-actions,
  .elementor-location-footer .stl-pre-footer-actions > .e-con-inner {
    flex-direction: column !important;
    width: 100% !important;
    gap: 10px !important;
  }
  .stl-pre-footer-actions .elementor-widget-button,
  .stl-pre-footer-actions .elementor-button-wrapper {
    width: 100% !important;
  }
  .stl-pre-footer-actions .elementor-button {
    width: 100% !important;
    min-height: 48px !important;
    justify-content: center;
  }
}

/* --- 8. Footer touch target --- */
@media (max-width: 768px) {
  .stl-footer-links a {
    display: flex;
    align-items: center;
    padding: 12px 0;
    min-height: 44px;
    line-height: 1.35;
  }
  .stl-footer-contact-block a {
    display: inline-flex;
    align-items: center;
    padding: 10px 0;
    min-height: 44px;
  }
  .stl-footer-bar-inner {
    flex-direction: column !important;
    text-align: center;
    gap: 8px !important;
  }
}

/* --- 9. Motore CER --- */
.stl-cer-search {
  width: 100%;
}
.stl-cer-form {
  display: flex;
  gap: 2px;
  background: #fff;
  border: 1px solid #D3DBE4;
  padding: 6px;
  border-radius: 999px;
  overflow: hidden;
}
.stl-cer-form__input {
  flex: 1;
  border: none;
  outline: none;
  padding: 18px 20px;
  font-family: 'Barlow', Arial, sans-serif;
  font-size: 17px;
  color: #053D66;
  background: transparent;
  border-radius: 6px;
  min-width: 0;
}
.stl-cer-form__submit {
  background: #08548C;
  color: #fff;
  border: none;
  font-family: 'Barlow', Arial, sans-serif;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 18px 34px;
  cursor: pointer;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.stl-cer-result {
  margin-top: 28px;
}
.stl-cer-result:empty,
.stl-cer-result[style*="display: none"],
.stl-cer-result[style*="display:none"] {
  display: none !important;
  margin-top: 0;
}

@media (max-width: 768px) {
  .stl-cer-form {
    flex-direction: column;
    border-radius: 12px;
    padding: 8px;
    gap: 8px;
  }
  .stl-cer-form__input {
    padding: 14px 16px;
    font-size: 16px;
    width: 100%;
  }
  .stl-cer-form__submit {
    width: 100%;
    padding: 14px 20px;
    min-height: 48px;
  }
  .stl-cer-result {
    margin-top: 20px;
  }
}

@media (max-width: 320px) {
  .stl-cer-form__input {
    font-size: 16px;
    padding: 12px 14px;
  }
  .stl-cer-form__submit {
    font-size: 11px;
    letter-spacing: 0.06em;
    padding: 12px 14px;
  }
}

@media (max-width: 768px) {
  #stl-cer-result > div {
    padding: 20px 18px !important;
  }
  #stl-cer-result a[style*="display:inline-block"],
  #stl-cer-result a[style*="display: inline-block"] {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    box-sizing: border-box !important;
    min-height: 48px !important;
    line-height: 1.2 !important;
    padding-top: 16px !important;
    padding-bottom: 16px !important;
  }
  #stl-cer-result span[style*="font-size:27px"] {
    font-size: 22px !important;
  }
}

/* --- 10. Team grid --- */
@media (max-width: 768px) {
  .stl-team-grid {
    gap: 20px;
  }
  .stl-team-card__body {
    padding: 18px 16px 22px;
  }
}

/* --- 11. Certificazioni --- */
@media (max-width: 768px) {
  .stl-cert-list__row {
    grid-template-columns: 1fr !important;
    gap: 16px;
    padding: 20px !important;
    align-items: start;
  }
  .stl-cert-pdf-btn,
  .stl-cert-pdf-btn--disabled {
    width: 100%;
    text-align: center;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }
  .azzurra-page .e-con.split-columns-105-95 {
    gap: 32px !important;
  }
}

/* --- 12. Area riservata --- */
@media (max-width: 768px) {
  .panel-navy-login {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
    margin-top: 8px;
  }
  .stl-feature-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .stl-feature-grid__item {
    padding: 22px 20px !important;
  }
  .azzurra-page .section-padding-md,
  .azzurra-page .section-padding-md > .e-con-inner {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
  }
}

/* --- 13. Generale 320px --- */
@media (max-width: 320px) {
  .h1-home-hero .elementor-heading-title {
    font-size: 40px !important;
  }
  .h1-page-hero .elementor-heading-title {
    font-size: 34px !important;
  }
  .stl-mobile-breadcrumb-nav {
    font-size: 10px !important;
    letter-spacing: 0.08em !important;
  }
  .stl-mobile-breadcrumb-nav__sep {
    padding: 0 5px !important;
  }
}

/* --- 14. Layout mobile — split colonne, timeline, griglie --- */
@media (max-width: 768px) {
  /* Stack verticale: split columns Elementor */
  .azzurra-page .e-con.split-columns-48-52,
  .azzurra-page .e-con.split-columns-90-110,
  .azzurra-page .e-con.split-columns-105-95,
  .azzurra-page .e-con.grid-split,
  .azzurra-page .e-con.grid-sidebar,
  .azzurra-page .e-con.stl-mobile-stack {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 28px !important;
  }

  .azzurra-page .e-con.split-columns-48-52 > .e-con,
  .azzurra-page .e-con.split-columns-90-110 > .e-con,
  .azzurra-page .e-con.split-columns-105-95 > .e-con,
  .azzurra-page .e-con.grid-split > .e-con,
  .azzurra-page .e-con.grid-sidebar > .e-con,
  .azzurra-page .e-con.stl-mobile-stack > .e-con {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    --width: 100% !important;
    --flex-basis: auto !important;
  }

  /* Home: testo prima dell'immagine su mobile */
  .azzurra-page .e-con.split-columns-48-52 > .e-con:first-child {
    order: 2;
  }
  .azzurra-page .e-con.split-columns-48-52 > .e-con:last-child {
    order: 1;
  }

  /* Timeline Chi siamo — card verticali leggibili */
  .stl-timeline {
    gap: 12px;
  }
  .stl-timeline__row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #DCE3EB;
    border-radius: 8px;
  }
  .stl-timeline__year {
    font-size: 22px;
    line-height: 1.2;
  }
  .stl-timeline__text {
    border-left: none;
    padding-left: 0;
    padding-top: 8px;
    border-top: 1px solid #E8EDF2;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
  }

  /* Card storia / timeline container */
  .azzurra-page .card-bordered.bg-cream {
    padding: 24px 20px !important;
    overflow: visible;
  }

  /* Widget griglia split (servizi home, trattamenti) */
  .stl-services-split,
  .stl-treatment-grid,
  .stl-stat-cards,
  .stl-job-grid,
  .stl-contact-cards {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  .stl-services-split {
    gap: 32px !important;
  }
  .stl-numbered-rows__item {
    padding: 22px 20px;
    gap: 16px;
  }
  .stl-numbered-rows__num {
    width: 44px;
    height: 44px;
    font-size: 13px;
  }

  /* Media year badge home */
  .stl-media-year-badge {
    margin-bottom: 16px;
  }
  .stl-media-year-badge__badge {
    right: 12px;
    bottom: -18px;
    left: auto;
  }

  /* KPI overlap hero */
  .azzurra-page .margin-overlap-62 {
    margin-top: -24px !important;
  }

  /* Panel scuri impianto (48% → stack) */
  .azzurra-page .panel-dark-card {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
  }

  /* HR form row contatti */
  .azzurra-page .stl-hr-form-row {
    flex-direction: column !important;
    gap: 24px !important;
    padding: 28px 22px !important;
  }
  .stl-hr-wizard__grid--2 {
    grid-template-columns: 1fr !important;
  }
  .azzurra-page .stl-hr-wizard-row {
    padding: 28px 22px !important;
  }

  /* Area riservata: login sotto i feature */
  .azzurra-page .panel-navy-login {
    order: 2;
  }

  /* Certificazioni: pannello navy dopo la lista */
  .azzurra-page .e-con.grid-sidebar > .e-con.panel-navy {
    order: 2;
  }

  /* Immagini e media block full width */
  .azzurra-page .stl-media-block,
  .azzurra-page .stl-media-block img {
    max-width: 100%;
    width: 100%;
    height: auto;
  }

  /* Quote e testi lunghi */
  .azzurra-page .quote-block {
    margin-top: 20px;
    padding: 20px 18px;
    font-size: 16px;
    line-height: 1.65;
  }

  /* Overflow generale pagine */
  .azzurra-page .e-con,
  .azzurra-page .e-con .e-con-inner {
    min-width: 0;
    overflow-x: clip;
  }
}
