/* Opt-in tablet flow. Figma 793:6068 footer / 793:6192 header.
 * Only complete tablet modules may enable body.tablet-flow. */
@media (min-width: 431px) and (max-width: 860px) ,  (width > 430px) and (max-width: 860px) {
  /* Scale the 860px Figma canvas proportionally at narrower tablet widths.
     At 860px zoom = 1 (pixel-accurate); at 431–859px it scales down so that
     every element keeps the 860px layout intact. */
  html:has(body.tablet-flow) { zoom: var(--paola-root-zoom, calc(100vw / 860px)); zoom: calc(100vw / 860px); }
  html:has(body.tablet-flow.fluid-flow) { zoom: 1; }
  body.tablet-flow { width: 100%; min-width: 0; --tablet-gutter: 50px; }
  body.tablet-flow .site-header {
    position: fixed; top: max(20px, env(safe-area-inset-top)); left: 0; right: 0;
    width: 100%; max-width: none; padding: 0 20px; transform: none;
    pointer-events: none;
  }
  body.tablet-flow .site-header .header-inner {
    width: 100%; max-width: none; min-height: 45px; height: auto; padding: 0;
    margin: 0; background: transparent; box-shadow: none; backdrop-filter: none;
    pointer-events: none;
  }
  /* The compact header has no full-width surface. Only its controls and
     opened navigation should intercept taps; underlying back links remain live. */
  body.tablet-flow .site-header .header-right,
  body.tablet-flow .site-header.is-open .header-nav { pointer-events: auto; }
  body.tablet-flow .site-header :is(.header-logo, .socials) { display: none; }
  body.tablet-flow .site-header .header-right {
    margin-left: auto; gap: 14px;
    filter: drop-shadow(4px 4px 2px rgba(70,59,47,.25));
  }
  body.tablet-flow .site-header .cart-btn {
    display: flex; flex-direction: row-reverse; justify-content: space-between;
    width: 146px; min-height: 45px; height: 45px; padding: 0; flex-shrink: 0;
    border: 1px solid rgba(255,246,237,.6); color: #fff6eb; background: rgba(64,28,12,.6);
    box-shadow: none; backdrop-filter: blur(4.5px); -webkit-backdrop-filter: blur(4.5px);
  }
  body.tablet-flow .site-header .cart-icon-wrap { width: 44px; height: 44px; background: #fff6eb; }
  body.tablet-flow .site-header .cart-icon { width: 25px; height: 19.117px; }
  body.tablet-flow .site-header .cart-icon path { fill: url(#paola-cart-icon-gradient); stroke: none; }
  body.tablet-flow .site-header .cart-price { display: block; flex: 1; text-align: center; color: #fff6eb; font-size: 16px; }
  body.tablet-flow .site-header .cart-count { top: 26px; right: -8px; left: auto; width: 19px; height: 19px; transform: none; background: #b01e2b; color: #fff6eb; border: 1px solid #fff6eb; }
  body.tablet-flow .site-header .nav-burger {
    width: 44px !important; height: 44px !important; flex-basis: 44px !important;
    gap: 4.3333px; background: linear-gradient(180deg,#fff6ed 0%,#f8eadc 100%); box-shadow: none;
  }
  body.tablet-flow .site-header .nav-burger span {
    position: relative; top: .8333px; width: 18.6667px; height: 1px; border-radius: 999px;
    background: linear-gradient(180deg,#da1b2c 0%,#9d1f2a 100%);
  }
  /* Снято «width:100vw; height:100dvh»: под zoom вьюпортные единицы считаются
     от сырого окна, а не от канвы 860, поэтому шторка не добирала до краёв.
     База в main.style.css кроет вьюпорт через position:fixed + inset:0 —
     этого достаточно на любой ширине полосы. */
  /* 330px по макету, как и на телефоне: узел планшетной шторки в Figma не
     размечен, но базовое правило для всей полосы <=860 задаёт именно 330. */
  body.tablet-flow .site-header .nav-menu-panel { width: min(330px, 86%); min-width: 0; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; }
  body.tablet-flow .site-header .sub-menu { position: static; display: none; min-width: 0; width: 100%; margin: 12px 0 0; padding: 0 0 0 12px; background: transparent; box-shadow: none; opacity: 1; visibility: visible; transform: none; }
  body.tablet-flow .site-header .menu-item-has-children.is-expanded > .sub-menu { display: block; }
  body.tablet-flow .site-header .sub-menu a { white-space: normal; min-height: 44px; display: flex; align-items: center; }

  body.tablet-flow .site-footer { width: 100%; height: auto; min-height: 634px; }
  body.tablet-flow .site-footer .footer-inner {
    display: flex; flex-direction: column; width: 100%; max-width: 860px;
    height: auto; min-height: 634px; margin: 0 auto;
    padding: 71px var(--tablet-gutter) 50px;
  }
  body.tablet-flow .site-footer .footer-logo-svg {
    position: relative; inset: auto; flex: none; width: 100%; max-width: none;
    height: auto; aspect-ratio: 760 / 126.733; margin: 0;
  }
  body.tablet-flow .site-footer .footer-logo { position: absolute; inset: 0; width: 100%; height: 100%; }
  body.tablet-flow .site-footer .footer-columns {
    position: static; display: grid; grid-template-columns: minmax(0,152.3125fr) minmax(0,238.6875fr) 176px;
    gap: 34px 73px; width: 100%; max-width: 713px; height: auto; margin: 65.267px 0 0;
  }
  body.tablet-flow .site-footer :is(.footer-col-nav,.footer-col-buttons,.footer-col-contact) {
    position: static; inset: auto; width: auto; min-width: 0; height: auto; margin: 0;
  }
  body.tablet-flow .site-footer .footer-col-nav { display: flex; flex-direction: column; gap: 18px; }
  body.tablet-flow .site-footer .footer-col-nav a { font-size: 12px; line-height: 1.2; white-space: normal; }
  body.tablet-flow .site-footer .footer-col-buttons { grid-column: 3; grid-row: 1; display: flex; flex-direction: column; gap: 26px; }
  body.tablet-flow .site-footer .footer-social-row { display: flex; flex-wrap: wrap; gap: 8px; }
  body.tablet-flow .site-footer .footer-social-item { width: 38px; height: 38px; flex: 0 0 38px; }
  body.tablet-flow .site-footer .footer-social-item img { width: 58px; height: 58px; max-width: none; transform: translate(2px,2px); }
  body.tablet-flow .site-footer .footer-social-item:nth-child(1) img { content: url('../../img/footer-phone-max.svg'); }
  body.tablet-flow .site-footer .footer-social-item:nth-child(2) img { content: url('../../img/footer-phone-tg.svg'); }
  body.tablet-flow .site-footer .footer-social-item:nth-child(3) img { content: url('../../img/footer-phone-inst.svg'); }
  body.tablet-flow .site-footer .footer-social-item:nth-child(4) img { content: url('../../img/footer-phone-call.svg'); }

  /* Соцсети в шторке меню — как в подвале на планшете. */
  body.tablet-flow .site-header .nav-mobile-footer__socials a { display: flex; align-items: center; justify-content: center; flex: 0 0 38px; width: 38px; height: 38px; line-height: 0; }
  body.tablet-flow .site-header .nav-mobile-footer__socials img { width: 58px; height: 58px; max-width: none; transform: translate(2px, 2px); }
  body.tablet-flow .site-header .nav-mobile-footer__socials a:nth-child(1) img { content: url('../../img/footer-phone-max.svg'); }
  body.tablet-flow .site-header .nav-mobile-footer__socials a:nth-child(2) img { content: url('../../img/footer-phone-tg.svg'); }
  body.tablet-flow .site-header .nav-mobile-footer__socials a:nth-child(3) img { content: url('../../img/footer-phone-inst.svg'); }
  body.tablet-flow .site-header .nav-mobile-footer__socials a:nth-child(4) img { content: url('../../img/footer-phone-call.svg'); }
  body.tablet-flow .site-footer .footer-col-buttons .btn { width: 176px; max-width: 100%; min-width: 0; min-height: 46px; font-size: 12px; letter-spacing: .36px; }
  body.tablet-flow .site-footer .footer-col-contact { grid-column: 3; grid-row: 2; padding: 0 5px; font-size: 12px; line-height: 1.42; }
  body.tablet-flow .site-footer :is(.footer-col-contact__label,.footer-col-contact__phone) { line-height: 1.2; margin: 0 0 19px; }
  /* [47].1 контакты кликабельны — цвет наследуется. */
  body.tablet-flow .site-footer .footer-col-contact a { color: inherit; text-decoration: none; }
  body.tablet-flow .site-footer .footer-col-contact a:hover { text-decoration: underline; }
  body.tablet-flow .site-footer .footer-col-contact__address { margin: 0; width: max-content; max-width: calc(100% + 10px); }
  body.tablet-flow .site-footer .footer-divider { position: static; width: 100%; height: .5px; margin: 32px 0 0; background: rgba(176,30,43,.5); }
  body.tablet-flow .site-footer .footer-legal { position: static; display: grid; grid-template-columns: minmax(0,1fr) minmax(min-content,129px); gap: 20px; width: 100%; margin: 18.5px 0 0; padding: 0; align-items: end; }
  body.tablet-flow .site-footer .footer-legal-main { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 4px 12px; width: 100%; min-width: 0; }
  body.tablet-flow .site-footer .footer-legal-main span:nth-child(3) { grid-column: 1 / -1; width: auto; }
  body.tablet-flow .site-footer .footer-legal-main span { text-align: left; }
  /* Keep wrapped footer text readable when WebKit enforces its minimum font under root zoom. */
  body.tablet-flow .site-footer .footer-legal :is(span,a) { font-size: 9px; line-height: 1.25; white-space: normal; }
  body.tablet-flow .site-footer .footer-legal > a { width: 100%; text-align: right; overflow-wrap: normal; }
}
/* Снят подбрейкпоинт «@media (min-width: 431px) and (max-width: 700px)»: полоса 431–860 показывает один макет 860, разницу делает zoom. */

/* Fluid routes keep two footer columns until the 713px tablet column group
   fits between the authored 50px side gutters. */
@media (min-width: 431px) and (max-width: 812px) , (width > 430px) and (max-width: 812px){
  body.tablet-flow.fluid-flow .site-footer .footer-columns {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 33px 22px;
    width: 100%;
    max-width: none;
  }
  body.tablet-flow.fluid-flow .site-footer .footer-col-nav { gap: 16px; }
  body.tablet-flow.fluid-flow .site-footer .footer-col-buttons {
    grid-column: 2;
    grid-row: 2;
    gap: 22px;
    margin-left: -1px;
  }
  body.tablet-flow.fluid-flow .site-footer .footer-col-contact {
    grid-column: 1;
    grid-row: 2;
    margin-top: 0;
    padding: 0;
  }
}

@media (min-width: 431px) and (max-width: 680px) ,  (width > 430px) and (max-width: 680px) {
  body.tablet-flow.fluid-flow { --tablet-gutter: 25px; }
  body.tablet-flow.fluid-flow .site-footer,
  body.tablet-flow.fluid-flow .site-footer .footer-inner { min-height: 553px; }
  body.tablet-flow.fluid-flow .site-footer .footer-inner {
    box-sizing: border-box;
    padding: 76px var(--tablet-gutter) 30px;
  }
  body.tablet-flow.fluid-flow .site-footer .footer-logo-svg {
    width: 100%;
    aspect-ratio: 382 / 64;
  }
  body.tablet-flow.fluid-flow .site-footer .footer-columns { margin-top: 42px; }
  body.tablet-flow.fluid-flow .site-footer .footer-col-contact { margin-top: 9px; }
  body.tablet-flow.fluid-flow .site-footer .footer-divider {
    max-width: none;
    margin-top: 40px;
  }
  body.tablet-flow.fluid-flow .site-footer .footer-legal {
    grid-template-columns: minmax(0, 1fr) 106px;
    gap: 16px;
    max-width: none;
    margin-top: 26.5px;
  }
}

/* Short landscape viewports scroll past the compact header, so it cannot cover section titles. */
@media (orientation: landscape) and (max-height: 400px) and (max-width: 1199px) ,  (orientation: landscape) and (max-height: 400px) and (width < 1200px) {
  body.phone-flow .site-header,
  body.tablet-flow .site-header { position: absolute; }
}

