/* ===== Версия для слабовидящих =====
   Кнопка-лупа #a11y-fab (всегда) + увеличенная версия сайта (только при html.a11y-on).
   Каждое правило режима начинается с html.a11y-on — без этого класса обычный вид сайта не меняется ни на пиксель.
   Включается и выключается лупой (assets/js/a11y.js), выбор хранится в localStorage (lg_a11y). */

/* --- Кнопка-лупа (положение, высота и размер значка задаёт <style id="a11yFabStyle"> из админки) ---
   Пилюля: значок + подпись «Версия для слабовидящих». Подпись раскрыта при первом заходе, при наведении/фокусе и на несколько секунд
   после переключения; в остальное время кнопка — компактный значок и никому не мешает. Крестик скрывает кнопку насовсем (lg_a11y_hidden). */
#a11y-fab {
    position: fixed;
    left: 16px;
    bottom: 68px;
    height: 44px;
    z-index: 940;
    display: flex;
}
html.a11y-fab-off #a11y-fab { display: none !important; }
#a11y-fab .a11y-btn {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #202125;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}
#a11y-fab .a11y-btn:active { transform: scale(0.97); }
#a11y-fab .a11y-btn:focus-visible { outline: 3px solid #ffb400; outline-offset: 2px; }
#a11y-fab .a11y-btn[aria-pressed="true"] { background: #ffb400; color: #000; border-color: #000; }
#a11y-fab .a11y-ico {
    height: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex: 0 0 auto;
}
#a11y-fab .a11y-label {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    transition: max-width 0.35s ease, opacity 0.25s ease, padding 0.35s ease;
}
#a11y-fab.is-open .a11y-label,
#a11y-fab .a11y-btn:hover .a11y-label,
#a11y-fab .a11y-btn:focus-visible .a11y-label {
    max-width: 240px;
    opacity: 1;
    padding: 0 14px 0 2px;
}
/* у правого края (сторона задаётся в админке) правила для раскрытия подписи влево добавляет <style id="a11yFabStyle"> */
/* крестик «скрыть»: маленький значок на углу кнопки; пока включена увеличенная версия — не показывается (иначе можно «застрять» в ней) */
#a11y-fab .a11y-close {
    position: absolute;
    top: -9px;
    right: -9px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid #8a8f98;
    border-radius: 50%;
    background: #fff;
    color: #202125;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
#a11y-fab .a11y-close:focus-visible { outline: 3px solid #ffb400; outline-offset: 1px; }
html.a11y-on #a11y-fab .a11y-close { display: none; }

/* ссылка в подвале, чтобы вернуть скрытую кнопку */
.a11y-restore {
    margin-left: 10px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: #8a8f98;
    text-decoration: underline;
    cursor: pointer;
}
.a11y-restore:hover { color: #0052cc; }
.a11y-restore[hidden] { display: none; }

/* --- Увеличенная версия --- */
html.a11y-on { --a11y-zoom: 1.3; }
@media (max-width: 767px) { html.a11y-on { --a11y-zoom: 1.2; } }

/* Масштаб всей страницы (свойство zoom): размеры в px растут, проценты по-прежнему считаются от ширины экрана — страница перестраивается как при увеличении в браузере, без горизонтальной прокрутки. */
html.a11y-on body {
    zoom: var(--a11y-zoom);
    line-height: 1.55;
    letter-spacing: 0.01em;
    word-spacing: 0.04em;
}

/* Контраст: серые поясняющие тексты становятся почти чёрными (цвета на тёмных подложках не трогаем) */
html.a11y-on .product-description,
html.a11y-on .product-old-price,
html.a11y-on .product-price-original,
html.a11y-on .cart-item-price-original,
html.a11y-on .delivery-time-group label,
html.a11y-on .nav-item,
html.a11y-on .more-text small,
html.a11y-on .consent-label,
html.a11y-on .milestone-text,
html.a11y-on .progress-status,
html.a11y-on .social-proof-toast .sp-label,
html.a11y-on .social-proof-toast .sp-time,
html.a11y-on .seo-links-col a,
html.a11y-on .reviews-count,
html.a11y-on .wr-modal-box p,
html.a11y-on .product-crumbs,
html.a11y-on .product-page-desc,
html.a11y-on .product-page-price .pp-note,
html.a11y-on .product-page-meta,
html.a11y-on .location-content-inner,
html.a11y-on .pwa-banner-sub,
html.a11y-on .lg-notify-sub,
html.a11y-on .oh-k,
html.a11y-on .oh-receipt-row span,
html.a11y-on .oh-receipt-note,
html.a11y-on .ideas-lead,
html.a11y-on .ideas-tab,
html.a11y-on .ideas-hint,
html.a11y-on .ideas-empty,
html.a11y-on .ref-progress-head span,
html.a11y-on .ref-expiry,
html.a11y-on .dev-credit a,
html.a11y-on #modal p,
html.a11y-on #promo-modal-price .pm-note,
html.a11y-on #promo-modal-price .pm-old {
    color: #14161a;
}
html.a11y-on .phone-input::placeholder { color: #4b5058; opacity: 1; }

/* Ссылки в текстовых блоках подчёркнуты, чтобы их было видно без различения цвета */
html.a11y-on .seo-links-col a,
html.a11y-on .docs-menu a,
html.a11y-on .consent-text a,
html.a11y-on .dev-credit a,
html.a11y-on .product-crumbs a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Заметный фокус при работе с клавиатуры */
html.a11y-on a:focus-visible,
html.a11y-on button:focus-visible,
html.a11y-on input:focus-visible,
html.a11y-on select:focus-visible,
html.a11y-on textarea:focus-visible,
html.a11y-on [tabindex]:focus-visible {
    outline: 3px solid #000;
    outline-offset: 2px;
    box-shadow: 0 0 0 5px #ffb400;
}

/* Поля ввода читаются легче: рамка потемнее */
html.a11y-on input[type="text"],
html.a11y-on input[type="tel"],
html.a11y-on input[type="email"],
html.a11y-on input[type="number"],
html.a11y-on select,
html.a11y-on textarea {
    border-color: #4b5058;
}

/* Телефон, вид товаров «сетка 2 в ряд»: в увеличенной версии — одна колонка, текст без обрезки, крупнее */
@media (max-width: 767px) {
    html.a11y-on body.pmobile-grid .items { grid-template-columns: 1fr; gap: 14px; }
    html.a11y-on body.pmobile-grid .product-image-container { height: 180px; min-height: 180px; }
    html.a11y-on body.pmobile-grid .product-title,
    html.a11y-on body.pmobile-grid .product-title-link { font-size: 16px; line-height: 1.3; }
    html.a11y-on body.pmobile-grid .product-title { display: block; -webkit-line-clamp: unset; overflow: visible; }
    html.a11y-on body.pmobile-grid .product-description { font-size: 14px; line-height: 1.45; display: block; -webkit-line-clamp: unset; overflow: visible; }
    html.a11y-on body.pmobile-grid .product-price-container,
    html.a11y-on body.pmobile-grid .product-price-original,
    html.a11y-on body.pmobile-grid .product-price-discounted,
    html.a11y-on body.pmobile-grid .product-price { font-size: 17px; }
    html.a11y-on body.pmobile-grid .add-to-cart-button { width: 44px; height: 44px; font-size: 20px; }
}
