/* =========================================================
   ≥ 1440 px — LARGE DESKTOP
   (okraje napr. 40px + 40px)
   ========================================================= */
@media (min-width: 1440px) {
  :root {
    --main-width: min(1330px, calc(100vw - 80px));
  }

  .slide-content > div > img {
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }

  .slide-content > div {
    height: 282px !important;
  }

  .dashboard-history {
    padding-right: 10px;
  }
}


/* =========================================================
   ≤ 1439 px — DESKTOP / NOTEBOOK
   (okraje 40px + 40px)
   ========================================================= */
@media (max-width: 1439px) {
  :root {
    --main-width: min(1200px, calc(100vw - 80px));
  }

  .slide-content > div > img {
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }

  .raabe-select {
    width: 190px;
  }

  .client-login-form-width {
      width: 350px;
    }
}

/* =========================================================
   ≤ 1215 px — SMALL DESKTOP / TABLET LANDSCAPE
   (okraje 32px + 32px)
   ========================================================= */
@media (max-width: 1215px) {
  
    .main-header > :first-child {
        flex: 0 0 100%;
        display: flex;
        justify-content: center;
    }

    .raabe-select {
        width: 250px;
    }
}


/* =========================================================
   ≤ 1199 px — SMALL DESKTOP / TABLET LANDSCAPE
   (okraje 32px + 32px)
   ========================================================= */
@media (max-width: 1199px) {
  :root {
    --main-width: min(1040px, calc(100vw - 80px));
  }

    .main-header > :first-child {
        flex: 0 0 100%;
        display: flex;
        justify-content: center;
    }

    .raabe-select {
        width: 150px;
    }

    .product-item > :first-child {
        justify-content: start;
        flex-direction: column;
        align-items: start;
    }

    .product-item > :nth-child(3) a {
      margin-bottom: 12.5px !important;
    }

    .dashboard-left {
      width: 60%;
    }

    .ai-product-left {
        width: 40%;
    }

    .ai-product-right {
        width: 60%;
    }

    .ai-product-container.is-swapped .ai-product-right {
      width: 40%;
    }

  .ai-product-container.is-swapped .ai-product-left {
      width: 60%;
  }

}


/* =========================================================
   ≤ 1023 px — TABLET (PORTRAIT)
   (okraje 24px + 24px)
   ========================================================= */
@media (max-width: 1023px) {
  :root {
    --main-width: min(900px, calc(100vw - 80px));
  }

    .main-header > :first-child {
        flex: 0 0 100%;
        display: flex;
        justify-content: center;
    }

    .header-product-switcher {
        flex: 0 0 100%;
        display: flex;
        justify-content: center;
        order: 4;
    }

    .raabe-select {
        width: 250px;
    }

    .flex-between-center {
        gap: calc(var(--gap) / 1.5);
    }

    .slide,
    .slide-content {
        height: 265px;
    }

    .slide-content h2 {
        font-weight: normal;
        font-size: 1.4rem;
        line-height: 1.6rem;
        margin-bottom: 0.5rem;
    }

    .slide-content a {
        margin-bottom: 0;
    }

    div#front-ai-chat-window {
        width: 100%;
    }

    .front-chat {
        height: 100dvh;
        min-height: auto;
        gap: calc(var(--gap) / 2);
        padding: 1rem;
    }

    div#front-ai-chat-window {
        height: calc(100dvh - 170px);
    }

    .hero-video {
      flex-direction: column;
    }

    .ako-ziskat-pristup {
      flex-wrap: wrap;
    }

    .ako-ziskat-pristup > * {
      width: 100%;
    }

    .dashboard-wrapper {
      flex-wrap: wrap;
      flex-direction: column-reverse;
    }

    .dashboard-wrapper > * {
      width: 100%;
    }

    .ai-fade {
        height: calc(100dvh - 288px);
    }

    .product-articles-tree {
      max-height: calc(100dvh - 370px);
    }

    .ai-product-left h3 {
        font-size: 1.2rem;
    }
}

/* =========================================================
   ≤ 920 px — LARGE MOBILE
   ========================================================= */
@media (max-width: 920px) {
  .slideshow-container,
  .dots-container {
    display: none;
  }

  .product-item {
    width: calc(50% - 12.5px);
  }

  .flex-between-equal > * {
    flex: auto;
   }

   .footer-menu-2-container {
    display: none;
   }

   .column {
     flex-direction: column;
    }
    
    .column > * {
      width: 100% !important;
   }

   .offer-hero .right {
    display: none;
   }

   .autori-hero > :nth-child(2) {
    display: none;
   }

   .autor-link-box {
    flex: 0 0 calc((100% - (2 * var(--gap))) / 3);
    margin: 0;
   }

   .authors-list-simple {
    column-count: 3;
   }

  .client-login-form-width {
      width: 300px;
  }

  .faichat-meta-time {
    display: none;
  }

  .ai-product-left h3 {
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
    }

  .ai-fade {
    height: calc(100dvh - 259px);
  }

  .product-articles-tree {
      max-height: calc(100dvh - 320px);
  }

  .chat-subscribe {
    font-size: 0.65rem;
    line-height: 0.8rem;
  }
}


