/**
 * Исправление мелкого текста на мобильных устройствах
 * Для соответствия требованиям Яндекс Вебмастера
 */

/* Базовое увеличение размера шрифта на мобильных */
/* Используем более широкий медиа-запрос для покрытия всех мобильных устройств */
@media screen and (max-width: 1024px) {
    /* КРИТИЧНО: Перекрываем font: 80% из основного CSS */
    html body {
        font-size: 16px !important; /* Минимум 16px для читаемости */
        font: 16px/1.6 arial, sans-serif !important; /* Перекрываем font: 80% */
        line-height: 1.6 !important;
    }

    /* КРИТИЧНО: Перекрываем ВСЕ inline стили с максимальной специфичностью */
    /* Используем html body для максимального приоритета */
    html body div[style*="font-size"],
    html body span[style*="font-size"],
    html body p[style*="font-size"],
    html body td[style*="font-size"],
    html body th[style*="font-size"],
    html body li[style*="font-size"],
    html body a[style*="font-size"],
    html body [style*="font-size: small"],
    html body [style*="font-size:14px"],
    html body [style*="font-size: 14px"],
    html body [style*="font-size:12px"],
    html body [style*="font-size: 12px"] {
        font-size: 16px !important;
    }

    /* Универсальное правило для ВСЕХ элементов - устанавливаем базовый размер */
    /* Это перекрывает все мелкие размеры из основного CSS */
    /* Исключаем заголовки - у них свои размеры выше */
    html body *:not(script):not(style):not(meta):not(link):not(title):not(head):not(html):not(svg):not(path):not(i.fa):not([class*="fa-"]):not([class*="icon"]):not(h1):not(h2):not(h3):not(h4):not(h5):not(h6) {
        font-size: 16px !important;
    }

    /* Заголовки страницы товара */
    h1 {
        font-size: 24px !important;
        line-height: 1.3 !important;
        margin-bottom: 15px !important;
        font-weight: bold !important;
    }

    h2 {
        font-size: 20px !important;
        line-height: 1.4 !important;
        margin-bottom: 12px !important;
        font-weight: bold !important;
    }

    h3 {
        font-size: 18px !important;
        line-height: 1.4 !important;
        margin-bottom: 10px !important;
    }

    h4 {
        font-size: 18px !important;
        line-height: 1.4 !important;
        margin-bottom: 12px !important;
        font-weight: bold !important;
    }

    /* Артикул товара */
    .b-art__num,
    .text-muted {
        font-size: 16px !important;
        line-height: 1.5 !important;
    }

    /* Блок с товаром */
    .one-item {
        font-size: 16px !important;
    }

    /* Описание товара */
    .slaid-text .text,
    .slaid-text-right .text,
    .item_description,
    .shop_description,
    .desc-top {
        font-size: 16px !important;
        line-height: 1.6 !important;
    }

    .desc-top p {
        font-size: 16px !important;
        line-height: 1.6 !important;
        margin-bottom: 12px !important;
    }

    /* Списки характеристик */
    .slaid-text .text ul,
    .slaid-text-right .text ul,
    .item_description ul,
    .shop_description ul {
        font-size: 16px !important;
        line-height: 1.6 !important;
    }

    .slaid-text .text ul li,
    .slaid-text-right .text ul li,
    .item_description ul li,
    .shop_description ul li {
        font-size: 16px !important;
        line-height: 1.6 !important;
        margin-bottom: 8px !important;
        padding-left: 20px !important;
    }

    /* Таблицы характеристик */
    table.data,
    table.data td,
    table.data th {
        font-size: 15px !important;
        line-height: 1.5 !important;
    }

    table.data th {
        font-size: 16px !important;
        font-weight: bold !important;
        padding: 10px 8px !important;
    }

    table.data td {
        padding: 10px 8px !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Адаптивные таблицы в обертке */
    .table-scroll-wrapper table.data td {
        font-size: 15px !important;
        line-height: 1.5 !important;
        padding: 10px 0 !important;
    }

    .table-scroll-wrapper table.data td:first-child {
        font-size: 16px !important;
        font-weight: bold !important;
    }

    .table-scroll-wrapper table.data td:nth-child(4) {
        font-size: 18px !important;
        font-weight: bold !important;
    }

    /* Цены на странице товара */
    .price-1,
    .price-2 {
        font-size: 16px !important;
    }

    .price-1 .old-price-info {
        font-size: 16px !important;
        line-height: 1.5 !important;
    }

    .price-2 i {
        font-size: 20px !important; /* Цена товара */
        font-weight: bold !important;
    }

    .price-holder .price,
    .price-holder .price-block,
    .cart-price-holder .price {
        font-size: 20px !important;
        font-weight: bold !important;
        line-height: 1.4 !important;
    }

    .price-holder .price i.fa-rub {
        font-size: 20px !important;
    }

    .price-holder .price-over {
        font-size: 16px !important;
    }

    /* Кнопки */
    .into-cart,
    .into-cart input[type="submit"],
    .into-cart a.button,
    button[type="submit"],
    .btn,
    .button {
        font-size: 16px !important;
        padding: 12px 20px !important;
        min-height: 44px !important; /* Touch-friendly */
    }

    .into-cart a.button {
        display: inline-block !important;
        text-align: center !important;
    }

    /* Текст в формах */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px !important; /* Предотвращает зум на iOS */
        line-height: 1.5 !important;
        padding: 10px !important;
    }

    /* Дополнительные блоки */
    .technical,
    .item_description,
    .shop_description {
        font-size: 16px !important;
        line-height: 1.6 !important;
    }

    /* Параграфы */
    p {
        font-size: 16px !important;
        line-height: 1.6 !important;
        margin-bottom: 12px !important;
    }

    /* Ссылки */
    a {
        font-size: 16px !important;
    }

    /* Мелкие элементы - увеличиваем */
    .text-muted,
    small,
    .small {
        font-size: 14px !important; /* Минимум 14px для мелкого текста */
    }

    /* Блоки с характеристиками в карточках */
    .descrx ul li {
        font-size: 14px !important;
        line-height: 1.5 !important;
    }

    /* Названия товаров в каталоге */
    .catalogue h3,
    .catalogue h3 a {
        font-size: 16px !important;
        line-height: 1.4 !important;
    }

    /* Таблицы в корзине */
    .cart td {
        font-size: 14px !important;
    }

    .cart h3 {
        font-size: 18px !important;
    }

    /* Блок наличия товара */
    .title {
        font-size: 16px !important;
        line-height: 1.5 !important;
        margin-bottom: 10px !important;
    }

    /* Опции товара (доставка, гарантия) */
    #product-options,
    #product-options li {
        font-size: 16px !important;
        line-height: 1.6 !important;
    }

    #product-options li.delivery,
    #product-options li.warranty {
        font-size: 16px !important;
        margin-bottom: 12px !important;
    }

    #product-options .delivery_options,
    #product-options .product_options_info {
        font-size: 16px !important;
        text-decoration: underline !important;
    }

    /* Блок "Нашли дешевле?" */
    .cheap-block,
    .cheap-block .cheap {
        font-size: 16px !important;
        line-height: 1.5 !important;
    }

    /* Артикул в карточках */
    .vendor {
        font-size: 15px !important;
        line-height: 1.5 !important;
    }

    /* Срок поставки */
    div[style*="font-size: 14px"] {
        font-size: 16px !important;
    }

    /* Таблицы в обертке .table-scroll */
    .table-scroll,
    .table-scroll table {
        font-size: 15px !important;
    }

    .table-scroll table th {
        font-size: 16px !important;
        font-weight: bold !important;
        padding: 10px 8px !important;
    }

    .table-scroll table td {
        font-size: 15px !important;
        padding: 10px 8px !important;
    }

    /* Ссылка "Версия для печати" */
    .print,
    .print a {
        font-size: 16px !important;
    }

    /* Бейджи "Товар дня", скидки */
    .good-day {
        font-size: 16px !important;
        font-weight: bold !important;
    }

    .super-tsena-cart-2 {
        font-size: 18px !important;
        font-weight: bold !important;
    }

    /* Блок технических характеристик */
    .technical h4 {
        font-size: 20px !important;
        margin-bottom: 15px !important;
    }

    /* КРИТИЧНО: Перекрываем ВСЕ inline стили с font-size - максимальный приоритет */
    /* Используем html body для максимальной специфичности (перекрывает inline стили) */
    html body div[style*="font-size: small"],
    html body div[style*="font-size:14px"],
    html body div[style*="font-size: 14px"],
    html body div[style*="font-size:12px"],
    html body div[style*="font-size: 12px"],
    html body span[style*="font-size: small"],
    html body span[style*="font-size:14px"],
    html body span[style*="font-size: 14px"],
    html body span[style*="font-size:12px"],
    html body span[style*="font-size: 12px"],
    html body p[style*="font-size: small"],
    html body p[style*="font-size:14px"],
    html body p[style*="font-size: 14px"],
    html body td[style*="font-size: small"],
    html body td[style*="font-size:14px"],
    html body td[style*="font-size: 14px"],
    html body th[style*="font-size: small"],
    html body th[style*="font-size:14px"],
    html body th[style*="font-size: 14px"],
    html body li[style*="font-size: small"],
    html body li[style*="font-size:14px"],
    html body li[style*="font-size: 14px"],
    html body a[style*="font-size: small"],
    html body a[style*="font-size:14px"],
    html body a[style*="font-size: 14px"],
    html body [style*="font-size: small"],
    html body [style*="font-size:14px"],
    html body [style*="font-size: 14px"],
    html body [style*="font-size:12px"],
    html body [style*="font-size: 12px"],
    html body [style*="font-size:11px"],
    html body [style*="font-size: 11px"],
    html body [style*="font-size:10px"],
    html body [style*="font-size: 10px"],
    html body [style*="font-size:9px"],
    html body [style*="font-size: 9px"],
    html body [style*="font-size:8px"],
    html body [style*="font-size: 8px"] {
        font-size: 16px !important;
    }

    /* Перекрываем все проценты и em, которые могут давать мелкий текст */
    html body [style*="font-size: 80%"],
    html body [style*="font-size:80%"],
    html body [style*="font-size: 70%"],
    html body [style*="font-size:70%"],
    html body [style*="font-size: 60%"],
    html body [style*="font-size:60%"],
    html body [style*="font-size: 0.8em"],
    html body [style*="font-size:0.8em"],
    html body [style*="font-size: 0.7em"],
    html body [style*="font-size:0.7em"] {
        font-size: 16px !important;
    }

    /* Форма быстрого заказа */
    .fast_order {
        font-size: 16px !important;
    }

    .fast_title_analog {
        font-size: 18px !important;
        font-weight: bold !important;
        margin-bottom: 15px !important;
    }

    .fast1 {
        font-size: 16px !important;
    }

    .fast1 span {
        font-size: 16px !important;
        line-height: 1.6 !important;
    }

    .fast1 .text {
        font-size: 16px !important;
    }

    .bg_button_one,
    .button_center {
        font-size: 16px !important;
        min-height: 44px !important;
        padding: 12px 20px !important;
    }

    /* Блоки с описанием в других местах */
    .shop_description,
    .item_description {
        font-size: 16px !important;
        line-height: 1.6 !important;
    }

    /* Все элементы списков */
    ul li,
    ol li {
        font-size: 16px !important;
        line-height: 1.6 !important;
    }

    /* Все span элементы - кроме иконок */
    span:not(.fa):not([class*="fa-"]):not([class*="icon"]) {
        font-size: 16px !important;
    }

    /* Все div элементы */
    div:not([class*="icon"]):not([class*="fa-"]) {
        font-size: 16px !important;
    }

    /* Принудительно устанавливаем размер для всех элементов, которые могут иметь мелкий текст */
    /* Используем более специфичные селекторы для перекрытия всех конфликтов */
    body td, 
    body th, 
    body p, 
    body span:not(.fa):not([class*="fa-"]), 
    body div:not([class*="icon"]), 
    body li, 
    body a, 
    body label, 
    body input, 
    body textarea, 
    body select, 
    body button {
        font-size: 16px !important;
        line-height: 1.6 !important;
    }

    /* Перекрываем все возможные мелкие размеры из основного CSS */
    body .cart td {
        font-size: 16px !important; /* Было 11px */
    }

    body .descrx ul li {
        font-size: 16px !important; /* Было 10.8px */
    }

    body .catalogue div.cat div.descr h3 {
        font-size: 18px !important; /* Было 14px */
    }

    /* Исключения для иконок и мелких декоративных элементов */
    i.fa,
    .fa-rub,
    .fa-bars,
    .fa-search {
        font-size: inherit !important;
    }
}

/* Для планшетов (768px - 1024px) */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    body {
        font-size: 16px !important;
    }
}

/* Для очень маленьких экранов (до 480px) - еще больше увеличиваем */
@media screen and (max-width: 480px) {
    body {
        font-size: 17px !important;
    }

    h1 {
        font-size: 22px !important;
    }

    h2 {
        font-size: 19px !important;
    }

    .price-holder .price {
        font-size: 22px !important;
    }

    table.data,
    table.data td,
    table.data th {
        font-size: 16px !important;
    }
}
