/*
Theme Name: СтройМагЗаЧас (Kadence дочерняя)
Template: kadence
Description: Дочерняя тема для сайта СтройМагЗаЧас на основе Kadence Theme
Author: Дмитрий Синицын
Version: 1.4
*/

/* ============================================================
   СОДЕРЖАНИЕ
   1. Глобальные стили
   2. Шапка сайта
   3. Меню в шапке
   4. Кнопка поиска
   5. Строки прайса на 228
   6. Кнопка «Купить» (WPB Popup)
   7. Поля формы заказа
   8. Кнопка «Показать ещё»
   9. Скрытый и сворачиваемый списки
   10. Адаптивное видео RuTube
   11. Карточки категорий на главной
   12. Карточка товара (двухколоночная)
   13. Списки с галочками и крестиком
   14. Информация о паллете
   15. Хлебные крошки
   16. Гео-блок в подвале
   17. Избранное (сердечки)
   18. Плавающий счётчик избранного
   19. Кнопка «Написать в Макс»
   ============================================================ */


/* ============================================================
   1. ГЛОБАЛЬНЫЕ СТИЛИ
   ============================================================ */

img,
iframe,
video,
.wp-block-image,
.entry-content * {
    max-width: 100% !important;
    height: auto !important;
}

body {
    overflow-x: hidden;
    width: 100%;
}


/* ============================================================
   2. ШАПКА САЙТА
   ============================================================ */

.site-branding {
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
}
.custom-logo-link {
    max-width: 40% !important;
}

@media (max-width: 768px) {
    .custom-logo-link img {
        max-width: 120px !important;
        height: auto !important;
    }
    .site-title {
        font-size: 1.2rem !important;
    }
    .site-header .site-branding {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        max-width: 70%;
    }
    .site-header .site-title {
        font-size: 1rem;
        line-height: 1.2;
        white-space: nowrap;
    }
    .site-header .main-navigation {
        margin-right: 5px;
    }
}


/* ============================================================
   3. МЕНЮ В ШАПКЕ
   ============================================================ */

.main-navigation .primary-menu-container > ul,
.header-navigation .header-menu-container > ul {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    row-gap: 8px !important;
    column-gap: 4px !important;
}

.main-navigation .primary-menu-container > ul > li,
.header-navigation .header-menu-container > ul > li {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
}