/* =========================================================
   ≤ 767 px — LARGE MOBILE
   (okraje 20px + 20px)
   ========================================================= */
@media (max-width: 775px) {
  :root {
    --main-width: calc(100vw - 80px);
  }

  .main-header > :first-child {
    flex: 0 0 50%;
    justify-content: left;
    order: 0;
  }

  #menu-prave-menu {
    order: 1;
  }

  #menu-hlavne-menu {
    flex-wrap: wrap;
    width: 100%;
    order: 2;
  }

  .footer {
    flex-wrap: wrap;
  }

  .footer-column-4 {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
  }

    .footer-column-1 {
        display: flex;
        gap: 24px;
        align-items: start;
        flex-wrap: wrap;
    }

    .footer-column-1 > :first-child {
        width: 100%;
        text-align: center;
        display: flex;
        justify-content: center;
    }

    .footer-column-1 > :nth-child(2) {
        margin: 0;
    }

    .footer-menu-1 {
        display: flex;
        flex-wrap: wrap;
        gap: 12.5px;
        margin-left: 0;
    }

    .footer-menu-1 > * {
        width: calc(33.33% - 12.5px);
    }

    .footer-column-2 {
        border-top: 1px solid var(--color-text-light);
        padding: 25px 0;
        border-bottom: 1px solid var(--color-text-light);
    }

    .footer-column-3 {
        display: none;
    }

    .footer-column-2,
    .footer-column-4 {
        margin-top: 0;
    }

    .ako-ziskat-pristup > :nth-child(2) {
      flex-wrap: wrap;
    }

    .ako-ziskat-pristup > :nth-child(2) > * {
      width: calc(50% - var(--gap));
    }

    .product-content,
    .product-hero {
      flex-direction: column;
    }

    .product-content > *,
    .product-hero > * {
      width: 100%;
      justify-content: start;
    }

    .autor-link-box {
      flex: 0 0 calc((100% - (var(--gap))) / 2);
    }

    .authors-list-simple {
      column-count: 2;
    }

    .autor-hero {
      flex-wrap: wrap;
    }
    
    .autor-hero > * {
      width: 100%;
    }

    .spoluautor {
      display: none;
    }

    .kontaktny-formular {
      padding-bottom: 0;  
    }

    .kontaktny-formular > * {
      width: 100%;
    }

    .right-kontakt {
      padding: var(--gap) 0;
      padding-bottom: 0;
    }

    #moja-kniznica > :first-child {
      padding-top: 0;
    }

    .ai-product-container {
      width: 100dvw;
      overflow: hidden; 
    }

    .ai-product-container > * {
      display: flex;
      width: 200dvw;           
      /* transform: translateX(calc(-100dvw - -2.4rem)); */
      transition: transform 260ms ease;
    }

    .ai-product-left,
    .ai-product-right {
        width: calc(100dvw - 4rem);
        flex: 0 0 calc(100dvw - 4rem);
        box-sizing: border-box;
    }

    .ai-product-left {
      opacity: 0;
    }

    .ai-product-left h3 {
      max-width: none;
    }

    .product-ai-chat-header {
      display: none;
    }

    .ai-product-container {
      height: calc(100dvh - 175px);
    }

    .product-ai-chat-wrapper {
      max-height: calc(100% - -5px);
    }

    .ask {
      width: 100%;
    }

    .product-ai-chat-footer,
    .chat-subscribe {
      display: none;
    }

    .workspace-switch {
        display: flex;
        gap: var(--gap);
        margin-bottom: 2rem;
        width: 100%;
        padding: 0 2rem;
    }

    .workspace-switch > * {
        width: calc(50% - (var(--gap) / 2));
    }

    .workspace-switch > .is-active {
       background-color: var(--color-web-bg);
       color: var(--color-text-dark);
       border-color: var(--color-text-dark);
    }

    .maximize {
      display: none;
    }
}


/* =========================================================
   ≤ 630 px — HAMBURGER MENU START
   ========================================================= */

