/* Защитный слой: правила, которые «свой дизайн» владельца не может переопределить. Слои каскада: critical, theme, custom.
   У деклараций с !important порядок слоёв обратный: ранний слой выигрывает, поэтому даже `display:none !important` из
   custom.css не спрячет эти элементы. Здесь только то, без чего витрина перестаёт быть честной: корзина и оплата,
   кнопки «в заявку», цена, согласие на обработку данных, номер заявки, знак УП.Среды в подвале. Внешний вид
   (цвета, шрифты, размеры, рамки, поворот меток) остаётся полностью в руках владельца. */
@layer critical, theme, custom;
@layer critical {
  /* атрибут hidden управляет корзиной и формами: его нельзя ни снять, ни навязать */
  [hidden] { display: none !important; }

  /* панель корзины: всегда на самом верху, не прозрачная, не сдвинутая и не спрятанная (пока скрипт её не скрыл) */
  .cartbar:not([hidden]) { display: block !important; visibility: visible !important; opacity: 1 !important;
    position: fixed !important; left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important;
    z-index: 2147483647 !important; transform: none !important; clip-path: none !important; filter: none !important;
    pointer-events: auto !important; height: auto !important; max-height: none !important; overflow: visible !important; }
  .cartbar:not([hidden]) .cb-in, .cartbar:not([hidden]) .cb-info { display: flex !important; }
  .cartbar:not([hidden]) * { visibility: visible !important; opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .cartbar:not([hidden]) .cb-info b, .cartbar:not([hidden]) .cb-sum { display: inline !important; }

  /* кнопки: «+» в заявку, оплата, отправка заявки, «Я оплатил(а)», связь с продавцом */
  .btn:not([hidden]) { display: inline-flex !important; visibility: visible !important; opacity: 1 !important;
    pointer-events: auto !important; min-height: 32px !important; min-width: 32px !important; max-width: none !important; max-height: none !important;
    position: relative !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important;
    transform: none !important; scale: none !important; translate: none !important; rotate: none !important; zoom: 1 !important; filter: none !important; }
  /* срезанные углы главной кнопки вологодского стиля - единственная форма, которую разрешено задать (значения фиксированы) */
  html:not(.vologda) .btn { clip-path: none !important; }
  html.vologda .btn:not(.main) { clip-path: none !important; }
  html.vologda .btn.main { clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px) !important; }
  .js .add:not([hidden]) { display: flex !important; }
  .add { visibility: visible !important; opacity: 1 !important; clip-path: none !important; pointer-events: auto !important;
    min-width: 28px !important; min-height: 28px !important; max-width: none !important; max-height: none !important;
    position: relative !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important;
    transform: none !important; scale: none !important; translate: none !important; rotate: none !important; zoom: 1 !important; filter: none !important; }

  /* цена и сумма: видны, не обрезаны и не прозрачны */
  .price, .pricebox, .pnote, .total, .i-price, .o-total, .o-lines { visibility: visible !important; opacity: 1 !important;
    clip-path: none !important; transform: none !important; scale: none !important; translate: none !important; rotate: none !important;
    filter: none !important; zoom: 1 !important; }
  .total:not([hidden]), .i-price:not([hidden]), .o-total:not([hidden]), .o-lines:not([hidden]), .line:not([hidden]), .qty:not([hidden]) { display: flex !important; }
  .price:not([hidden]) { display: inline-block !important; }
  .pricebox:not([hidden]) { display: flex !important; }
  .price::before, .price::after, .pnote::before, .pnote::after, .total .price::before, .total .price::after { content: none !important; }

  /* формы заказа и оплаты, согласие на обработку данных */
  .order-form:not([hidden]), .pay-card:not([hidden]), .steps:not([hidden]), .step:not([hidden]) { display: flex !important; }
  .order-form, .order-form .field, .check-row, .pay-card, .steps, .step { visibility: visible !important;
    opacity: 1 !important; clip-path: none !important; transform: none !important; }
  .order-form .field:not([hidden]) { display: block !important; }
  .check-row:not([hidden]) { display: flex !important; }
  .order-form .field input, .order-form .field textarea { visibility: visible !important; opacity: 1 !important; pointer-events: auto !important; }
  .check-row .check, .check-row > span:last-child { visibility: visible !important; opacity: 1 !important; clip-path: none !important;
    transform: none !important; }
  .check-row .check:not([hidden]) { display: flex !important; min-width: 16px !important; min-height: 16px !important; }
  .check-row a { visibility: visible !important; opacity: 1 !important; }
  .order-form, .check-row, #cart-lines, .step .btn, .actions { position: relative !important; z-index: 2147483000 !important; }
  /* ловушка для ботов остаётся спрятанной: человек не должен её заполнить */
  .hp { position: absolute !important; left: -10000px !important; top: auto !important; width: 1px !important; height: 1px !important;
    overflow: hidden !important; opacity: 0 !important; pointer-events: none !important; }

  /* номер заявки, строки заявки, количество */
  .num, .center .card, .line, .qty, .qty button, .qty output { visibility: visible !important; opacity: 1 !important; clip-path: none !important; }
  .num:not([hidden]) { display: block !important; }

  /* подвал: знак УП.Среды и подпись «Витрина создана в УП.Среде» - как есть, не спрятаны, не пропали в размере */
  .foot .f-main, .foot .f-text, .foot .logo-mark, .foot .logo-chip, .foot .ring { visibility: visible !important; opacity: 1 !important;
    clip-path: none !important; filter: none !important; transform: none !important; }
  .foot .f-main:not([hidden]) { display: flex !important; }
  .foot .logo-mark:not([hidden]), .foot .ring:not([hidden]) { display: block !important; min-width: 24px !important; min-height: 24px !important; }
  .foot .logo-chip:not([hidden]) { display: flex !important; }
  .foot .f-links a { visibility: visible !important; opacity: 1 !important; }

  /* псевдоэлементы корня страницы закрыты: свой CSS не может накрыть ими экран «акцией» или поддельной ценой.
     Единственное исключение - зерно бумаги стиля «Крафт», его значения заданы здесь же и не меняются */
  html::before, html::after, body::after, main::before, main::after { content: none !important; }
  html:not(.kraft) body::before { content: none !important; }
  html.kraft body::before { content: "" !important; position: fixed !important; inset: 0 !important; pointer-events: none !important;
    z-index: 60 !important; opacity: var(--grain, .8) !important; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' seed='8'/><feColorMatrix values='0 0 0 0 .30  0 0 0 0 .18  0 0 0 0 .08  0 0 0 .17 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>") !important; width: auto !important; height: auto !important;
    transform: none !important; display: block !important; }
}
