/* ============================================================
   Product Card — этап 1: карточки (5volt.ru)
   Цель: обернуть существующие блоки product.tpl в современные
   карточки. HTML/JS не трогаем, только визуал.
   ============================================================ */

/* Лёгкий локальный токен — цвет рамки и тени единый */
.product-info {
    --pc-line: #e7e5df;
    --pc-card-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 4px 14px -8px rgba(0, 0, 0, 0.08);
    --pc-radius: 14px;
}

/* Левая колонка (фото) — центрируем фото и ограничиваем высоту.
   На узких экранах "выключаем" inline-стили elevateZoom (он держит
   зум-обёртку в фиксированных пикселях и абсолютно позиционирует <img>),
   возвращая <img> в нормальный flow. Hover-зум на тач-экранах не нужен —
   там по тапу открывается лайтбокс-colorbox. */
.product-info > .left {
    height: auto !important;
    text-align: center !important;
}
.product-info > .left .image {
    margin: 0 auto 8px !important;
    padding-bottom: 0 !important;
    height: auto !important;
    text-align: center !important;
    max-width: 100% !important;
}
.product-info > .left .image > a {
    display: inline-block;
    max-width: 100%;
}
.product-info > .left .image img,
.product-info > .left .image img#zoom {
    max-width: 100% !important;
    height: auto !important;
    display: inline-block;
}

/* Перебиваем inline-стили elevateZoom на всех экранах — они держат
   фото в фиксированных пикселях и ломают центрирование/высоту. */
.product-info > .left .image .zoomWrapper {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    display: inline-block;
}
.product-info > .left .image .zoomWrapper > img,
.product-info > .left .image .zoomWrapper > img#zoom {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
}
/* Скрываем zoom-окно elevateZoom — оно при resize улетает на top:935px
   и создаёт большую пустоту. На тач-устройствах оно всё равно бесполезно. */
.product-info > .left .image .zoomContainer {
    display: none !important;
}

/* На моб/планшете центрируем фото через flex — самый надёжный
   способ, не ломается обёртками от elevateZoom. */
@media screen and (max-width: 1100px) {
    .product-info > .left {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        text-align: center !important;
    }
    .product-info .image,
    .product-info .image-additional {
        float: none !important;
        display: block !important;
        margin: 0 auto !important;
        text-align: center !important;
        max-width: 100% !important;
        width: auto !important;
        align-self: center !important;
    }
    .product-info .image > a {
        display: inline-block !important;
        max-width: 100%;
    }
    .product-info .image > a > img,
    .product-info .image img#zoom {
        display: inline-block !important;
        max-width: 100% !important;
        height: auto !important;
    }
    .product-info .image .zoomWrapper,
    .product-info .image .zoomContainer {
        display: inline-block !important;
        position: relative !important;
        left: auto !important;
        right: auto !important;
        margin: 0 auto !important;
    }
}

/* Артикул-чип в заголовке — мельче, чтобы не вылезал на узких экранах */
#h1_sku {
    font-size: 11px !important;
    padding: 3px 8px !important;
    border-radius: 999px !important;
    border-color: #c7e8e3 !important;
    background: #f0fbf9;
    line-height: 1.6 !important;
    white-space: nowrap;
    vertical-align: middle !important;
}
#h1_wrapper h1 {
    font-size: 24px !important;
    line-height: 1.25 !important;
}
@media (max-width: 760px) {
    #h1_wrapper h1 {
        font-size: 20px !important;
        margin-right: 0 !important;
        float: none !important;
        display: inline;
    }
    #h1_sku {
        display: inline-block !important;
        margin-top: 6px;
    }
}

/* ===== Блок «Наличие» — теперь внутри карточки .description2,
       отделён пунктирной линией от цены ===== */
.product-info .description2 .description {
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px dashed var(--pc-line) !important;
    border-radius: 0 !important;
    padding: 0 0 14px !important;
    margin: 0 0 16px !important;
    box-shadow: none !important;
    box-sizing: border-box;
    display: block !important;
    color: inherit !important;
    width: auto !important;
    line-height: 1.7;
    font-size: 14px;
}
.product-info .description2 .description .infoleft {
    padding: 0;
}
/* Если внутри .description есть стандартный <br>, который остался
   от старого шаблона — он создаёт лишнюю пустую строку */
.product-info .description2 .description br + br {
    display: none;
}

/* "Наличие:" — мягкий заголовок секции в стиле других карточек */
.product-info .description2 .description #text_stock {
    display: block !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #7B7F87 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    margin-bottom: 8px !important;
}
/* Скрываем <br>, который шаблон ставит сразу после #text_stock — он
   создаёт лишнюю пустую строку, потому что #text_stock уже block. */
