/*
Theme Name: Woodmart child
Author: Yurrrey
Description: Your description goes here
Version: 1.0
Template: woodmart

This is the child theme for Woodmart theme, generated with Generate Child Theme plugin by catchthemes.

(optional values you can add: Theme URI, Author URI, License, License URI, Tags, Text Domain)
*/

/* Fix: Remove empty min-height block on Elementor pages */
.wd-page-content.main-page-wrapper:has(> main:empty),
.wd-page-content.main-page-wrapper:has(> main > :only-child:empty) {
    min-height: 0;
    display: none;
}

/* ==========================================================
   Fix: WoodMart 8.3.7 - відновлення max-width для boxed контейнерів
   Проблема: тема додає wd-negative-gap до ВСІХ e-con-boxed,
   що знімає max-width навіть у звичайних (не full-width) секцій.
   ========================================================== */

.e-con.e-con-boxed.wd-negative-gap:not(.wd-section-stretch-content) {
    --container-max-width: 1140px;
}

@media (max-width: 1024px) {
    .e-con.e-con-boxed.wd-negative-gap:not(.wd-section-stretch-content) {
        --container-max-width: 1024px;
    }
}

@media (max-width: 768px) {
    .e-con.e-con-boxed.wd-negative-gap:not(.wd-section-stretch-content) {
        --container-max-width: 767px;
    }
}

/* ==========================================================
   Fix #2: WoodMart 8.3.7 - root-level e-con-boxed width regression
   Проблема: Elementor root containers мають max-width: min(100%, var(--width))
   де --width=100%. Потрібно явно задати --width для boxed контейнерів.
   Стосується: /blog/, /contact-us/, /peredposivna-tehnika/, /about-us/ тощо
   ========================================================== */

:is(.elementor-section-wrap, [data-elementor-id]) > .e-con-boxed:not(.wd-section-stretch-content):not(.wd-section-stretch) {
    --width: 1140px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 1024px) {
    :is(.elementor-section-wrap, [data-elementor-id]) > .e-con-boxed:not(.wd-section-stretch-content):not(.wd-section-stretch) {
        --width: 1024px;
    }
}

@media (max-width: 768px) {
    :is(.elementor-section-wrap, [data-elementor-id]) > .e-con-boxed:not(.wd-section-stretch-content):not(.wd-section-stretch) {
        --width: 767px;
    }
}

/* ==========================================================
   Fix #3: WoodMart 8.3.7 - Blog archive відсутній .container
   Проблема: WoodMart 8.3.7 прибрав .container wrapper для blog archive
   wd-blog-element виводиться прямо в wd-content-area без обмеження ширини
   ========================================================== */

.wd-blog-element {
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    box-sizing: border-box;
    padding-left: 15px;
    padding-right: 15px;
}

@media (max-width: 1024px) {
    .wd-blog-element {
        max-width: 1024px;
    }
}

@media (max-width: 768px) {
    .wd-blog-element {
        max-width: 100%;
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* ==========================================================
   Fix #4: Blog archive — рівна висота карток
   Картки в рядку вирівнюються по висоті, CTA Читати далі — завжди знизу
   ========================================================== */

.wd-posts.wd-grid-g {
    align-items: stretch;
}

.wd-posts.wd-grid-g .wd-post {
    display: flex;
    flex-direction: column;
}

.wd-posts.wd-grid-g .wd-post .wd-post-inner,
.wd-posts.wd-grid-g .wd-post .wd-post-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.wd-posts.wd-grid-g .wd-post .wd-post-read-more {
    margin-top: auto;
}

/* Fix #5: Blog archive vertical margins */
.wd-blog-element {
    margin-top: var(--wd-gap, 30px);
    margin-bottom: var(--wd-gap, 30px);
}


/* ==========================================================
   FAQ Block — Поширені запитання (глобально для всіх товарів)
   Структура: [itemtype="schema FAQPage"] > [itemtype="schema Question"]
   ========================================================== */

.woocommerce-Tabs-panel--description [itemtype="https://schema.org/FAQPage"] {
    margin-top: 8px;
}

.woocommerce-Tabs-panel--description [itemtype="https://schema.org/Question"] {
    background: #f7f8fa;
    border-left: 4px solid #d4211b;
    border-radius: 0 6px 6px 0;
    padding: 18px 22px 16px;
    margin-bottom: 12px;
    transition: background 0.2s ease;
}

.woocommerce-Tabs-panel--description [itemtype="https://schema.org/Question"]:hover {
    background: #eef0f5;
}

.woocommerce-Tabs-panel--description [itemtype="https://schema.org/Question"] h3[itemprop="name"] {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 10px;
    color: #1c1c1c;
    line-height: 1.4;
    padding-left: 28px;
    position: relative;
}

.woocommerce-Tabs-panel--description [itemtype="https://schema.org/Question"] h3[itemprop="name"]::before {
    content: "Q";
    position: absolute;
    left: 0;
    top: 0;
    font-size: 11px;
    font-weight: 900;
    color: #d4211b;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    background: rgba(212, 33, 27, 0.1);
    border-radius: 4px;
}

.woocommerce-Tabs-panel--description [itemtype="https://schema.org/Answer"] p[itemprop="text"] {
    margin: 0;
    padding-left: 28px;
    color: #555;
    font-size: 14.5px;
    line-height: 1.68;
}

@media (max-width: 768px) {
    .woocommerce-Tabs-panel--description [itemtype="https://schema.org/Question"] {
        padding: 14px 16px 12px;
    }
    .woocommerce-Tabs-panel--description [itemtype="https://schema.org/Question"] h3[itemprop="name"],
    .woocommerce-Tabs-panel--description [itemtype="https://schema.org/Answer"] p[itemprop="text"] {
        padding-left: 24px;
        font-size: 14px;
    }
}
