/* ==========================================================================
   MEDIBILIS - responzivita (telefon, tablet, notebook, siroke monitory)
   Nacita se jako posledni a pouze doplnuje puvodni vzhled ze style.css.
   Pravidla: zadny vodorovny scroll, dostatecne mezery, velke cile pro prst (min. 44 px),
   kompaktni vyska kontejneru na mobilu, plnoobrazovkove menu.
   ========================================================================== */

html { overflow-x: hidden; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { max-width: 100%; overflow-x: hidden; }
img, video, svg, iframe { max-width: 100%; }
h1, h2, h3, h4, p, li, a, span, div { overflow-wrap: break-word; }
:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 3px; border-radius: 4px; }
.button:focus-visible, .w-button:focus-visible { outline-offset: 3px; border-radius: 100px; }

/* ---------- siroke obrazovky: obsah a hlavicka zarovnane se stejnym sloupcem ---------- */
.nav-component { padding-left: max(6.5vw, calc((100vw - var(--container-max)) / 2)); padding-right: max(6.5vw, calc((100vw - var(--container-max)) / 2)); }
.hero_content_inner { padding-left: max(clamp(3rem, 6.5vw, 8rem), calc((100vw - var(--container-max)) / 2)); }
@media (min-width: 1800px) {
  .hero_card_container { min-height: 540px; }
}

/* ---------- notebook / maly desktop: hlavicka s hamburgerem, aby menu nebylo prepchane ---------- */
@media (max-width: 1365px) {
  .nav-menu, .nav_cta { display: none; }
  .nav-menu-button { display: flex; width: 44px; height: 44px; border-radius: 12px; }
  .nav-menu-button:active { background: var(--light-grey); }
}
@media (min-width: 1366px) {
  .mobile-nav-overlay { display: none !important; }
}

/* ==========================================================================
   TABLET A MENSI (do 991 px)
   ========================================================================== */
@media (max-width: 991px) {
  :root { --nav-height: 68px; }
  .nav-component { padding-left: max(5vw, 1.25rem, env(safe-area-inset-left)); padding-right: max(5vw, 1.25rem, env(safe-area-inset-right)); }
  .nav-component.scrolled { height: var(--nav-height); }

  .padding-global { padding-left: max(5vw, 1.25rem, env(safe-area-inset-left)); padding-right: max(5vw, 1.25rem, env(safe-area-inset-right)); }
  .section_about_able, .section_products_services, .section_news, .section_inquiry, .section_custom { padding-top: clamp(3rem, 8vw, 4.5rem); padding-bottom: clamp(3rem, 8vw, 4.5rem); }
  .section_awards, .section_clients_banner { padding-top: clamp(2.5rem, 6vw, 3.5rem); padding-bottom: clamp(2.5rem, 6vw, 3.5rem); }
  .section_header_line { margin-bottom: 1.75rem; }

  /* hero: bezpecny odstup od hlavicky, kompaktnejsi vyska, velky citelny nadpis */
  .section_hero { padding-top: calc(var(--nav-height) + 14px); padding-bottom: 1rem; }
  .hero_card_container { margin-right: 14px; min-height: clamp(340px, 52vh, 460px); border-top-right-radius: 32px; border-bottom-right-radius: 32px; }
  .hero_content_inner { padding: 2.25rem 1.5rem 2.25rem max(5vw, 1.25rem); max-width: 40rem; }
  .hero_headline { font-size: clamp(1.9rem, 6.2vw, 2.9rem); line-height: 1.15; margin-bottom: 1.25rem; }
  .hero-tag { font-size: 0.7rem; letter-spacing: 0.12em; margin-bottom: 1rem; }
  .hero_gradient_overlay { background: linear-gradient(180deg, rgba(14, 13, 13, 0.55) 0%, rgba(14, 13, 13, 0.86) 100%); }

  .about_able_layout { gap: 2rem; }
  .heading-2.about_us { font-size: clamp(1.35rem, 3.6vw, 1.9rem); line-height: 1.4; }
  .team-collapse-container { padding: 1.75rem; margin-top: 2.25rem; }
  .team-members-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.75rem; margin-top: 1.5rem; }
  .team-avatar-wrapper { height: 260px; }
  .team-avatar-img { object-position: center 22%; }

  .quote_bar { margin-left: max(5vw, 1.25rem); margin-right: max(5vw, 1.25rem); padding: 0 0 0 1rem; max-width: none; font-size: 1rem; }
  .numbers_wrapper { padding-top: 2rem; padding-bottom: 2rem; }

  /* produkty: 2 sloupce na tabletu, 1 na telefonu */
  .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
  .product-card { min-height: 340px; padding: 1.75rem; }
  .product-card.is-large { grid-column: span 2; min-height: 340px; }
  /* stitek v rohu se na tabletu a mobilu vykresli nad nadpisem (aby se s nim neprekryval) */
  .card-corner-badge { position: relative; top: auto; right: auto; align-self: flex-start; margin-bottom: 0.8rem; max-width: 100%; }

  .news_wrapper { gap: 2rem; }
  .news_image_wrapper { aspect-ratio: 16 / 10; }
  .news_image { height: 100%; object-fit: cover; }

  .contact_cards_grid { gap: 1.25rem; margin-top: 1.75rem; }
  .contact_form_wrap { margin-top: 2rem; }

  .section-footer { padding-top: 3.5rem; }
  .grid { gap: 2.25rem; padding-bottom: 2.5rem; }

  /* mobilni menu pres celou obrazovku */
  .mobile-nav-overlay { height: 100vh; height: 100dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; justify-content: flex-start; gap: 1.25rem;
    padding: max(1.1rem, env(safe-area-inset-top)) max(5vw, 1.25rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(5vw, 1.25rem, env(safe-area-inset-left)); }
  .mobile-nav-header { min-height: calc(var(--nav-height) - 14px); }
  .mobile-nav-menu-list { gap: 0; margin-top: 0.5rem; }
  .mobile-nav-menu-list .nav-link { display: block; font-size: clamp(1.4rem, 5.6vw, 1.75rem); padding: 0.9rem 0; border-bottom: 1px solid var(--border-light); }
  .mobile-nav-menu-list .nav-link:last-child { border-bottom: 0; }
  .mobile-nav-extra { margin-top: auto; width: 100%; padding-top: 1rem; }
  .mobile-nav-extra .nav-link_language { padding: 0.55rem 0.8rem; font-size: 0.9rem; }
  .mobile-nav-extra .button { min-height: 52px; font-size: 1rem; }
  .mobile-contacts li { font-size: 1rem; }
  .mobile-contacts a { padding: 0.15rem 0; }
}