.product-info .description2 .description #text_stock + br {
    display: none !important;
}

/* Города (любые <span> кроме #text_stock и кроме счётчика отзывов) —
   слева добавляем зелёную точку-индикатор. */
.product-info .description2 .description .infoleft span:not(#text_stock) {
    display: inline-block;
    position: relative;
    padding-left: 18px;
    color: #4A4F58;
    font-weight: 500;
    margin-right: 4px;
}
.product-info .description2 .description .infoleft span:not(#text_stock)::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3DA86E;
    box-shadow: 0 0 0 3px rgba(61, 168, 110, 0.18);
    transform: translateY(-50%);
}

/* ===== Карточка «Цена + опции + кнопка купить» ===== */
.product-info .description2 {
    background: #ffffff !important;
    border: 1px solid var(--pc-line) !important;
    border-radius: var(--pc-radius) !important;
    padding: 22px !important;
    box-shadow: var(--pc-card-shadow) !important;
    box-sizing: border-box;
}

/* ===== Этап 2: цена и кнопка «Купить» ===== */

/* Цена */
.product-info .description2 .price {
    text-align: center;
    margin: 6px 0 18px;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #23262B;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}
/* Подавляем подпись "Цена:" если шаблон её передаёт пустой строкой,
   она часто рендерится как лишний пробел перед суммой — оставляем как есть,
   но если станет видна, можно скрыть через .price > br:first-child + ... */

/* Старая цена (если товар со скидкой) */
.product-info .description2 .price .price-old {
    display: inline-block;
    font-size: 18px;
    color: #A6A8AE;
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    font-weight: 600;
    margin-right: 10px;
    vertical-align: middle;
}
.product-info .description2 .price .price-new {
    color: #23262B;
}

/* Дополнительные подписи под ценой (НДС / бонусы) */
.product-info .description2 .price .price-tax,
.product-info .description2 .price .reward {
    display: block;
    font-size: 12px;
    color: #7B7F87;
    font-weight: 500;
    margin-top: 6px;
    text-align: center;
}

/* Скидка / акция (если внутри .price есть .discount) */
.product-info .description2 .price .discount {
    margin: 12px 0 0;
    padding: 10px 14px;
    background: #f7f7f4;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #4A4F58;
    line-height: 1.5;
    text-align: left;
}

/* Кнопка «Купить» — <button> с SVG-иконкой корзины внутри.
   Используем inline-flex чтобы SVG+текст центрировались как единая группа. */
.product-info .description2 #button-cart,
.product-info .description2 button#button-cart {
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    height: 50px !important;
    min-width: 200px !important;
    padding: 0 28px !important;
    background: #22B699 !important;
    background-image: none !important;
    color: #ffffff !important;
    border: 0 !important;
    border-radius: 12px !important;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    line-height: 1 !important;
    text-align: center !important;
    text-decoration: none !important;
    text-transform: none !important;
    box-shadow:
        0 1px 0 rgba(31, 138, 152, 0.18),
        0 8px 22px -10px rgba(34, 182, 153, 0.55) !important;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    -webkit-box-sizing: border-box !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}
.product-info .description2 #button-cart:hover {
    background: #1ba89f !important;
    color: #ffffff !important;
    box-shadow:
        0 1px 0 rgba(31, 138, 152, 0.25),
        0 14px 32px -10px rgba(34, 182, 153, 0.65) !important;
}
.product-info .description2 #button-cart:active {
    transform: translateY(1px) !important;
    box-shadow:
        0 1px 0 rgba(31, 138, 152, 0.18),
        0 4px 12px -4px rgba(34, 182, 153, 0.4) !important;
}

/* Плашка "Товар отсутствует на складе" — на месте кнопки Купить когда
   нет остатков ни в одном городе. Имитирует disabled-кнопку. */
.product-info .description2 .pm-out-of-stock {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    height: 50px !important;
    min-width: 240px !important;
    max-width: 100% !important;
    padding: 0 28px !important;
    background: #fdecec !important;
    color: #b3322b !important;
    border: 1px solid #f4c5c0 !important;
    border-radius: 12px !important;
    font-family: inherit !important;
    font-size: 14.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    line-height: 1 !important;
    cursor: not-allowed !important;
    user-select: none !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
    text-align: center !important;
}
.product-info .description2 .pm-out-of-stock .fa {
    font-size: 16px;
    color: #d8553d;
    line-height: 1;
}
.product-info .description2 .pm-out-of-stock .pm-oos-text {
    color: inherit;
}
/* SVG-иконка корзины внутри кнопки */
.product-info .description2 #button-cart .btn-cart-icon {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
    color: currentColor !important;
}
.product-info .description2 #button-cart .btn-cart-label {
    display: inline-block !important;
    color: inherit !important;
}