@media (max-width: 900px) {
    .main-navigation .primary-menu-container > ul > li > a,
    .header-navigation .header-menu-container > ul > li > a {
        font-size: 14px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
}

@media (max-width: 700px) {
    .main-navigation .primary-menu-container > ul > li > a,
    .header-navigation .header-menu-container > ul > li > a {
        font-size: 13px !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
    }
}


/* ============================================================
   4. КНОПКА ПОИСКА
   ============================================================ */

.search-submit,
.widget_search .search-submit,
form.search-form .search-submit,
input[type="submit"].search-submit,
button.search-submit {
    font-size: 0 !important;
    background-color: #ff8c00 !important;
    border: none !important;
    padding: 8px 20px !important;
    border-radius: 30px !important;
    cursor: pointer !important;
    width: auto !important;
    height: auto !important;
}

.search-submit::after,
.widget_search .search-submit::after,
form.search-form .search-submit::after,
input[type="submit"].search-submit::after,
button.search-submit::after {
    content: "🔍 Поиск" !important;
    font-size: 14px !important;
    color: #fff !important;
}


/* ============================================================
   5. СТРОКИ ПРАЙСА НА 228
   ============================================================ */

.entry-content li[data-tovar] {
    display: block !important;
    list-style: none !important;
    padding: 0 0 14px 0 !important;
    margin: 0 0 14px 0 !important;
    border-bottom: 1px solid #e5e5e5 !important;
    line-height: 1.5 !important;
}

.entry-content ul > li[data-tovar]:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.entry-content li[data-tovar] br {
    display: none !important;
}

.entry-content li[data-tovar] > strong {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
}

.entry-content li[data-tovar] > span {
    display: inline !important;
    margin: 0 0 0 6px !important;
    padding: 0 !important;
    font-size: 0.92em !important;
    color: #666 !important;
}

.entry-content li[data-tovar] .wpb-pcf-btn,
.entry-content li[data-tovar] button {
    display: inline-block !important;
    margin: 0 0 0 8px !important;
    padding: 4px 14px !important;
    vertical-align: middle !important;
    line-height: 1 !important;
}


/* ============================================================
   6. КНОПКА «КУПИТЬ» (WPB POPUP)
   ============================================================ */

.wpb-pcf-form-fire,
button.wpb-pcf-btn,
.wpb-pcf-btn-default {
    background: #FF8C00 !important;
    color: #ffffff !important;
    padding: 6px 14px !important;
    border-radius: 5px !important;
    font-weight: bold !important;
    font-size: 14px !important;
    border: none !important;
    cursor: pointer !important;
    display: inline-block !important;
    white-space: nowrap;
}
.wpb-pcf-form-fire:hover,
button.wpb-pcf-btn:hover {
    background: #e67e00 !important;
    color: #ffffff !important;
}


/* ============================================================
   7. ПОЛЯ ФОРМЫ ЗАКАЗА
   ============================================================ */

.wpb-pcf-popup input,
.wpb-pcf-popup textarea,
.wpb-pcf-popup select,
.wpb-pcf-content input,
.wpb-pcf-content textarea,
.wpb-pcf-content select,
div[class*="wpb-pcf"] input,
div[class*="wpb-pcf"] textarea {
    color: #1A202C !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e0 !important;
    font-size: 15px !important;
}

.wpb-pcf-popup input[readonly],
.wpb-pcf-content input[readonly],
div[class*="wpb-pcf"] input[readonly] {
    color: #1A202C !important;
    background: #f3f4f6 !important;
    font-weight: 600 !important;
    cursor: default;
}

.wpb-pcf-popup input::placeholder,
.wpb-pcf-content input::placeholder,
div[class*="wpb-pcf"] input::placeholder {
    color: #718096 !important;
    opacity: 1 !important;
}


/* ============================================================
   8. КНОПКА «ПОКАЗАТЬ ЕЩЁ»
   ============================================================ */

button.pokazat-esche {
    display: block;
    margin: 15px auto;
    padding: 10px 24px;
    background: #0a6ebd;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background .2s;
}
button.pokazat-esche:hover {
    background: #085a99;
}
button.pokazat-esche.pokazat-esche--open {
    background: #555;
}
button.pokazat-esche.pokazat-esche--open:hover {
    background: #333;
}


/* ============================================================
   9. СКРЫТЫЙ И СВОРАЧИВАЕМЫЙ СПИСКИ
   ============================================================ */

.skrytyy-spisok {
    display: none;
    list-style: none;
    padding-left: 0;
    line-height: 1.8;
}
.skrytyy-spisok.otkryt {
    display: block;
}

.entry-content li.tovar-svernutyy {
    display: none;
}
.entry-content ul.otkryt li.tovar-svernutyy {
    display: list-item;
}


/* ============================================================
   10. АДАПТИВНОЕ ВИДЕО RUTUBE
   ============================================================ */

.rutube-video {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 20px auto;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}
.rutube-video iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}


/* ============================================================
   11. КАРТОЧКИ КАТЕГОРИЙ НА ГЛАВНОЙ
   ============================================================ */