/* mobilni menu na vetsi obrazovce (tablet, maly notebook): obsah vycentrovany a nerozteazeny */
@media (min-width: 768px) and (max-width: 1365px) {
  .mobile-nav-overlay { align-items: center; }
  .mobile-nav-header, .mobile-nav-menu-list, .mobile-nav-extra { width: 100%; max-width: 640px; }
  .mobile-nav-overlay { padding-top: 1.5rem; }
}

/* ==========================================================================
   VELKY TELEFON (do 767 px)
   ========================================================================== */
@media (max-width: 767px) {
  .products-grid { grid-template-columns: 1fr; }
  .product-card.is-large { grid-column: span 1; }
  .product-card, .product-card.is-large { min-height: 300px; }
  .team-members-grid { grid-template-columns: 1fr; }
  .team-avatar-wrapper { height: 230px; }
  .grid { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================================
   TELEFON (do 575 px)
   ========================================================================== */
@media (max-width: 575px) {
  body { font-size: 0.97rem; }
  :root { --nav-height: 64px; }
  .brand { gap: 10px; min-width: 0; }
  .brand-emblem-badge { width: 34px; height: 34px; }
  .brand-name { font-size: 1.2rem; }
  .brand-logo-sub { font-size: 0.56rem; letter-spacing: 0.14em; }
  .brand-logo-img { height: 34px; }

  .section_hero { padding-top: calc(var(--nav-height) + 12px); }
  .hero_card_container { margin-right: 12px; min-height: 320px; border-top-right-radius: 28px; border-bottom-right-radius: 28px; }
  .hero_content_inner { padding: 2rem 1.25rem 2rem 1.25rem; }
  .hero-tag { display: none; }                       /* mene textu v hero */
  .hero_headline { font-size: clamp(2rem, 9.2vw, 2.45rem); margin-bottom: 1.15rem; }

  h2 { font-size: clamp(1.45rem, 6.4vw, 1.8rem); }
  h3 { font-size: clamp(1.2rem, 5vw, 1.4rem); }
  .title { font-size: 0.75rem; letter-spacing: 0.13em; }
  .heading-2 { margin-bottom: 1.75rem !important; }

  .able-letters-stack { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .able-letter-card { padding: 1rem 1rem; border-radius: 14px; }
  .able-letter-char { font-size: 1.9rem; margin-bottom: 0.25rem; }
  .able-letter-name { font-size: 0.92rem; }
  .able-active-pillar-box { padding: 1.25rem; }
  .able-pillar-title { font-size: 1.15rem; }
  .able-pillar-desc { font-size: 0.97rem; }
  .team-collapse-container { padding: 1.25rem; border-radius: 18px; }

  .number-display { font-size: clamp(1.8rem, 8.5vw, 2.3rem); }
  .number-description { font-size: 0.8rem; }
  .marquee-content.scroll { gap: 2.25rem; padding-right: 2.25rem; animation-duration: 30s; }

  .product-card, .product-card.is-large { min-height: 270px; padding: 1.25rem; border-radius: 18px; }
  .card-content-inner { gap: 0.7rem; width: 100%; }
  .card-title { font-size: clamp(1.25rem, 5.6vw, 1.5rem); padding-right: 0; }
  .card-desc { font-size: 0.9rem; line-height: 1.5; }
  .card-corner-badge { font-size: 0.66rem; padding: 5px 11px; }
  .card-actions-row { flex-direction: column; align-items: stretch; width: 100%; gap: 0.55rem; margin-top: 0.35rem; }

  /* tlacitka: pres celou sirku, text se muze zalomit, cil pro prst min. 46 px */
  .button, .w-button { white-space: normal; max-width: 100%; min-height: 46px; text-align: center; padding: 0.7rem 1.4rem; line-height: 1.25; }
  .card-actions-row .button, .contact_card_actions .button, .custom_btn_row .button, .news_content_wrapper .button { width: 100%; }

  .news_content_wrapper { gap: 1.1rem; }
  .news_heading { font-size: clamp(1.5rem, 7vw, 1.9rem); }

  .contact_card { padding: 1.35rem; border-radius: 18px; }
  .contact_card_header { gap: 0.9rem; }
  .contact_card_icon { width: 42px; height: 42px; }
  .contact_card_title { font-size: 1.1rem; }
  .contact_detail_row { flex-direction: column; align-items: flex-start; gap: 0.15rem; }
  .contact_detail_val { text-align: left; }
  .contact_card_actions { flex-direction: column; align-items: stretch; }
  .contact_card_details { gap: 0.75rem; margin-bottom: 1.25rem; }

  .grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom-row { align-items: flex-start; }
  .footer-socials-wrap { flex-wrap: wrap; gap: 0.9rem 1.5rem; }
  .footer-socials-link { min-height: 44px; }
  button.footer_link { min-height: 44px; }
  .div-block-5 { width: 300px; right: -40px; }

  /* vyskakovaci okna jako spodni panel */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-card { max-width: none; width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 22px 22px 0 0; border-left: 0; border-right: 0; border-bottom: 0; }
  .modal-header { padding: 1.1rem 1.25rem; position: sticky; top: 0; background: var(--white); z-index: 2; border-radius: 22px 22px 0 0; }
  .modal-header h3 { font-size: 1.1rem; padding-right: 0.5rem; }
  .modal-close { width: 44px; height: 44px; flex: none; }
  .modal-body { padding: 1.25rem; }
  .modal-footer { padding: 1rem 1.25rem max(1rem, env(safe-area-inset-bottom)); border-radius: 0; position: sticky; bottom: 0; }
  .modal-footer .button { width: 100%; }
  .service-modal-img { height: 170px; margin-bottom: 1.1rem; }
  .qr-code-wrapper { width: min(230px, 68vw); height: auto; aspect-ratio: 1; margin: 1.1rem auto; }
  .qr-bank-details { padding: 1rem; }
  .qr-bank-row { flex-direction: column; gap: 0.1rem; margin-bottom: 0.75rem; }
  .qr-bank-row span:last-child { text-align: left; padding-left: 0; }
  .news-article-header h2 { font-size: 1.3rem !important; }

  .toast-container { left: 1rem; right: 1rem; bottom: max(1rem, env(safe-area-inset-bottom)); align-items: stretch; }
  .toast { border-radius: 16px; padding: 0.85rem 1.1rem; font-size: 0.9rem; }
}

/* ==========================================================================
   MALY TELEFON (do 374 px, napr. iPhone SE 1. gen., 320 px)
   ========================================================================== */
@media (max-width: 374px) {
  .brand-logo-sub { display: none; }
  .brand-name { font-size: 1.1rem; }
  .hero_card_container { min-height: 300px; }
  .hero_headline { font-size: 1.85rem; }
  .product-card, .product-card.is-large { padding: 1.1rem; }
  .contact_card { padding: 1.15rem; }
  .able-letter-card { padding: 0.85rem; }
  .able-letter-name { font-size: 0.85rem; }
  .captcha_row { gap: 0.5rem; }
}

/* ---------- telefon na sirku / nizke obrazovky ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  .hero_card_container { min-height: 0; }
  .hero_content_inner { padding-top: 1.5rem; padding-bottom: 1.5rem; }
  .hero_headline { font-size: clamp(1.6rem, 4.5vw, 2.2rem); }
  .mobile-nav-menu-list .nav-link { padding: 0.55rem 0; font-size: 1.25rem; }
}

/* ---------- dotykova zarizeni: zadne "prilepene" hover efekty ---------- */
@media (hover: none) {
  .product-card:hover, .contact_card:hover, .able-letter-card:hover { transform: none; }
  .product-card:hover .product-card-img, .team-member-card:hover .team-avatar-img { transform: none; }
  .marquee:hover .marquee-content { animation-play-state: running; }
}

/* ---------- uzivatel si vypnul animace ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .marquee-content.scroll { animation: none; }
  .clients-marquee { overflow-x: auto; }
}

/* ---------- tisk ---------- */
@media print {
  .nav-component, .mobile-nav-overlay, .modal-overlay, .toast-container, .marquee { display: none !important; }
  .section_hero { padding-top: 0; }
}