@media (max-width: 660px) {
  /* hamburger zapnutý */
  .menu-hamburger {
    display: flex;
    width: 32px;
    height: 24px;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
  }

  .menu-hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background: var(--color-text-light);
    border-radius: 2px;
    transition: all 0.3s ease;
  }

  /* menu defaultne skryté */
  .main-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: 16px;
  }

  /* checkbox ovláda menu */
  .menu-toggle:checked + .menu-hamburger + .main-menu {
    display: flex;
  }

  /* animácia na X */
  .menu-toggle:checked + .menu-hamburger span:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
  }

  .menu-toggle:checked + .menu-hamburger span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle:checked + .menu-hamburger span:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
  }

  .header-product-switcher {
    flex: auto;
    display: flex;
    justify-content: center;
    order: 1;
  }

  .main-header > :first-child {
    flex: auto;
  }

   .raabe-select {
        width: 180px;
   }

   .main-header {
        align-items: center;
    }

    .main-header > :first-child {
        flex: unset;
    }

    .menu-item {
        width: 100%;
        text-align: center;
    }

    ul.main-menu > :first-child a {
        background-position: center;
    }

    ul.main-menu li a {
        width: 100%;
        display: block;
        padding: 0.5rem;
        font-size: 1rem;
        border: 1px solid grey;
        border-radius: 8px;
        padding: 0.5rem 0;
    }

    ul.main-menu li a:hover, ul.main-menu li.current-menu-item a {
        border: 1px solid yellow;
    }

    .product-item {
        width: 100%;
    }

    .product-item > :first-child {
        justify-content: start;
        flex-direction: row;
        align-items: center;
    }

    .home-first-chunk {
        padding-top: 0;
        gap: 0;
        flex-wrap: wrap;
    }

    .front-chat {
        height: 100dvh;
    }

    .front-chat h2 {
        font-size: 1rem;
        line-height: 1.2rem;
    }

    .percent-70 {
        width: 100%;
    }

    .footer-row {
        padding: 20px 40px;
    }

    .front-ai-chat-window.is-visible {
        width: 100%;
        height: 100%;
        max-height: calc(100dvh - 220px);
    }

    .faichat-bubble.faichat-bubble--user.is-visible {
        width: calc(100%);
    }

    .footer-column-1 {
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .contact-form > :first-child {
      flex-wrap: wrap;
      flex: 0 0 100%;
    }

    .navod-content-common-row-wrapper {
      display: none;
    }

    .dashboard-conv-delete {
      display: flex;
      align-items: center;
    }
    
    .dashboard-conv-delete img {
      width: 18px;
      max-width: none;
    }

    .dashboard-history__left {
      width: calc(60% - (var(--gap) / 2));
    }

    /* --------- navody ---------- */
      /* button sa zobrazí */
  .toc-btn{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--color-text-dark);
    border-radius: 10px;
    padding: 10px 12px;
    background: transparent;
    color: inherit;
    cursor: pointer;
  }

  /* pravá časť full */
  .navod-content{
    width: 100%;
  }

  /* drawer (tvoj ľavý stĺpec .percent-30) */
  #navody-drawer{
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: min(86vw, 360px);
    background: var(--color-web-bg); /* alebo tvoj panel bg */
    z-index: 9999;

    /* aby sa dalo scrollovať menu */
    overflow: auto;

    /* animácia */
    transform: translateX(-105%);
    transition: transform 220ms ease;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);

    /* padding aby to vyzeralo */
    padding: 16px;
  }

  /* otvorený stav */
  #navody-drawer.is-open{
    transform: translateX(0);
  }

  /* overlay */
  .drawer-overlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9998;
  }

  .article ul, .article ol {
    padding: 0 0rem;
  }

  .article {
    padding: 1rem;
  }
}


/* =========================================================
   ≤ 575 px — MOBILE
   ========================================================= */
@media (max-width: 575px) {
  :root {
    --main-width: calc(100vw - 60px);
  }

  .header-product-switcher {
        width: 100%;
        order: 3;
    }

  .raabe-select {
        width: 100%;
    }

    .front-chat {
        height: 100dvh;
        padding: 0;
    }

    .faichat-avatar {
        width: 50px;
    }

    .ask button {
        width: 40px;
    }

    #ask-input {
        width: auto;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 90%;
    }

    #front-ai-chat-window {
        max-height: calc(100dvh - 120px);
    }

    .product-item > :first-child {
        flex-direction: column;
        justify-content: start;
        align-items: start;
    }

    .gallery-column {
      flex-direction: column;
    }

    .ako-ziskat-pristup > :nth-child(2) > * {
      width: 100%;
    }

    .autor-link-box {
      flex: 0 0 100%;
    }

    .authors-list-simple {
      column-count: 1;
    }

    h1, .h1-like {
      font-size: 2.325rem;
      line-height: 2.5rem;
    }

  .raabe-client-login__notice,
  .client-login-form-width {
      width: calc(100% - 80px);
  }

  .dashboard-history__actions {
      flex-direction: column;
      justify-content: flex-start;
  }

  .dashboard-history__actions {
    width: calc(40% - (var(--gap) / 2));
  }

  .product-chat-history__delete {
    display: none;
  }

}


/* =========================================================
   Mobile landscape
   ========================================================= */

@media (max-width: 900px) and (max-height: 600px) {

  .ai-fade {
    height: calc(100dvh - 103px) !important;
}

  .ai-product-container {
    height: calc(100dvh - -10px) !important;
  }

  .product-articles-tree {
    max-height: calc(100dvh - 160px) !important;
  }

  .ai-article-body {
    font-size: 0.875rem !important;
  }

}
