/**
 * shop-modern – pouze @media pravidla (doplňuje shop-modern.css; načítat hned za ním).
 * Proměnné :root zůstávají v shop-modern.css.
 */

@media (min-width: 769px) {
  /* Flex místo float + % — jinak min-width na #left + 76 % #content přetéká (769–~970px) a obsah spadne pod menu */
  #page {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    column-gap: 0.65rem;
  }

  #page > .default {
    display: contents;
  }

  #left {
    float: none;
    flex: 0 0 clamp(11rem, 26%, 22rem);
    width: auto;
    max-width: 22rem;
    min-width: 0;
  }

  #content {
    float: none;
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    max-width: none;
  }

  #page > .cb {
    flex: 0 0 100%;
    width: 100%;
    clear: both;
  }
}

@media (max-width: 900px) {
  body.eshop-modern .regForm-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

}

@media (max-width: 520px) {
  body.eshop-modern .regForm {
    --reg-cols: 1fr;
  }

  body.eshop-modern .regForm .inputRow--compound .inputLabel {
    padding-top: 0;
    grid-column: 1;
    grid-row: 1;
  }

  body.eshop-modern .regForm .inputRow--compound .inputRow__fields {
    grid-column: 1;
    grid-row: 2;
    max-width: 100%;
  }

  body.eshop-modern .regForm-dic-block {
    grid-template-columns: 1fr;
  }

  body.eshop-modern .regForm-dic-block .regForm-loadVies {
    grid-column: 1;
  }

  body.eshop-modern .regForm-dicRow__controls {
    flex-direction: column;
    align-items: stretch;
  }

  body.eshop-modern .regForm-dicRow__controls .regForm-vat-btn {
    width: 100% !important;
    white-space: normal;
  }

  .catPrev {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  #items {
    gap: 0.85rem;
  }
}

@media (max-width: 960px) {
  .catPrev {
    gap: 1rem;
  }

  #items {
    gap: 1rem;
  }

  /* Úzká okna: hledání pod řádkem menu, plná šířka do max. šířky — bez překryvu odkazů */
  body.eshop-modern #menubar .innerBar {
    padding-right: 0;
  }

  body.eshop-modern #search.eshop-search--menubar {
    position: static;
    transform: none;
    align-self: stretch;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0.35rem;
    width: calc(100% - 1.25rem);
    max-width: min(22rem, calc(100% - 1.25rem));
    box-sizing: border-box;
  }

  body.eshop-modern #search.eshop-search--menubar .text {
    max-width: none;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }

  /* Detail produktu: galerie nad textem */
  body.eshop-modern .detail.detail-product .detail-productGallery {
    float: none;
    width: 100%;
    max-width: 100%;
    margin-right: 0;
    margin-bottom: 1rem;
  }

  body.eshop-modern .detail.detail-product .detail-productTopHead .detail-productHead,
  body.eshop-modern .detail.detail-product .detail-productTopHead .detail-productTopBuy {
    float: none;
    clear: none;
    max-width: none;
    width: 100%;
  }

  body.eshop-modern .detail.detail-product .detail-productTopBuy .priceBuy-inner {
    align-items: stretch;
  }

  body.eshop-modern .detail.detail-product .priceBuy-inner {
    align-items: stretch;
  }

  body.eshop-modern .detail.detail-product .priceRow {
    justify-content: flex-start;
  }

  body.eshop-modern .detail.detail-product .detail-desc > h2:first-child,
  body.eshop-modern .detail.detail-product .detail-longHtml > h2:first-child {
    padding-right: 0;
  }

  body.eshop-modern .detail.detail-product .detail-desc > h2 + .fr10,
  body.eshop-modern .detail.detail-product .detail-longHtml > h2 + .fr10 {
    float: none;
    margin-top: 0.35rem !important;
    max-width: 100%;
    text-align: left;
  }

}

/* Zarovnání s mobile.css (max-width: 480px): #content h1 22px, globální h2/h3 — zmenšení na 75 % */
@media screen and (max-width: 480px) {
  body.eshop-modern #content h1:not(.eshop-page-heading) {
    font-size: calc(22px * 0.75);
  }

  body.eshop-modern #content h2:not(.eshop-page-heading) {
    font-size: calc(18px * 0.75);
  }

  body.eshop-modern #content h3 {
    font-size: calc(16px * 0.75);
  }

  body.eshop-modern #content #items .item h3 {
    font-size: 12pt;
  }
}