.kategoriya-card {
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    text-decoration: none;
    color: #1a1a1a;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: 0.2s;
}
.kategoriya-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.kategoriya-card img {
    width: 220px;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.kategoriya-card .kategoriya-content {
    flex: 1;
}
.kategoriya-card .kategoriya-title {
    margin: 0 0 10px;
    color: #0a6ebd;
    font-size: 1.3em;
}
.kategoriya-card .kategoriya-desc {
    margin: 0 0 12px;
    font-size: 0.95em;
    color: #555;
    line-height: 1.5;
}
.kategoriya-card .kategoriya-more {
    color: #ff8c00;
    font-weight: bold;
    font-size: 0.95em;
}
.kategoriya-card.reverse {
    flex-direction: row-reverse;
}

.kategorii-grid {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 640px) {
    .kategoriya-card,
    .kategoriya-card.reverse {
        flex-direction: column;
        align-items: stretch;
    }
    .kategoriya-card img {
        width: 100%;
        height: 200px;
    }
}


/* ============================================================
   12. КАРТОЧКА ТОВАРА (ДВУХКОЛОНОЧНАЯ РАСКЛАДКА)
   ============================================================ */

.tovar-single-wrap {
    position: relative;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 20px 16px 60px !important;
    box-sizing: border-box;
}

.tovar-single-wrap .entry-header {
    margin-bottom: 24px;
}

.tovar-single-wrap .entry-title {
    font-size: clamp(1.4em, 3vw, 2em);
    margin: 0 0 8px;
    line-height: 1.25;
}

.tovar-top {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 40px;
    align-items: start;
    margin-bottom: 40px;
}

.tovar-top-left {
    min-width: 0;
}

.tovar-thumbnail {
    margin: 0;
    text-align: center;
    background: #fafafa;
    border-radius: 12px;
    padding: 16px;
}

.tovar-thumbnail img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

.tovar-top-right {
    min-width: 0;
}

.tovar-top-right .tovar-cena {
    font-size: clamp(22px, 4vw, 32px);
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 12px;
    line-height: 1.15;
}

.tovar-top-right .tovar-cena strong {
    font-size: 0.7em;
    font-weight: 600;
    color: #555;
}

.tovar-top-right .tovar-pallet-info {
    font-size: 14px;
    color: #555;
    margin: 0 0 16px;
    line-height: 1.5;
}

.tovar-top-right .tovar-pallet-info strong {
    color: #1a1a1a;
}

.tovar-top-right .tovar-free-delivery {
    color: #28a745;
    font-weight: 600;
    white-space: nowrap;
}

.tovar-top-right .tovar-knopki {
    display: flex !important;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 20px !important;
    align-items: center;
}

/* Характеристики — компактная таблица */
.tovar-top-right .tovar-atributy {
    margin: 20px 0 12px;
}

.tovar-top-right .tovar-atributy h3 {
    margin: 0 0 10px;
    font-size: 1.1em;
}

.tovar-top-right .tovar-atributy table {
    width: auto !important;
    max-width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: auto;
    border: none;
    background: transparent;
}

.tovar-top-right .tovar-atributy tr {
    border-bottom: 1px solid #e5e5e5;
}

.tovar-top-right .tovar-atributy tr:last-child {
    border-bottom: none;
}

.tovar-top-right .tovar-atributy td {
    padding: 6px 0;
    vertical-align: top;
    border: none;
    background: transparent;
}

.tovar-top-right .tovar-atributy td:first-child {
    font-weight: 600;
    color: #555;
    padding-right: 24px;
    white-space: nowrap;
    width: 1%;
}

.tovar-top-right .tovar-atributy td:last-child {
    color: #1a1a1a;
    padding-right: 0;
}

.tovar-top-right .tovar-sku,
.tovar-top-right .tovar-data-ceny {
    font-size: 14px;
    color: #555;
    margin: 6px 0;
}

.tovar-top-right .tovar-sku strong,
.tovar-top-right .tovar-data-ceny strong {
    color: #1a1a1a;
}

.tovar-top-right .tovar-fizparametry {
    margin: 12px 0 0;
    font-size: 14px;
    color: #555;
    line-height: 1.7;
}

.tovar-bottom {
    margin-top: 20px;
}

.tovar-bottom .entry-content {
    max-width: 100%;
}

.tovar-bottom .entry-content h2 {
    margin-top: 32px !important;
    margin-bottom: 16px !important;
}

.tovar-bottom .entry-content p,
.tovar-bottom .entry-content ul,
.tovar-bottom .entry-content ol {
    margin-bottom: 16px !important;
}

.tovar-bottom .entry-content img {
    display: block;
    margin: 24px auto !important;
    max-width: 100%;
    height: auto;
}

/* МОБИЛЬНЫЙ */
@media (max-width: 900px) {
    .tovar-top {
        grid-template-columns: 1fr !important;
        gap: 24px;
        margin-bottom: 28px;
    }
    .tovar-thumbnail {
        padding: 12px;
    }
    .tovar-single-wrap {
        padding: 16px 14px 40px !important;
    }
}


/* ============================================================
   13. СПИСКИ С ГАЛОЧКАМИ И КРЕСТИКОМ
   ============================================================ */

.single-tovar .entry-content ul.list-check {
    list-style: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

.single-tovar .entry-content ul.list-check > li {
    position: relative !important;
    display: block !important;
    padding-left: 30px !important;
    margin-bottom: 10px !important;
    list-style: none !important;
}

.single-tovar .entry-content ul.list-check > li::before {
    content: "✅";
    position: absolute;
    left: 0;
    top: 0;
    width: 22px;
    line-height: inherit;
}

.single-tovar .entry-content ul.list-cross > li {
    position: relative !important;
    display: block !important;
    padding-left: 30px !important;
    list-style: none !important;
}

.single-tovar .entry-content ul.list-cross > li::before {
    content: "❌";
    position: absolute;
    left: 0;
    top: 0;
}


/* ============================================================
   14. ИНФОРМАЦИЯ О ПАЛЛЕТЕ
   ============================================================ */

.tovar-pallet-info {
    font-size: 14px;
    color: #555;
    margin-top: 6px;
    line-height: 1.5;
}
.tovar-pallet-info strong {
    color: #1a1a1a;
    font-weight: 700;
}
.tovar-free-delivery {
    color: #28a745;
    font-weight: 600;
    margin-left: 4px;
    white-space: nowrap;
}


/* ============================================================
   15. ХЛЕБНЫЕ КРОШКИ
   ============================================================ */

.tovar-breadcrumbs {
    font-size: 0.9em;
    color: #666;
    margin: 10px 0 20px;
}
.tovar-breadcrumbs a {
    color: #0a6ebd;
    text-decoration: none;
}
.tovar-breadcrumbs a:hover {
    text-decoration: underline;
}
.tovar-breadcrumbs .separator {
    margin: 0 8px;
    color: #ccc;
}
.tovar-breadcrumbs span:not(.separator) {
    color: #666;
}


/* ============================================================
   16. ГЕО-БЛОК В ПОДВАЛЕ
   ============================================================ */

.smag-geo-block {
    max-width: 1200px;
    margin: 30px auto 20px;
    padding: 20px 24px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    text-align: center;
}
.smag-geo-block p { margin: 0 0 10px; }
.smag-geo-block p:last-child { margin-bottom: 0; }
.smag-geo-block strong { color: #1a1a1a; }
.smag-geo-block a { color: #0a6ebd; font-weight: 600; text-decoration: none; }
.smag-geo-block a:hover { text-decoration: underline; }

.smag-geo-rays {
    list-style: none;
    padding: 0;
    margin: 14px 0 18px;
    text-align: left;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 6px 24px;
}
.smag-geo-rays li {
    padding: 4px 0;
    font-size: 13.5px;
    line-height: 1.5;
    border: none;
}
.smag-geo-rays li strong { color: #0a6ebd; }

@media (max-width: 640px) {
    .smag-geo-block { padding: 16px 14px; font-size: 13px; }
    .smag-geo-rays { grid-template-columns: 1fr; gap: 4px; }
}


/* ============================================================
   17. ИЗБРАННОЕ (СЕРДЕЧКИ)
   ============================================================ */

/* Кнопка-сердечко общая (витрина, страница избранного) */
.fav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e5e5e5;
    cursor: pointer;
    color: #bbb;
    padding: 0;
    z-index: 2;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    line-height: 1;
}

.fav-btn::before {
    content: "♡";
    font-size: 20px;
    line-height: 1;
    display: block;
    color: inherit;
}

.fav-btn:hover {
    background: #ffe6ea;
    color: #e74c3c;
    border-color: #e74c3c;
}

.fav-btn.active {
    color: #e74c3c;
    border-color: #e74c3c;
    background: #fff;
}

.fav-btn.active::before {
    content: "♥";
}

/* Кнопка в карточке товара — inline, с текстом */
.tovar-knopki .fav-btn {
    position: static !important;
    width: auto !important;
    height: auto !important;
    border-radius: 6px !important;
    padding: 8px 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    border: 1px solid #cfcfcf !important;
    background: #fff !important;
    color: #555 !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    top: auto !important;
    right: auto !important;
    z-index: auto !important;
    font-size: 14px !important;
    line-height: 1 !important;
}

.tovar-knopki .fav-btn::before {
    content: "♡";
    font-size: 16px;
    color: #999;
    display: inline-block;
    line-height: 1;
}

.tovar-knopki .fav-btn::after {
    content: "В избранное";
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
    line-height: 1;
}

.tovar-knopki .fav-btn:hover {
    background: #ffe6ea !important;
    color: #e74c3c !important;
    border-color: #e74c3c !important;
}

.tovar-knopki .fav-btn:hover::before {
    color: #e74c3c;
}

.tovar-knopki .fav-btn.active {
    background: #ffe6ea !important;
    color: #e74c3c !important;
    border-color: #e74c3c !important;
}

.tovar-knopki .fav-btn.active::before {
    content: "♥";
    color: #e74c3c;
}

.tovar-knopki .fav-btn.active::after {
    content: "В избранном";
}

/* Счётчик в шапке (если используется) */
.fav-counter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #ffe6ea;
    color: #e74c3c;
    border-radius: 14px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    margin-left: 8px;
}
.fav-counter:hover { background: #e74c3c; color: #fff; }

/* Карточки товара в витрине */
.tovar-card { position: relative; }


/* ============================================================
   18. ПЛАВАЮЩИЙ СЧЁТЧИК ИЗБРАННОГО
   ============================================================ */

.fav-counter-floating {
    position: fixed;
    top: 14px;
    right: 80px;
    z-index: 9999;
    display: none;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #ffe6ea;
    color: #e74c3c;
    border-radius: 16px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all .2s;
}
.fav-counter-floating.visible { display: inline-flex !important; }
.fav-counter-floating:hover { background: #e74c3c; color: #fff; }

@media (max-width: 768px) {
    .fav-counter-floating {
        top: 10px;
        right: 60px;
        font-size: 13px;
        padding: 4px 10px;
    }
}


/* ============================================================
   19. КНОПКА «НАПИСАТЬ В МАКС»
   ============================================================ */

.btn-maks {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 5px !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    transition: opacity .2s !important;
    line-height: 1 !important;
    width: auto !important;
    max-width: 100% !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

.btn-maks:hover {
    background: transparent !important;
    opacity: 0.85;
    box-shadow: none !important;
}

.btn-maks .maks-icon,
.btn-maks img {
    display: block !important;
    height: 40px !important;
    width: auto !important;
    max-width: 100% !important;
    border-radius: 5px !important;
    border: none !important;
    box-shadow: none !important;
    object-fit: contain !important;
    margin: 0 !important;
    padding: 0 !important;
}

@media (max-width: 600px) {
    .tovar-knopki {
        flex-direction: column;
        align-items: stretch !important;
    }
    .tovar-knopki .btn-maks,
    .tovar-knopki .wpb-pcf-btn,
    .tovar-knopki .fav-btn {
        width: 100%;
        justify-content: center;
    }
    .btn-maks .maks-icon,
    .btn-maks img {
        height: 36px !important;
        margin: 0 auto !important;
    }
}