/* Контейнер вокруг кнопки — flex-layout с justify-content: center.
   Перебиваем легаси .cart-inside { width: 400px; display: table }. */
.product-info .description2 .cart {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    text-align: center !important;
}
.product-info .description2 .cart-inside {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
    box-shadow: none !important;
}
.product-info .description2 .cartbutton {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
}
.product-info .description2 .cartbutton > a {
    display: inline-flex !important;
    flex: none !important;
    width: auto !important;
    text-decoration: none !important;
}

/* Чекбокс "Дополнительные услуги" — выровнять по центру с лёгким отступом */
.product-info .description2 .options {
    margin: 4px 0 18px !important;
    padding: 12px 14px !important;
    background: #f7f7f4 !important;
    border-radius: 10px !important;
    text-align: left !important;
    font-size: 13.5px !important;
    line-height: 1.55 !important;
}
.product-info .description2 .options > .option,
.product-info .description2 .options .option {
    margin: 0 0 8px !important;
    padding: 0 !important;
}
.product-info .description2 .options > .option:last-child,
.product-info .description2 .options .option:last-child {
    margin-bottom: 0 !important;
}
.product-info .description2 .options b {
    display: block;
    font-weight: 700;
    color: #4A4F58;
    margin-bottom: 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
/* Скрываем лишние <br> после заголовка опции и между группами опций.
   <br> внутри radio/checkbox-блоков (между вариантами) остаются. */
.product-info .description2 .options b + br {
    display: none !important;
}
.product-info .description2 .options > br {
    display: none !important;
}
/* Required-маркер "*" — в шаблоне <span class="required">*</span> идёт
   перед <b>, из-за display:block у <b> висел сверху отдельной строкой.
   Прибиваем его к правому краю строки с заголовком через float: right. */
.product-info .description2 .options .option {
    overflow: hidden;
}
.product-info .description2 .options .option .required {
    float: right !important;
    display: inline-block !important;
    color: #d8553d !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    line-height: 1 !important;
    margin: 0 0 0 8px !important;
    padding: 0 !important;
}
.product-info .description2 .options input[type="checkbox"],
.product-info .description2 .options input[type="radio"] {
    margin-right: 6px;
    vertical-align: middle;
    accent-color: #22B699;
}
.product-info .description2 .options label {
    color: #23262B;
    font-weight: 500;
    cursor: pointer;
}

/* ===== Карточка «Доставка» ===== */
.product-info .description3 {
    background: #ffffff !important;
    border: 1px solid var(--pc-line) !important;
    border-radius: var(--pc-radius) !important;
    padding: 16px 18px !important;
    box-shadow: var(--pc-card-shadow) !important;
    box-sizing: border-box;
}
.product-info .description3 h3 {
    margin: 0 0 12px !important;
    padding: 0 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #7B7F87 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    border: 0 !important;
    background: none !important;
}

/* Каждый способ доставки — параграф с absolute-плашкой иконки слева */
.product-info .description3 p {
    position: relative !important;
    padding-left: 36px !important;
    min-height: 26px !important;
    margin: 0 0 10px !important;
    font-size: 12.5px !important;
    line-height: 1.5 !important;
    color: #4A4F58 !important;
}
.product-info .description3 p:last-child {
    margin-bottom: 0 !important;
}

/* Плашка-фон под FontAwesome-иконку — компактнее */
.product-info .description3 p > i.fa {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 26px !important;
    height: 26px !important;
    background: #e6f6f3 !important;
    color: #1ba89f !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: top !important;
}
/* Сбрасываем красный цвет у иконки самолёта (.fa.red) */
.product-info .description3 p > i.fa.red {
    color: #1ba89f !important;
}
/* Заголовок способа доставки */
.product-info .description3 p strong {
    display: inline-block;
    color: #23262B;
    font-weight: 700;
    font-size: 12.5px;
    margin-bottom: 1px;
}
/* "Адрес" tooltip — мягче */
.product-info .description3 p .tooltip {
    color: #1ba89f;
    border-bottom: 1px dashed #1ba89f;
    cursor: help;
}

/* ===== Карточка «Характеристики» (table.attribute) ===== */
.product-info table.attribute {
    background: #ffffff !important;
    border: 1px solid var(--pc-line) !important;
    border-radius: var(--pc-radius) !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    box-shadow: var(--pc-card-shadow) !important;
    overflow: hidden;
    width: 100%;
    margin: 24px 0 !important;
}
.product-info table.attribute thead td {
    background: #f7f7f4 !important;
    color: #23262B !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    padding: 14px 22px !important;
    border-bottom: 1px solid var(--pc-line) !important;
}
.product-info table.attribute tbody td {
    padding: 12px 22px !important;
    font-size: 14px !important;
    color: #23262B !important;
    border-bottom: 1px dashed var(--pc-line) !important;
    background: transparent !important;
}
.product-info table.attribute tbody tr:last-child td {
    border-bottom: 0 !important;
}
.product-info table.attribute tbody td:first-child {
    color: #7B7F87 !important;
    width: 40%;
    font-weight: 500 !important;
    text-align: left !important;
}
.product-info table.attribute tbody td:last-child {
    font-weight: 600 !important;
    color: #23262B !important;
}

/* ===== Trust strip — полоса с 4 преимуществами =====
   В шаблоне 4 ссылки <a class="colorbox1..4 pm-trust-item">.
   Сохраняются colorbox1-4 классы для jquery.colorbox-плагина. */
.pm-trust {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #ffffff;
    border: 1px solid #e7e5df;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 4px 14px -8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin: 24px 0;
}
.pm-trust .pm-trust-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-left: 1px solid #e7e5df;
    color: #23262B;
    text-decoration: none;
    transition: background 0.18s ease;
    background: #ffffff;
    font-family: inherit;
}
.pm-trust .pm-trust-item:first-child { border-left: 0; }
.pm-trust .pm-trust-item:hover {
    background: #f7f7f4;
    text-decoration: none;
    color: #23262B;
}
.pm-trust .pm-trust-ico {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e6f6f3;
    color: #1ba89f;
    border-radius: 8px;
    font-size: 16px;
}
.pm-trust .pm-trust-ico .fa {
    margin: 0;
    line-height: 1;
}
.pm-trust .pm-trust-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.pm-trust .pm-trust-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #23262B;
    line-height: 1.25;
}
.pm-trust .pm-trust-sub {
    /* Подзаголовки временно скрыты по запросу — текст в HTML остаётся
       на случай возврата. */
    display: none;
}
@media (max-width: 1100px) {
    .pm-trust {
        grid-template-columns: repeat(2, 1fr);
    }
    .pm-trust .pm-trust-item:nth-child(3) {
        border-left: 0;
        border-top: 1px solid #e7e5df;
    }
    .pm-trust .pm-trust-item:nth-child(4) {
        border-top: 1px solid #e7e5df;
    }
}
@media (max-width: 480px) {
    .pm-trust .pm-trust-item {
        padding: 12px 14px;
        gap: 10px;
    }
    .pm-trust .pm-trust-ico {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    .pm-trust .pm-trust-sub {
        display: none;
    }
}

/* ===== Карточка «Описание товара» (.product-description) ===== */
.product-info ~ .product-description,
.product-info .product-description,
#tab-description > .product-info + .product-description {
    /* fallback селекторы */
}
.product-description {
    background: #ffffff;
    border: 1px solid #e7e5df;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03), 0 4px 14px -8px rgba(0,0,0,0.08);
    margin: 24px 0;
    line-height: 1.6;
}

