/* Общая механика трёх сайтов: экраны, галерея, состояния. Внешний вид — в theme.css каждого сайта. */
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;font-variant-numeric:tabular-nums}
button,input,select{font:inherit;color:inherit}
h1,h2,h3{margin:0}
[hidden]{display:none!important}
img{max-width:100%}

/* экраны: история заменяет каталог; заявка в каждой теме своя (колонка, шторка или страница) */
body:not([data-view="history"]) .history{display:none}
body[data-view="history"] .index,body[data-view="history"] .sheet,body[data-view="history"] .order{display:none}

.wholesale .cro-only{display:none}
.combo{position:relative}
#deliveryOptions{position:absolute;z-index:20;left:0;right:0;top:100%;margin:0;padding:0;list-style:none;max-height:260px;overflow:auto}
#deliveryOptions li{cursor:pointer}
.part summary{cursor:pointer;list-style:none}
.part summary::-webkit-details-marker{display:none}
.thumb{cursor:zoom-in;padding:0;line-height:0}
.thumb img{display:block}
.hero img{cursor:zoom-in}
.qty,.l-q{text-align:center}
.lines{width:100%;border-collapse:collapse}
.lines .rm{border:0;background:none;cursor:pointer;text-decoration:underline}
.to-order{display:none}
body.order-in-view .to-order{display:none!important}
.scrim{display:none}   /* затемнение под шторкой заявки — включает тема, где заявка выезжает поверх каталога */
.order-top .close{display:none}

/* подсказка «Добавлено» */
.toast{position:fixed;left:50%;bottom:24px;transform:translate(-50%,20px);opacity:0;pointer-events:none;z-index:60;
  transition:opacity .2s,transform .2s;max-width:calc(100vw - 32px)}
.toast.on{opacity:1;transform:translate(-50%,0)}

/* галерея — на весь экран */
.gallery{border:0;padding:0;background:transparent;max-width:none;max-height:none;width:100vw;height:100vh;margin:0}
.gallery figure{margin:0;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:56px 72px}
.gallery img{height:calc(100dvh - 150px);width:auto;max-width:100%;object-fit:contain;touch-action:pan-y}
.g-close{position:fixed;top:16px;right:20px;cursor:pointer}
.g-nav{position:fixed;top:50%;transform:translateY(-50%);width:44px;height:44px;cursor:pointer;font-size:18px}
.g-prev{left:16px}.g-next{right:16px}
@media (max-width:760px){
  .gallery figure{padding:56px 12px 24px}
  .gallery img{height:auto;max-height:calc(100dvh - 140px)}
  .g-nav{top:auto;bottom:16px;transform:none}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
/* Телефон: поля не мельче 16px — иначе iOS при вводе увеличивает страницу; кнопки и ссылки — под палец (≥40px) */
@media (max-width:760px){
  input,select,textarea{font-size:16px}
  #logout,.lines .rm,.g-close,.g-nav,.order-top .close{min-height:40px;display:inline-flex;align-items:center;justify-content:center}
  #logout,.lines .rm{padding-left:8px;padding-right:8px}
  .lines .l-q{min-height:40px;width:56px}
  #sections a{min-height:40px;align-items:center}
}