/* Карточки .description2/.description3 делаем BFC, чтобы их фон
   не растекался под плавающими соседями (например, под фото .left
   на узких экранах, где float не успел сняться). */
.product-info .description2,
.product-info .description3 {
    overflow: hidden;
}

/* Аккуратные переносы внутри карточек: длинное "(+1 500 руб)"
   перенесётся на новую строку как единое целое, без рваных
   разрывов в середине слова "Санкт-Петербург" и т.п. */
.product-info .description,
.product-info .description2,
.product-info .description3,
.product-info .options .option,
.product-info .options .option label {
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: none;
}

/* На узких экранах фото перестаёт плавать — не создаёт визуального
   эффекта "карточка обнимает фото". Также убираем дублирующий
   border-top у Доставки (он теперь поверх рамки карточки) и
   принудительно очищаем float у карточек. */
@media screen and (max-width: 1100px) {
    .product-info > .left,
    .product-info > div.left {
        float: none !important;
        clear: both !important;
        display: block !important;
        position: static !important;
        margin: 0 auto 16px !important;
        max-width: 100% !important;
        width: auto !important;
        text-align: center !important;
    }
    .product-info > .left img,
    .product-info > .left .image,
    .product-info > .left .image-additional {
        max-width: 100% !important;
        height: auto !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    .product-info .description2,
    .product-info .description3 {
        clear: both !important;
        float: none !important;
        width: 100% !important;
    }
    .product-info .description3 {
        border-top: 0 !important;
        padding-top: 20px !important;
        margin-top: 16px !important;
    }
}

/* Адаптив — на узких экранах меньше внутренних отступов */
@media screen and (max-width: 760px) {
    .product-info .description,
    .product-info .description2,
    .product-info .description3 {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
    .product-info table.attribute thead td,
    .product-info table.attribute tbody td {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }
    .product-description {
        padding: 16px;
    }
}
