/* =========================================
   AI PAMAGATOR: FRONTEND STYLES (FINAL-V3)
   ========================================= */

/* --- 1. ГЛОБАЛЬНІ БЛОКИ (КАРТКИ) --- */
.aip-table-wrapper, .aip-price-table-wrapper, .aip-related-prices-wrapper,
.aip-accent-block, .aip-related-posts-block, .aip-author-box {
    background: #fff; border: 1px solid #f0f0f0; border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06); margin: 30px 0; overflow: hidden; padding: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* ВАЖЛИВО ДЛЯ МОБІЛЬНИХ: Горизонтальний скрол */
    overflow-x: auto; 
}
.aip-table-wrapper:hover, .aip-price-table-wrapper:hover, .aip-related-prices-wrapper:hover,
.aip-accent-block:hover, .aip-related-posts-block:hover, .aip-author-box:hover {
    box-shadow: 0 15px 35px rgba(0,0,0,0.12); transform: translateY(-4px); border-color: #e0e0e0;
}

/* --- 2. ТАБЛИЦІ --- */
table.aip-table, table.aip-price-table, table.aip-related-prices-table {
    width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: none; margin: 0;
    
}
/* Виняток для таблиці в сайдбарі - їй скрол не потрібен */
table.aip-related-prices-table { min-width: 0; }

/* --- 3. КОМІРКИ (ОНОВЛЕНО v2) --- */
/* Основні таблиці - просторі */
.aip-table th, .aip-table td, 
.aip-price-table th, .aip-price-table td {
    padding: 15px 20px !important; text-align: left; border-bottom: 1px solid #f0f0f0; color: #333; vertical-align: middle;
}
/* Таблиця в сайдбарі (Related) - дуже компактна */
.aip-related-prices-table th, .aip-related-prices-table td {
    padding: 4px 0 !important; /* Мінімальні відступи всередині рядка */
    border: none !important; /* Прибираємо внутрішні лінії */
    vertical-align: middle;
}

/* --- 4. ШАПКА (INTELLIGENT HEADER) --- */
/* 1. Стандартний thead */
.aip-table thead th, .aip-price-table thead th {
    background-color: #4CAF50 !important; color: #fff !important; font-weight: 700; text-transform: uppercase; border-bottom: none; border-radius: 0;
}

/* 2. Перший рядок ТІЛЬКИ якщо немає thead І це не вертикальна таблиця */
.aip-simple-table:not(.shop_attributes):not(.woocommerce-product-attributes) > tbody > tr:first-child > td {
    background-color: #4CAF50 !important; color: #fff !important; font-weight: 700; text-transform: uppercase;
}

/* 3. ВЕРТИКАЛЬНІ ТАБЛИЦІ (Характеристики) */
/* Робимо першу колонку жирною, але без зеленого фону */
table.shop_attributes th, table.woocommerce-product-attributes th,
table.shop_attributes td:first-child, table.woocommerce-product-attributes td:first-child {
    background-color: #f9f9f9 !important; color: #333 !important; font-weight: 700 !important; width: 30%;
}

/* --- 5. ЕФЕКТИ (ЗЕБРА + ХОВЕР - ОНОВЛЕНО) --- */
/* Зебра */
.aip-table tbody tr:nth-child(even), 
.aip-price-table tbody tr:nth-child(even),
.aip-related-prices-table tbody tr:nth-child(even) {
    background-color: #fbfbfb;
}

/* ХОВЕР ЕФЕКТ (ПОВЕРНУЛИ ДЛЯ ВСІХ ТАБЛИЦЬ) */
.aip-table tbody tr:hover td, 
.aip-price-table tbody tr:hover td,
.aip-related-prices-table tbody tr:hover td { /* Додано сюди */
    background-color: #e8f5e9 !important; /* Світло-зелений при наведенні */
    transition: background-color 0.2s ease;
    cursor: default;
}

/* --- 6. ТАБИ FLATSOME & WOOCOMMERCE (FINAL FIX) --- */

/* --- 7. ЦІНИ ТА КНОПКИ --- */
.aip-price-table td:last-child, .aip-related-prices-table td:last-child {
    text-align: right; font-weight: 700; white-space: nowrap;
}
.aip-price-table del { color: #bbb; font-size: 0.9em; margin-right: 8px; font-weight: normal; }
.aip-price-table ins { text-decoration: none; color: #e53935; font-size: 1.1em; }

.aip-price-btn {
    display: inline-flex; align-items: center; justify-content: flex-end;
    text-decoration: none !important; color: #333; font-weight: 700; transition: color 0.2s ease;
}
.aip-price-btn .dashicons { font-size: 18px; margin-left: 5px; color: #ccc; transition: transform 0.2s ease, color 0.2s ease; margin-top: 3px; }
.aip-price-btn:hover { color: #e53935; }
.aip-price-btn:hover .dashicons { color: #e53935; transform: translateX(4px); }


/* --- 8. БЕЙДЖІ (CANDY) --- */
table .aip-badge {
    display: inline-block; font-size: 10px; font-weight: 800; padding: 4px 10px;
    border-radius: 20px; margin-left: 8px; color: #fff !important;
    text-transform: uppercase; line-height: 1.2; vertical-align: middle;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2); border: none; text-decoration: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.3);
    background-image: linear-gradient(to bottom, rgba(255,255,255,0.15), rgba(0,0,0,0.05));
    transition: transform 0.2s ease, box-shadow 0.2s ease; white-space: nowrap;
}
table .aip-badge:hover { transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.3); }

table .aip-badge.badge-price   { background-color: #43a047 !important; background: linear-gradient(135deg, #66bb6a, #43a047) !important; }
table .aip-badge.badge-popular { background-color: #ffa000 !important; background: linear-gradient(135deg, #ffca28, #ffa000) !important; color: #fff !important; }
table .aip-badge.badge-new     { background-color: #1976d2 !important; background: linear-gradient(135deg, #42a5f5, #1976d2) !important; }
table .aip-badge.badge-premium { background-color: #7b1fa2 !important; background: linear-gradient(135deg, #ab47bc, #7b1fa2) !important; }
table .aip-badge.badge-sale    { background-color: #d32f2f !important; background: linear-gradient(135deg, #ef5350, #d32f2f) !important; }
table .aip-badge.badge-rating  { background-color: #00796b !important; background: linear-gradient(135deg, #26a69a, #00796b) !important; }


/* --- 9. АКЦЕНТНІ БЛОКИ --- */
.aip-accent-block { border-left: 6px solid; border-top: 1px solid transparent; border-right: 1px solid transparent; border-bottom: 1px solid transparent; padding: 10px; }
.aip-accent-block:hover { border-top-color: #e0e0e0; border-right-color: #e0e0e0; border-bottom-color: #e0e0e0; }

.aip-tip-block { border-left-color: #0073aa; background: #f4faff; }
.aip-tip-block strong { color: #0073aa; }
.aip-tip-block:hover { border-left-color: #005a87; }

.aip-warning-block { border-left-color: #ffb900; background: #fffbf0; }
.aip-warning-block strong { color: #d59600; }
.aip-warning-block:hover { border-left-color: #e5a600; }

.aip-fact-block { border-left-color: #826eb4; background: #fbfaff; }
.aip-fact-block strong { color: #826eb4; }
.aip-fact-block:hover { border-left-color: #6b549e; }


/* --- 10. ПІДСУМОК ТА ІНШЕ --- */

/* --- 11. СПОРІДНЕНІ КАТЕГОРІЇ --- */
.aip-related-terms-wrapper { margin: 0 20px; padding-top: 20px; border-top: 1px solid #eee; overflow: hidden; }
.aip-related-terms-list { 
    display: flex; flex-wrap: nowrap; gap: 10px; overflow-x: auto; 
    padding: 5px 5px 15px 5px; margin: -5px -5px 0 -5px; 
    -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: #ccc transparent; 
}
.aip-related-terms-list::-webkit-scrollbar { height: 4px; }
.aip-related-terms-list::-webkit-scrollbar-track { background: transparent; }
.aip-related-terms-list::-webkit-scrollbar-thumb { background-color: #ddd; border-radius: 4px; }

.aip-related-term-button {
    flex: 0 0 auto; display: inline-block; padding: 8px 16px; font-size: 13px; font-weight: 500; 
    text-decoration: none !important; color: #555; background-color: #f5f5f5; 
    border-radius: 20px; transition: all 0.2s ease; border: 1px solid transparent; white-space: nowrap;
}
.aip-related-term-button:hover { background-color: #2196F3; color: #fff; border-color: #2196F3; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(33, 150, 243, 0.3); }


/* --- 12. ДОДАТКОВІ БЛОКИ --- */
.aip-related-posts-block { padding: 25px; border-left: 6px solid #3498db; background: #f8f9fa; border-top: 1px solid transparent; border-right: 1px solid transparent; border-bottom: 1px solid transparent; }
.aip-related-posts-block:hover { border-top-color: #e0e0e0; border-right-color: #e0e0e0; border-bottom-color: #e0e0e0; border-left-color: #217dbb; }
.aip-related-posts-block .aip-related-title { border-bottom: 2px solid #eee; padding-bottom: 15px; margin-bottom: 20px; font-size: 1.3em; margin-top: 0; color: #2c3e50; }
.aip-related-posts-block .aip-related-list { list-style: none; padding: 0; margin: 0; }
.aip-related-posts-block .aip-related-list li { margin-bottom: 15px; padding-left: 30px; position: relative; }
.aip-related-posts-block .aip-related-list li::before { content: "\1F4C4"; position: absolute; left: 0; top: 2px; font-size: 1.2em; filter: grayscale(100%); transition: filter 0.3s ease, transform 0.3s ease; }
.aip-related-posts-block .aip-related-list li:hover::before { filter: grayscale(0%); transform: scale(1.2); }

/* --- БЛОК "ПРО АВТОРА" (FIXED AVATAR) --- */
.aip-author-box { 
    gap: 25px; 
    align-items: flex-start; /* Вирівнюємо по верху, а не по центру */
    border-left: 6px solid #2196F3; 
    background: #f9f9f9; 
    border-top: 1px solid transparent; 
    border-right: 1px solid transparent; 
    border-bottom: 1px solid transparent; 
    padding-left: 20px;
    padding-right: 20px;
}
.aip-author-box:hover {
    border-top-color: #e0e0e0;
    border-right-color: #e0e0e0;
    border-bottom-color: #e0e0e0;
    border-left-color: #1976D2;
}
.aip-author-box .aip-author-avatar { 
    border-radius: 50% !important; 
    width: 90px !important; 
    height: 90px !important; 
    min-width: 90px !important; /* Забороняємо стискання */
    object-fit: cover !important; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); 
    border: 3px solid #fff;
    flex: 0 0 90px !important; /* Забороняємо flex-стискання */
    margin: 0 !important; /* Прибираємо можливі відступи lazy load */
}
.aip-author-box .aip-author-name { margin-top: 0; margin-bottom: 8px; color: #333; }
@media (max-width: 600px) { .aip-author-box { flex-direction: column; align-items: center; text-align: center; } }


/* --- 13. ТАБИ FLATSOME & WOOCOMMERCE (FINAL FIX) --- */

/* 1. Кнопки табів (Universal Fix) */

/* Стилізуємо посилання всередині будь-яких табів WooCommerce */
.woocommerce-tabs ul.tabs li a,
.tabbed-content .nav-pills li a {
    border-radius: 25px !important;
    padding: 10px 25px !important;
    font-weight: 700 !important;
    margin-right: 10px !important;
    transition: all 0.3s ease !important;
    background-color: #f5f5f5 !important; 
    border: 1px solid transparent !important;
    color: #555 !important;
    text-transform: uppercase !important;
    font-size: 13px !important;
}

/* Активна кнопка (Коли LI має клас active) */
.woocommerce-tabs ul.tabs li.active a,
.tabbed-content .nav-pills li.active a {
    background-color: #4CAF50 !important;
    color: #fff !important;
    border-color: #4CAF50 !important;
    box-shadow: 0 6px 12px rgba(76, 175, 80, 0.3) !important;
}

/* Прибираємо стандартні стилі контейнера кнопок */
.woocommerce-tabs ul.tabs {
    border-bottom: none !important;
    margin-bottom: 0px !important;
    padding: 2px !important;
    overflow: visible !important; /* Щоб тінь не обрізалася */
}

/* Прибираємо стандартні рамки та фони у li */
.woocommerce-tabs ul.tabs li {
    border: none !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Прибираємо псевдоелементи (трикутники тощо) */
.woocommerce-tabs ul.tabs li:before,
.woocommerce-tabs ul.tabs li:after,
.woocommerce-tabs ul.tabs li a:before,
.woocommerce-tabs ul.tabs li a:after {
    display: none !important;
}

/* 2. КОНТЕЙНЕР ТАБІВ (Скидаємо ВСЕ) */
.woocommerce-tabs,
.tabbed-content,
.woocommerce-tabs .tab-panels, /* Додатковий рівень в Flatsome */
.tabbed-content .tab-panels {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 30px 0 !important;
}

/* 3. ПАНЕЛЬ КОНТЕНТУ (Тут живе "Картка") */
.woocommerce-tabs .panel,
.tabbed-content .tab-panels .panel {
    background: #fff !important;
    border: 1px solid #f0f0f0 !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06) !important;
    padding: 30px !important;
    margin-top: 0px !important; /* Відступ від кнопок */
    animation: fadeIn 0.4s ease-in-out;
}
.tabbed-content .tab-panels .panel:not(.active) { display: none !important; }

/* 4. ТАБЛИЦЯ ВСЕРЕДИНІ (Краса) */
.woocommerce-tabs .panel table,
.tabbed-content .panel table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    border: 1px solid #eee; border-radius: 12px; overflow: hidden;
    margin-top: 20px; background: #fff;
}
.woocommerce-tabs .panel table th, .woocommerce-tabs .panel table td {
    padding: 12px 15px !important; border-bottom: 1px solid #f0f0f0;
}

/* Шапка таблиці (Тільки ПЕРШИЙ рядок таблиці, якщо немає thead) */
.woocommerce-tabs .panel table tr:first-child td,
.woocommerce-tabs .panel table tr:first-child th {
    background-color: #4CAF50 !important;
    color: #fff !important;
    font-weight: 700;
    text-transform: uppercase;
}

/* ФІКС ПОДВІЙНОЇ ШАПКИ: Якщо є thead, то стилізуємо його, а перший рядок тіла - ні */
.woocommerce-tabs .panel table thead th {
    background-color: #4CAF50 !important;
    color: #fff !important;
}
.woocommerce-tabs .panel table thead + tbody tr:first-child td {
    background-color: #fff !important; /* Скидаємо зелений */
    color: #333 !important;
    font-weight: normal;
}

/* AIP Table Wrapper Fix */
.woocommerce-tabs .panel .aip-table-wrapper {
    box-shadow: none !important; border: none !important; background: transparent !important; padding: 0 !important; margin: 0 !important;
}


/* ==========================================================================
   ЧАСТИНА 14: ГЛОБАЛЬНИЙ "CANDY" СТИЛЬ (REFACTORED FIX)
   Розділення логіки: Контейнер тримає простір, Картка (Box) робить красу.
   ========================================================================== */

/* 1. КОНТЕЙНЕР (ОБОЛОНКА) */
/* Він має бути прозорим і дозволяти вихід за межі */
.product-small .col-inner, 
.post-item .col-inner {
    background-color: transparent !important; 
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 5px;
    height: 100%;
    overflow: visible !important; /* !ВАЖЛИВО: Дозволяє тіні і руху виходити за межі */
    position: relative;
    z-index: 1; /* Базовий рівень */
    transition: z-index 0s linear 0s; /* Миттєва зміна шару */
}

/* 2. КАРТКА (ВІЗУАЛ) */
/* Вся краса переноситься сюди. box - це те, що ми бачимо */
.product-small .box, 
.post-item .box,
.box-blog-post .box {
    background-color: #fff; 
    border-radius: 16px; 
    border: 1px solid #f0f0f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04); 
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
    overflow: hidden; /* !ВАЖЛИВО: Обрізає кути картинки всередині картки */
    height: 100%;
    position: relative;
}

/* 3. ЕФЕКТ ПРИ НАВЕДЕННІ (HOVER) */
@media (min-width: 1024px) {
    /* Піднімаємо пріоритет контейнера, щоб він перекрив сусідів */
    .product-small:hover .col-inner, 
    .post-item:hover .col-inner {
        z-index: 100 !important; 
    }

    /* Рухаємо саму картку всередині */
    .product-small:hover .box, 
    .post-item:hover .box,
    .box-blog-post:hover .box {
        transform: translateY(-5px); 
        box-shadow: 0 15px 30px rgba(0,0,0,0.12); 
        border-color: #e0e0e0; 
    }
}

/* Виправлення внутрішніх відступів тексту */
.product-small .box-text, .post-item .box-text { padding: 15px 15px 20px 15px !important; }

/* 
   ⚠️ ГЛОБАЛЬНИЙ ФІКС ДЛЯ СЛАЙДЕРІВ (Щоб "голови" не різало в каруселях)
   Дозволяє елементам вилазити за межі рядка слайдера.
*/
.flickity-viewport,
.row-slider {
    overflow: visible !important;
}


/* --- КАРТКИ У ВІДЖЕТАХ (САЙДБАР/ФУТЕР) --- */
/* Тут лишаємо стару логіку, бо вони не в сітці */
.widget_recently_viewed_products li, 
.product_list_widget li, 
.widget_flatsome_recent_posts li {
    background-color: #fff; border-radius: 12px; border: 1px solid #f0f0f0; padding: 10px;
    margin-bottom: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.03); transition: all 0.3s ease; display: flex; align-items: center;
}
.widget_recently_viewed_products li:hover, .product_list_widget li:hover, .widget_flatsome_recent_posts li:hover {
    transform: translateX(5px); box-shadow: 0 4px 10px rgba(0,0,0,0.08); border-color: #e0e0e0;
}
.widget_recently_viewed_products li img, .product_list_widget li img {
    border-radius: 8px; width: 60px; height: 60px; object-fit: cover; margin-right: 10px; border: 1px solid #eee;
}
.widget_flatsome_recent_posts .badge-inner img, .widget_flatsome_recent_posts img { border-radius: 8px; }

/* --- КНОПКИ ТА ПОЛЯ --- */
#wrapper .button, 
#wrapper button.submit, 
#wrapper input[type="submit"] { 
    border-radius: 25px !important; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
    transition: all 0.3s ease; 
    font-weight: 700; 
}
#wrapper .button:hover, 
#wrapper button.submit:hover, 
#wrapper input[type="submit"]:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 6px 15px rgba(0,0,0,0.15); 
}
#wrapper input[type='text'], 
#wrapper input[type='email'], 
#wrapper textarea, 
#wrapper select { 
    border-radius: 8px !important; 
    border: 1px solid #e0e0e0; 
    padding: 10px; 
}
#wrapper input:focus, #wrapper textarea:focus { 
    border-color: #4CAF50 !important; 
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1) !important; 
}

/* --- БЕЙДЖІ ТЕМИ --- */
.badge-container .badge, 
.badge-container .badge-circle { 
    border-radius: 8px !important; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.2); 
    font-weight: 800; 
    letter-spacing: 0.5px; 
    padding: 4px 10px !important; 
    height: auto !important; 
    min-height: 24px; 
    line-height: 1.2 !important; 
    width: auto !important; 
}
.badge-inner { display: inline-block; vertical-align: middle; }

/* Фінальний штрих */
table tr:last-child td { border-bottom: none; }

/* =========================================
   FINAL TOUCHES: GLOBAL CANDY EXTENSION
   ========================================= */

/* --- 1. КАРТИНКИ В СТАТТЯХ (LAZY LOAD FRIENDLY) --- */
/* Стилізуємо будь-який figure або img всередині контенту */
.entry-content figure,
.wp-caption,
.entry-content img:not(.emoji) {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    padding: 10px;
    margin: 30px auto !important;
    max-width: 100%;
    height: auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: table; /* Центрування для figure */
}

/* Якщо img всередині figure, прибираємо подвійну рамку з img */
.entry-content figure img,
.wp-caption img {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 12px;
}

/* Ефект при наведенні */
.entry-content figure:hover,
.wp-caption:hover,
.entry-content img:not(.emoji):hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}

/* Підпис */
figcaption, .wp-caption-text {
    font-family: inherit;
    font-size: 0.95em;
    color: #555;
    margin-top: 12px;
    text-align: center;
    padding-top: 10px;
    border-top: 1px solid #f5f5f5;
    display: block; /* Гарантуємо показ */
}
figcaption::before, .wp-caption-text::before { content: '📷'; margin-right: 5px; opacity: 0.7; }


/* --- 2. БЛОК КОМЕНТАРІВ (comment-respond) --- */
#respond {
    background: #f9f9f9; /* Легкий фон */
    padding: 30px;
    border-radius: 16px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    margin-top: 40px;
    transition: all 0.3s ease;
}

#respond:hover {
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
    border-color: #e0e0e0;
    /* transform: translateY(-2px); - Для форми коментарів краще не рухати, щоб не збивати фокус */
}

#reply-title {
    font-size: 1.4em;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    display: block;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

/* Поля форми коментарів */
#respond textarea, 
#respond input[type="text"], 
#respond input[type="email"] {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}
#respond textarea:focus, 
#respond input:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}



/* ==========================================================================
   ЧАСТИНА 15 (FIXED V5): ФІНАЛЬНИЙ ПОЛІШИНГ
   ========================================================================== */

/* --- 1. ГЛОБАЛЬНІ КОНТЕЙНЕРИ --- */
.aip-price-table-wrapper, 
.aip-related-prices-wrapper {
    display: block; 
    border-radius: 16px; 
    overflow: hidden !important; 
    border: 1px solid #f0f0f0;
}

/* --- 2. ШАПКА (CAPTION - FIXED FORCE) --- */
/* Застосовуємо стилі конкретно до елемента caption всередині наших обгорток */
.aip-price-table-wrapper caption,
.aip-related-prices-wrapper caption,
.aip-price-table-caption,
.aip-related-prices-caption {
    background-color: #4CAF50 !important; /* Яскраво-зелений фон */
    color: #ffffff !important; /* Білий текст */
    
    padding: 15px 20px !important; 
    margin: 0 !important;
    border: none !important;
    
    font-weight: 700; 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
    caption-side: top;
}

/* СПЕЦІАЛЬНИЙ ФІКС ДЛЯ САЙДБАРУ */
/* Робимо так, щоб буква "П" не різалася і виглядало як на мобільному */
.aip-related-prices-wrapper caption,
.aip-related-prices-caption {
    text-align: left !important; /* Вирівнювання вліво */
    padding-left: 25px !important; /* Великий відступ зліва для безпеки літери "П" */
    font-size: 13px !important; /* Акуратний розмір шрифту */
    line-height: 1.4 !important;
}

/* Вирівнювання для основної таблиці - по центру */
.aip-price-table-caption {
    text-align: center !important;
}

/* --- 3. ОСНОВНА ТАБЛИЦЯ ЦІН (ПК - Таблиця, Моб - Картки) --- */
@media (min-width: 769px) {
    table.aip-price-table { display: table; width: 100%; }
    .aip-price-table thead { display: table-header-group; }
    /* Стиль шапки thead підлаштований під caption */
    .aip-price-table thead th { background: #f9f9f9 !important; color: #555 !important; border-bottom: 2px solid #eee; }
    
    .aip-price-table tr { display: table-row; }
    .aip-price-table td { display: table-cell; }
    .aip-price-desktop { display: inline; } .aip-price-mobile { display: none; }
    .aip-price-table .aip-summary-block {
    order: 10; margin: 0 !important; border-radius: 0 0 16px 16px !important; 
    border-top: 1px solid #eee; background: #f4fcf4; border-left: none;
    padding: 15px; font-size: 0.9em;
}
    .aip-price-table:not(:has(.aip-summary-block)) tr:last-child {
    border-radius: 0 0 16px 16px; border-bottom: none !important;
}
}

@media (max-width: 768px) {
    /* FIX ДЛЯ ЗЕЛЕНОГО БЛОКУ */
    .aip-price-table-wrapper { 
        display: flex; 
        flex-direction: column; 
        align-items: stretch; /* 👈 Розтягує елементи на всю ширину */
    }
    
    .aip-price-table-caption { 
        order: -1; 
        display: block !important;
        width: 100% !important; /* 👈 ПРИМУСОВА ШИРИНА */
        min-width: 100%;
        box-sizing: border-box; /* Враховуємо відступи */
        border-radius: 16px 16px 0 0; 
        text-align: center; /* На мобільному гарніше по центру */
    }
    
    table.aip-price-table, .aip-price-table tbody, .aip-price-table tr, .aip-price-table td { 
        display: block; width: 100%; border: none !important; 
    }
    .aip-price-table thead { display: none; }
    
    .aip-price-table tr {
        padding: 15px; padding-bottom: 45px; background: #fff; border-bottom: 1px solid #eee !important; position: relative;
    }
    .aip-price-table tr:last-child { border-radius: 0 0 16px 16px; }
    
    .aip-price-table td:first-child { padding: 0 !important; margin-bottom: 5px; }
    .aip-price-table td:first-child a { font-size: 15px; font-weight: 600; }
    
    .aip-price-table td:last-child {
        position: absolute; bottom: 15px; right: 15px; text-align: right; width: auto !important;
    }
    .aip-price-table .aip-badge { position: absolute; bottom: 15px; left: 15px; margin: 0 !important; }
    
    .aip-price-desktop { display: none; } .aip-price-mobile { display: inline; font-weight: 700; font-size: 15px; }
}
/* ПІДСУМОК */
.aip-price-table-wrapper .aip-summary-block {
    order: 10; margin: 0 !important; border-radius: 0 0 16px 16px !important; 
    border-top: 1px solid #eee; background: #f4fcf4; border-left: none;
    padding: 15px; font-size: 0.9em;
}
.aip-price-table-wrapper:not(:has(.aip-summary-block)) tr:last-child {
    border-radius: 0 0 16px 16px; border-bottom: none !important;
}

/* --- 4. ТАБЛИЦЯ "ПОРІВНЯЙТЕ" (САЙДБАР - SMART LIST) --- */
.aip-related-prices-wrapper {
    display: flex; flex-direction: column; height: auto !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}
.aip-related-prices-table thead { display: none; }
.aip-related-prices-table tbody { display: block; width: 100%; }

/* РЯДОК */
.aip-related-prices-table tr {
    display: flex; 
    flex-direction: column; 
    padding: 12px 15px; 
    border-bottom: 1px solid #f0f0f0 !important;
    background: #fff;
    transition: all 0.2s ease;
}

/* ХОВЕР */
.aip-related-prices-table tr:hover {
    background-color: #e8f5e9 !important;
    transform: translateX(3px);
    border-left: 3px solid #4CAF50;
    padding-left: 12px;
}

/* Назва */
.aip-related-prices-table td:first-child {
    display: block; width: 100%;
    font-size: 14px; font-weight: 600; line-height: 1.3; color: #333;
    margin-bottom: 6px;
}
.aip-related-prices-table td:first-child a {
    text-decoration: none; color: #333; transition: color 0.2s;
}
.aip-related-prices-table tr:hover td:first-child a { color: #2e7d32; }

/* Ціна */
.aip-related-prices-table td:last-child {
    display: block; width: 100%;
    text-align: right; 
    font-size: 13px; color: #777; font-weight: 500;
    background: #fcfcfc; 
    padding: 4px 8px !important;
    border-radius: 6px;
    align-self: flex-end; 
    width: auto !important;
    transition: background-color 0.2s ease;
}

/* Прибираємо фон ціни при наведенні */
.aip-related-prices-table tr:hover td:last-child {
    background-color: transparent !important;
    color: #2e7d32;
}

.aip-related-prices-table td:last-child .dashicons {
    font-size: 14px; vertical-align: middle; width: 14px; height: 14px; opacity: 0.7;
}

/* ПІДСУМОК */
.aip-related-prices-wrapper .aip-summary-block {
    order: 10; margin: 0 !important; border-radius: 0 0 16px 16px !important; 
    border-top: 1px solid #eee; background: #f4fcf4; border-left: none;
    padding: 15px; font-size: 0.9em;
}
.aip-related-prices-wrapper:not(:has(.aip-summary-block)) tr:last-child {
    border-radius: 0 0 16px 16px; border-bottom: none !important;
}


/* --- МОБІЛЬНА АДАПТАЦІЯ ВІДСТУПІВ (FINAL) --- */
@media (max-width: 768px) {
    
    /* Зменшуємо відступи всередині карток-табів */
    .woocommerce-tabs .panel,
    .tabbed-content .tab-panels .panel {
        padding: 10px !important; /* Було 30px */
        border-radius: 12px !important; /* Трохи менше закруглення */
        margin-top: 15px !important;
    }

    /* Якщо це таблиця всередині таба - даємо їй максимум місця */
    .woocommerce-tabs .panel table.aip-table,
    .tabbed-content .panel table.aip-table {
        margin-top: 10px !important;
        border-radius: 8px;
    }
    
    /* Зменшуємо шрифт в комірках */
    .aip-table th, .aip-table td {
        padding: 10px !important;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .woocommerce-tabs ul.tabs li a {
        padding: 8px 15px !important;
        font-size: 11px !important;
        white-space: nowrap;
    }
}

/* ==========================================================================
   💎 sewerin EDITORIAL SYSTEM v2.3 (OPTIMIZED & CLEAN)
   ========================================================================== */

/* 1. Глобальні змінні */
:root {
    --ed-black: #111;
    --ed-gray: #bbb;
    --ed-line: rgba(0,0,0,0.08);
    --ed-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* 2. Ізоляція всього редакційного контенту */
.sewerin-scope {
    /* Обгортка гарантує відсутність конфліктів зі стилями теми */
}

/* 3. Приховування зайвого (лише критичні !important) */
.sewerin-scope .meta-comments,
.sewerin-scope .meta-divider,
.sewerin-scope .badge-post-comments,
.sewerin-scope .from_the_blog_comments,
.sewerin-scope .from_the_blog_date,
.sewerin-scope .blog-archive .read-more-button,
.sewerin-scope .is-divider,
.sewerin-scope .entry-divider,
.sewerin-scope .absolute-footer,
.sewerin-scope .footer-primary,
.sewerin-scope .hero-dynamic-wrapper .post-meta,
.sewerin-scope .dd-dynamic-card .post-meta,
.sewerin-scope .dd-dynamic-card .from_the_blog_excerpt {
    display: none !important; /* Flatsome часто використовує !important для цих елементів */
}

/* 4. Header & Navigation */
.sewerin-scope #masthead,
.sewerin-scope .header-main {
    height: 70px;
    line-height: 70px;
}
.sewerin-scope .header-wrapper {
    padding-top: 0;
}

/* 5. Editorial Menu */
.sewerin-scope .menu-editorial {
    font-family: var(--ed-font);
}
.sewerin-scope .editorial-col {
    padding: 0 40px;
}
.sewerin-scope .menu-editorial .col-narrow {
    flex: 0 0 22%;
    max-width: 22%;
}
.sewerin-scope .menu-editorial .col-wide {
    flex: 0 0 34%;
    max-width: 34%;
}

.sewerin-scope .editorial-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    position: relative;
}
.sewerin-scope .editorial-header::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: #000;
    opacity: 0.15;
    transition: opacity 0.3s ease;
}
.sewerin-scope .editorial-header:hover::after {
    opacity: 1;
}

.sewerin-scope .editorial-index {
    font-size: 10px;
    font-weight: 700;
    color: #ccc;
    letter-spacing: 1px;
}
.sewerin-scope .editorial-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ed-black);
    text-decoration: none;
    line-height: 1;
}

.sewerin-scope .editorial-icon {
    width: 14px;
    height: 14px;
    stroke: var(--ed-black);
    stroke-width: 1.2;
    fill: none;
    opacity: 0.6;
    transition: stroke-width 0.3s ease;
}
.sewerin-scope .editorial-header:hover .editorial-icon {
    stroke-width: 1.6;
    opacity: 1;
}

/* Links & Hover */
.sewerin-scope .editorial-link {
    font-size: 15px;
    line-height: 2.0;
    color: #333;
    display: block;
    position: relative;
    text-decoration: none;
    width: fit-content;
    transition: 0.2s;
}
.sewerin-scope .editorial-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 2px;
    width: 0;
    height: 1px;
    background: #000;
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.sewerin-scope .editorial-link:hover::after {
    width: 100%;
}

@media (hover: hover) {
    .sewerin-scope .menu-editorial:has(a:hover) a:not(:hover) {
        color: #e0e0e0;
    }
    .sewerin-scope .menu-editorial:has(a:hover) .editorial-icon,
    .sewerin-scope .menu-editorial:has(a:hover) .editorial-index {
        opacity: 0.2;
    }
    .sewerin-scope .menu-editorial:has(a:hover) .editorial-header::after {
        opacity: 0.05;
    }
    .sewerin-scope .menu-editorial a:hover {
        color: #000;
        opacity: 1;
    }
}

/* 6. Feature & Deep Dive Cards */
.sewerin-scope .editorial-feature-wrapper .box {
    box-shadow: none;
    background: transparent;
    border: none;
}
.sewerin-scope .editorial-feature-wrapper .box-image {
    margin-bottom: 15px;
    border-radius: 0;
}
/* --- Виправлення відступів для картки "Вибір редакції" --- */

.sewerin-scope .editorial-feature-wrapper .box-text {
    padding-top: 20px !important;    /* Відступ від картинки зверху */
    padding-bottom: 15px !important; /* Відступ знизу */
    padding-left: 0 !important;      /* З боків залишаємо 0, щоб рівнялось по картинці */
    padding-right: 0 !important;
    text-align: left;
}

/* Додатково: відступ самого заголовка, щоб не злипався з іншим текстом */
.sewerin-scope .editorial-feature-wrapper h5.post-title {
    margin-bottom: 10px !important;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 700;
    margin-top: 0;
    text-transform: none;
    color: #000;
    letter-spacing: -0.3px;
}
.sewerin-scope .editorial-feature-wrapper h5.post-title {
    font-size: 18px;
    line-height: 1.3;
    font-weight: 700;
    margin-top: 0;
    text-transform: none;
    color: #000;
    letter-spacing: -0.3px;
}

.sewerin-scope .dd-dynamic-card .box {
    border-radius: 0;
    overflow: hidden;
    height: 100%;
}
.sewerin-scope .dd-dynamic-card .box-image {
    height: 500px;
    position: relative;
}
.sewerin-scope .dd-dynamic-card .box-image::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
    z-index: 1;
}
.sewerin-scope .dd-dynamic-card .box-text {
    z-index: 2;
    padding: 0 0 30px 20px;
}
.sewerin-scope .dd-dynamic-card .post-title {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* 7. Hero System */
.sewerin-scope .hero-immersive {
    position: relative;
    overflow: hidden;
}
.sewerin-scope .hero-dynamic-wrapper .box-text {
    text-align: left;
    padding-left: 10%;
}

.sewerin-scope .hero-dynamic-wrapper .post-title {
    font-family: var(--ed-font);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -1px;
    color: #fff;
    text-shadow: 0 2px 30px rgba(0,0,0,0.6);
    max-width: 85%;
    margin-bottom: 10px;
}

.sewerin-scope .hero-dynamic-wrapper .is-xsmall {
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.9);
    border-left: 3px solid #d2a964;
    padding-left: 15px;
    margin-bottom: 15px;
    display: inline-block;
}

/* Hero Nav Dock */
.sewerin-scope .hero-nav-dock {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(0,0,0,0.05);
    backdrop-filter: blur(20px);
}
.sewerin-scope .hero-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    height: auto;
    transition: 0.3s ease;
    border-right: 1px solid rgba(0,0,0,0.08);
    text-decoration: none;
}
.sewerin-scope .hero-nav-item:hover {
    background: rgba(250, 250, 250, 0.95);
    box-shadow: inset 0 -2px 0 #000;
}
.sewerin-scope .hero-nav-title {
    margin-top: 8px;
    font-size: 10px;
    font-weight: 800;
    color: #222;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.sewerin-scope .hero-nav-icon {
    width: 24px;
    height: 24px;
    stroke: #222;
    stroke-width: 1.5;
    fill: none;
    opacity: 1;
}
.sewerin-scope .hero-nav-item.editorial .hero-nav-icon {
    fill: currentColor;
    stroke: none;
}

/* 8. Blog Archive */
/* =========================================
   💎 ARCHIVE HEADER & FILTERS FIX
   ========================================= */
/* Приховує стандартний заголовок та опис рубрики */
.archive .page-title-wrapper {
    display: none;
}

/* 1. ЗАГОЛОВОК КАТЕГОРІЇ */
.page-title-inner .page-title-heading h1 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 3.5rem !important; /* Величезний */
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: -1px !important;
    color: #111 !important;
    margin-bottom: 10px !important;
    text-align: center;
}

/* Прибираємо зайві відступи у контейнера */
.page-title-inner {
    padding-bottom: 10px !important; /* Менше відступу до кнопок */
    background: transparent !important;
}

/* 2. КНОПКИ ПІДКАТЕГОРІЙ (ФІЛЬТР) */
.sewerin-subcat-nav {
    margin-bottom: 40px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.category-filter-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.category-filter-row a {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 24px;
    border: 1px solid #e0e0e0;
    border-radius: 50px; /* Овальні */
    color: #555;
    text-decoration: none;
    transition: all 0.2s ease;
    background: #fff;
}

.category-filter-row a:hover,
.category-filter-row a.active {
    background: #000;
    color: #fff;
    border-color: #000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* 3. ОПИС ЗНИЗУ (Типографіка) */
.archive-description-bottom .entry-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    text-align: center; /* Або left, якщо тексту багато */
}
.archive-description-bottom p {
    margin-bottom: 20px;
}

/* =========================================
   9. Single Post (NUCLEAR ALIGNMENT FIX)
   ========================================= */
/* =========================================
   💎 SEVERIN META CONTAINER (FLEX PERFECT)
   ========================================= */

.sewerin-meta-container {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important; /* Центрування */
    gap: 15px !important;
    margin: 0 auto 25px auto !important;
    padding-bottom: 20px !important;
    border-bottom: 1px solid #eee !important; /* Тонка лінія знизу для краси */
    width: 100%;
    max-width: 600px; /* Щоб лінія не була на весь екран */
}

/* Елементи всередині */
.sewerin-meta-container .meta-item {
    display: flex !important;
    align-items: center !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    color: #999 !important;
    line-height: 1 !important;
}

/* Іконки (i class="icon-...") */
.sewerin-meta-container i {
    font-size: 16px !important;
    margin-right: 6px !important;
    color: #ccc;
}

/* Розділювач */
.sewerin-meta-container .meta-sep {
    color: #ddd;
    font-size: 14px;
}

/* Вбиваємо стилі плагінів, якщо вони прорвуться всередину */
.sewerin-meta-container span, 
.sewerin-meta-container p {
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 10. Mobile & Footer */
.sewerin-scope .nav-sidebar > li > a {
    font-weight: 800;
    text-transform: uppercase;
    color: #111;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 15px 20px;
}
.sewerin-scope .nav-sidebar ul.children li a {
    font-size: 14px;
    font-weight: 600;
    color: #444;
    padding-left: 30px;
}

.sewerin-scope .footer-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    opacity: 0.6;
    margin-bottom: 20px;
    display: block;
}
.sewerin-scope ul.footer-links a {
    font-size: 14px;
    color: #333;
    text-decoration: none;
    position: relative;
}
.sewerin-scope ul.footer-links a:hover {
    color: #000;
}
.sewerin-scope ul.footer-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 1px;
    background: #000;
    transition: 0.3s;
}
.sewerin-scope ul.footer-links a:hover::after {
    width: 100%;
}

.sewerin-scope .footer-form input[type="email"] {
    background: #f7f7f7;
    border: 1px solid #eee;
    border-radius: 0;
    height: 45px;
}
.sewerin-scope .footer-form button {
    background: #000;
    color: #fff;
    border-radius: 0;
    height: 45px;
    text-transform: uppercase;
    font-weight: 700;
}

.sewerin-scope .row-dashed > .col {
    border-right: 1px solid rgba(0,0,0,0.05);
}

/* 11. Mobile Media Queries */
@media (max-width: 768px) {
    .sewerin-scope .hero-immersive .flickity-viewport,
    .sewerin-scope .hero-dynamic-wrapper .box-image {
        height: 500px;
    }
    .sewerin-scope .hero-dynamic-wrapper .post-title {
        font-size: 1.5rem;
    }
    .sewerin-scope .hero-dynamic-wrapper .box-text {
        padding-left: 20px;
        padding-right: 20px;
        bottom: 25%;
    }
    
    .sewerin-scope .hero-nav-item {
        flex-direction: row;
        gap: 10px;
        height: 70px;
        justify-content: flex-start;
        padding-left: 20px;
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    .sewerin-scope .hero-nav-title {
        margin-top: 0;
        font-size: 9px;
    }
    .sewerin-scope .hero-nav-icon {
        width: 20px;
        height: 20px;
    }
    .sewerin-scope .hero-immersive .flickity-prev-next-button {
        display: none;
    }

    .sewerin-scope body.single-post h1.entry-title {
        font-size: 1.6rem;
    }
    .sewerin-scope .menu-editorial,
    .sewerin-scope .editorial-col {
        padding-left: 20px;
        padding-right: 20px;
    }
    .sewerin-scope .dd-dynamic-card .box-image {
        height: 350px;
    }
    
    /* Акуратна заміна атрибутного селектора */
    .sewerin-scope .aip-weekly-title {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* =========================================
   💎 SINGLE POST FIX (FONT & META v2)
   ========================================= */

/* 1. ЗАГОЛОВОК (Жорсткий фікс шрифту) */
body.single-post h1.entry-title,
body.single-post .entry-header h1 {
    /* Прописуємо шрифт напряму, без змінних */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 2.2rem !important;
    line-height: 1.1 !important;
    font-weight: 800 !important;
    text-transform: none !important;
    color: #111 !important;
    text-align: center !important;
    max-width: 900px;
    margin: 20px auto 30px auto !important; /* Відступи */
}

/* =========================================
   💎 2. НОВИЙ КОНТЕЙНЕР МЕТА-ДАНИХ (PERFECT ALIGN)
   ========================================= */

.sewerin-meta-container {
    display: flex !important;
    align-items: center !important; /* Центрування по вертикалі всього рядка */
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
    margin: 0 auto 30px auto !important;
    padding-bottom: 20px !important;
    border-bottom: 1px solid #eee !important;
    width: 100%;
    max-width: 600px;
    line-height: 1 !important; /* Скидаємо висоту рядка */
}

/* Елементи (Кожен блок: іконка + текст) */
.sewerin-meta-container .meta-item {
    display: inline-flex !important; /* Робимо блок гнучким всередині */
    align-items: center !important;  /* Центруємо іконку і текст між собою */
    height: 20px !important;         /* Фіксуємо висоту, щоб було рівно */
    
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    color: #999 !important;
}

/* =========================================
   💎 FIX: NO LINE BREAKS (INLINE MODE)
   ========================================= */

/* 1. Робимо самі блоки (перегляди, час) гнучкими рядками */
.sewerin-meta-container .meta-item,
.sewerin-meta-container .post-views {
    display: inline-flex !important; /* Тільки в рядок! */
    align-items: center !important;
    flex-direction: row !important;
    white-space: nowrap !important; /* Забороняємо переноси тексту */
    width: auto !important;
}

/* 2. Елементи всередині (іконки, текст) */
.sewerin-meta-container span, 
.sewerin-meta-container p,
.sewerin-meta-container div,
.post-views-count {
    display: inline-block !important; /* БУЛО block -> СТАЛО inline-block */
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    position: relative;
    top: 1px !important; /* Мікро-зсув залишаємо */
}

/* 3. Окремо для іконки (щоб не прилипала) */
.sewerin-meta-container .meta-icon,
.sewerin-meta-container .dashicons {
    display: inline-block !important;
    margin-right: 6px !important;
}

/* =========================================
   💎 FEATURED SLIDER FIX (READABILITY)
   ========================================= */

/* 1. Затемнення картинки (Overlay) */
.featured-posts .box-image .image-cover::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.1) 100%);
    pointer-events: none;
}

/* 2. Текст: Тінь і Позиція */
.featured-posts .box-text {
    text-shadow: 0 2px 10px rgba(0,0,0,0.8); /* Чорна тінь під літерами */
}

.featured-posts .post-title {
    font-weight: 800 !important;
    text-transform: uppercase !important;
    color: #fff !important;
}

/* 3. Кнопка "Читати далі" (якщо є) */
.featured-posts .button {
    background: transparent !important;
    border: 2px solid rgba(255,255,255,0.7) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3) !important;
}
.featured-posts .button:hover {
    background: #fff !important;
    color: #2D2D2D !important;
}


/* =========================================
   💎 CATEGORY FILTER (SUB-CATEGORIES)
   ========================================= */

/* Контейнер кнопок */
.category-filter-row {
    display: flex !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    margin: 20px 0 40px 0 !important;
    padding: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Самі кнопки */
.category-filter-row a,
.nav-filters a {
    display: inline-block !important;
    padding: 10px 20px !important;
    margin: 5px !important;
    background-color: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 50px !important; /* Овальні кнопки */
    color: #333 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05) !important;
}

/* Активна кнопка і Ховер */
.category-filter-row a:hover,
.category-filter-row a.active,
.nav-filters a:hover,
.nav-filters a.active {
    background-color: #2D2D2D !important;
    color: #fff !important;
    border-color: #000 !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15) !important;
}
/* 
 * 💎 FIX: HIDE TOP DESCRIPTION
 * Приховуємо стандартний опис зверху, бо ми вже додали свій знизу.
 */
.archive-page-header .taxonomy-description {
    display: none !important;
}

/* 
 * 💎 FIX: ARCHIVE TITLE STYLING
 * Робимо заголовок рубрики великим і журнальним
 */

/* Селектор для заголовка на сторінці категорії */
.archive-page-header h1,
.page-title h1 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 3.5rem !important; /* Великий розмір */
    font-weight: 800 !important;   /* Жирний */
    text-transform: uppercase !important;
    letter-spacing: -1px !important;
    color: #111 !important;
    margin-top: 20px !important;
    margin-bottom: 30px !important;
    text-align: center !important;
    line-height: 1 !important;
}

/* На мобільному трохи менше */
@media (max-width: 768px) {
    .archive-page-header h1,
    .page-title h1 {
        font-size: 2.2rem !important;
    }
}

/* =========================================
   💎 EDITORIAL DESCRIPTION FIX (READABILITY)
   ========================================= */

/* 1. Контейнер опису (Внизу) */
.archive-description-bottom {
    background-color: #fcfcfc !important; /* Легкий сірий фон для відокремлення */
    border-top: 1px solid #eaeaea !important;
    padding: 80px 20px !important; /* Великі відступи зверху/знизу */
    margin-top: 60px !important;
}

/* 2. Обмеження ширини тексту (Золоте правило читання) */
.archive-description-bottom .col {
    max-width: 740px !important; /* Ідеальна ширина для ока */
    margin: 0 auto !important;   /* Центруємо колонку */
    float: none !important;      /* Прибираємо float від Flatsome */
    flex-basis: auto !important; /* Скидаємо flex */
    width: 100% !important;
}

/* 3. Типографіка (Журнальний стиль) */
.archive-description-bottom .entry-content,
.editorial-text-block {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, serif !important; /* Можна Georgia для шарму */
    font-size: 1.15rem !important; /* 18-19px */
    line-height: 1.8 !important;   /* Повітря між рядками */
    color: #333 !important;
    text-align: left !important;   /* Тільки ліворуч! */
}

/* 4. Заголовки всередині опису */
.archive-description-bottom h2, 
.archive-description-bottom h3 {
    margin-top: 40px !important;
    margin-bottom: 20px !important;
    font-weight: 700 !important;
    color: #2D2D2D !important;
}

/* 5. Перший абзац (Lead) */
.archive-description-bottom p:first-of-type {
    font-size: 1.25rem !important;
    color: #111 !important;
    margin-bottom: 30px !important;
}
/* =========================================
   ⚡ MOBILE PERFORMANCE FIX (NO LAG)
   ========================================= */

@media (max-width: 768px) {
    /* 1. Вимикаємо анімацію зуму в Hero */
    .hero-dynamic-wrapper .box-image, 
    .hero-dynamic-wrapper .image-cover,
    .hero-dynamic-wrapper .bg {
        animation: none !important;
        transform: none !important;
        transition: none !important;
    }
    
    /* 2. Примусова апаратна акселерація для плавності свайпу */
    .hero-immersive .flickity-slider,
    .hero-dynamic-wrapper .flickity-slider {
        will-change: transform;
    }
}

/* Стиль для кнопки "Назад" */
.nav-filters a.back-btn, 
.category-filter-row a.back-btn {
    border-color: #333 !important;
    color: #333 !important;
    background: transparent !important;
}
.nav-filters a.back-btn:hover, 
.category-filter-row a.back-btn:hover {
    background: #f0f0f0 !important;
    color: #2D2D2D !important;
}

/* =========================================
   💎 SMART TAGS BAR (CHIPS)
   ========================================= */

.sewerin-tags-bar {
    margin-bottom: 30px;
    margin-top: -20px; /* Підтягуємо ближче до кнопок категорій */
}

/* Контейнер з горизонтальним скролом */
.tags-scroll-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap; /* На десктопі переносимо */
    gap: 8px;
}

/* Лейбл "Популярні теми:" */
.tags-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: #bbb;
    margin-right: 10px;
    letter-spacing: 0.5px;
}

/* Самі чіпси (Tags) */
.tag-chip {
    display: inline-flex;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    background-color: #f5f5f5;
    padding: 4px 12px;
    border-radius: 6px; /* Трохи квадратніші, ніж категорії */
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

/* Хештег для стилю */
.tag-chip .hash {
    color: #ccc;
    margin-right: 3px;
    font-weight: 400;
}

/* Ховер */
.tag-chip:hover {
    background-color: #fff;
    border-color: #ddd;
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* 📱 МОБІЛЬНА АДАПТАЦІЯ (Horizontal Scroll) */
@media (max-width: 768px) {
    .tags-scroll-container {
        justify-content: flex-start; /* Вирівнювання вліво */
        flex-wrap: nowrap; /* Забороняємо перенос */
        overflow-x: auto; /* Вмикаємо скрол */
        padding-bottom: 10px; /* Місце для скролбару */
        padding-left: 20px; /* Відступ зліва */
        padding-right: 20px;
        margin-left: -20px; /* Компенсація відступів контейнера */
        margin-right: -20px;
        -webkit-overflow-scrolling: touch; /* Плавність на iOS */
        scrollbar-width: none; /* Ховаємо скролбар для краси */
    }
    
    .tags-scroll-container::-webkit-scrollbar {
        display: none;
    }

    .tags-label {
        display: none; /* Ховаємо слово "Теми" на телефоні для економії місця */
    }
    
    .tag-chip {
        flex: 0 0 auto; /* Не стискати */
        font-size: 12px;
        padding: 6px 14px;
    }
}

/* =========================================
   💎 SINGLE POST TAGS (BOTTOM)
   ========================================= */

/* Контейнер тегів */
.sewerin-post-tags-container {
    margin-top: 40px !important;
    margin-bottom: 30px !important;
    padding-top: 20px !important;
    border-top: 1px solid #eee !important; /* Тонка лінія, що відділяє текст від тегів */
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

/* Лейбл "Теми цієї статті:" */
.sewerin-post-tags-container .tags-label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #111;
    margin-right: 10px;
}

/* Список тегів (flex-wrap дозволяє переносити на новий рядок) */
.sewerin-post-tags-container .tags-list {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* 🚫 Приховуємо СТАНДАРТНІ теги Flatsome (щоб не дублювались) */
.entry-meta .tags, 
.article-tags {
    display: none !important;
}

/* Мобільна адаптація */
@media (max-width: 768px) {
    .sewerin-post-tags-container {
        flex-direction: column; /* Ставимо лейбл зверху, теги знизу */
        align-items: flex-start;
        gap: 15px;
    }
}


/* Стиль для відео-постів */
.aip-video-intro {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 25px;
    color: #444;
}
.aip-video-box {
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.aip-time-row:hover {
    background-color: #fcfcfc;
    padding-left: 5px;
    transition: all 0.2s;
}

/* =========================================
   🎬 VIDEO CARDS STYLES (SMOOTH ANIMATION)
   ========================================= */

/* 1. БАЗА: Коло (Фон кнопки) */
.type-aip_video .box-image::after,
.video-overlay div {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1); /* Початковий розмір */
    width: 60px;
    height: 60px;
    border: 2px solid #fff;
    border-radius: 50%;
    z-index: 9;
    background: rgba(0,0,0,0.4); /* Напівпрозорий чорний */
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    
    /* 🔥 МАГІЯ ТУТ: Плавний перехід для всіх властивостей */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important; 
}

/* 2. БАЗА: Трикутник (Стрілка) */
.type-aip_video .box-image::before,
.video-overlay div div {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-45%, -50%); /* Центрування трикутника */
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent #fff;
    z-index: 25;
    pointer-events: none;
    transition: all 0.3s ease !important;
}

/* 3. ЕФЕКТ ПРИ НАВЕДЕННІ (HOVER) */
/* Коли наводимо на всю картку - кнопка оживає */
.type-aip_video:hover .box-image::after,
.box:hover .video-overlay div {
    background: #ff0000 !important; /* YouTube Червоний (або зміни на свій #d2a964) */
    border-color: #ff0000 !important;
    transform: translate(-50%, -50%) scale(1.15) !important; /* Плавне збільшення */
    box-shadow: 0 10px 25px rgba(255, 0, 0, 0.4) !important; /* Світіння */
}

/* Трикутник теж трохи рухається для динаміки */
.type-aip_video:hover .box-image::before,
.box:hover .video-overlay div div {
    transform: translate(-40%, -50%);
}

/* 
 * 🎥 CLEAN VIDEO STYLE (FIXED)
 * Гарантує, що відео займає 100% ширини і стоїть по центру
 */
.video-container-clean iframe,
.video-container-clean video,
.wp-block-embed__wrapper iframe {
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 16/9;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: block;
    margin: 0 auto;
}

/* =========================================
   🎬 VIDEO CONTENT STYLES (Light Mode)
   ========================================= */

/* 1. Загальний текст */
.video-styled-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

/* 2. Заголовки всередині тексту (Інсайти, Таймкоди) */
.video-styled-text h3, 
.video-styled-text h4, 
.video-styled-text strong {
    color: #000;
    font-weight: 800;
    margin-top: 30px;
    display: block;
}

/* 3. Списки (Інсайти) - Робимо їх блоками */
.video-styled-text ul {
    background: #f4faff; /* Дуже світлий синій фон */
    border-left: 4px solid #2196F3; /* Синя лінія зліва */
    padding: 20px 20px 20px 40px; /* Відступи */
    border-radius: 0 12px 12px 0;
    margin: 20px 0;
    list-style: none; /* Прибираємо стандартні точки */
}

.video-styled-text ul li {
    margin-bottom: 10px;
    position: relative;
}

/* Своя іконка для списку (Галочка) */
.video-styled-text ul li::before {
    content: "✔";
    color: #2196F3;
    font-weight: bold;
    position: absolute;
    left: -25px;
    top: 0;
}

/* 4. Вердикт / Висновок */
/* Шукаємо абзац, який починається з "Вердикт:" або жирного тексту в кінці */
.video-styled-text p:last-of-type {
    background: #fff8e1; /* Світло-жовтий */
    border: 1px solid #ffecb3;
    padding: 20px;
    border-radius: 12px;
    font-weight: 500;
    color: #5d4037;
}

/* 5. Таймкоди (якщо вони є посиланнями) */
.video-styled-text a {
    color: #2196F3;
    text-decoration: none;
    border-bottom: 1px solid rgba(33, 150, 243, 0.3);
    transition: 0.2s;
}
.video-styled-text a:hover {
    background-color: rgba(33, 150, 243, 0.1);
    border-color: #2196F3;
}
/* =========================================
   🎬 CINEMA FILTERS STYLE
   ========================================= */

.video-filter-row .filter-btn {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 30px;
    color: #ccc;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.video-filter-row .filter-btn:hover {
    border-color: #fff;
    color: #fff;
    background: rgba(255,255,255,0.1);
}

/* Активна кнопка (для "Всі") */
.video-filter-row .filter-btn.active {
    background: #fff;
    color: #000;
    border-color: #fff;
}

/* 📱 VIDEO PAGE MOBILE FIX */
@media (max-width: 768px) {
    /* Зменшуємо відступи Hero-секції */
    .video-hero-section {
        padding-top: 15px !important;
        padding-bottom: 15px !important;
    }
    
    /* Зменшуємо заголовок на мобільному */
    .video-hero-section .entry-title {
        font-size: 1.6rem !important;
        margin-bottom: 15px !important;
    }
    
    /* Прибираємо бічні відступи для контейнера відео, щоб було ширше */
    .video-hero-section .row .col {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Таймкоди та текст */
    .video-styled-text {
        font-size: 1rem !important; /* Трохи менший шрифт */
    }
}

/* =========================================
   💎 FIX: HOME VIDEO SLIDER TEXT COLOR
   ========================================= */

/* 1. Заголовок відео (робимо чорним) */
.section.dark .type-aip_video .box-text h5.post-title {
    color: #111 !important;
}

/* 2. Напис "Дивитись" (робимо темно-сірим) */
.section.dark .type-aip_video .box-text .is-xsmall {
    color: #666 !important;
}

/* 3. При наведенні на "Дивитись" - стає чорним */
.section.dark .type-aip_video .box:hover .box-text .is-xsmall {
    color: #000 !important;
}

/* =========================================
   💎 FIX: JOURNAL SECTIONS ROUNDING
   Повертаємо заокруглення для блоку "Розділи журналу" (Deep Dive)
   ========================================= */

/* 1. Заокруглюємо саму картку */
.dd-dynamic-card .box {
    border-radius: 16px !important;
    overflow: hidden !important; /* Обрізає все, що виходить за межі радіусу */
    transform: translateZ(0); /* Фікс для Safari, щоб кути не мерехтіли */
}

/* 2. Заокруглюємо контейнер картинки */
.dd-dynamic-card .box-image, 
.dd-dynamic-card .image-cover {
    border-radius: 16px !important;
}

/* 3. Гарантуємо, що при наведенні тінь працює (перестраховка) */
.dd-dynamic-card .col-inner {
    overflow: visible !important; 
    border-radius: 0 !important; /* Зовнішній контейнер має бути без рамки, щоб не різати тінь */
}

/* =========================================
   🚫 HIDE DUPLICATE VIDEO (CONTENT AREA FIX)
   Приховуємо відеоплеєри всередині тексту, 
   щоб залишити тільки головне відео зверху.
   ========================================= */

/* 1. Ховаємо YouTube iframe та стандартні відео */
.video-styled-text iframe,
.video-styled-text video,
.video-styled-text .wp-video {
    display: none !important;
}

/* 2. Ховаємо блоки WordPress Embed (Гутенберг) */
.video-styled-text .wp-block-embed,
.video-styled-text .wp-block-embed-youtube {
    display: none !important;
}

/* 3. Ховаємо контейнери Flatsome Video */
.video-styled-text .video-fit,
.video-styled-text .ux-video {
    display: none !important;
}

/* =========================================
   💎 FIX: ARCHIVE HERO & DUPLICATES
   1. Ховаємо дубль заголовка.
   2. Робимо банер прозорим (текст на фото).
   ========================================= */

/* 1. ХОВАЄМО СТАНДАРТНИЙ ЗАГОЛОВОК (Дубль) */
/* Ховаємо .page-title, АЛЕ НЕ наш .archive-main-title */
.blog-archive .page-title, 
.blog-archive .page-title-inner {
    display: none !important;
}

/* 2. РЕМОНТ БАНЕРА (Текст НА картинці) */

/* Прибираємо білий фон картки в Hero */
.featured-posts .box {
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/* Робимо текст білим і накладаємо поверх фото */
.featured-posts .box-text {
    position: absolute !important;
    bottom: 20px !important; /* Відступ знизу */
    left: 0 !important;
    width: 100% !important;
    padding: 20px 40px !important;
    text-align: center !important;
    z-index: 5;
    color: #fff !important;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5); /* Тінь для читабельності */
}

/* Колір заголовка статті в банері */
.featured-posts .post-title {
    color: #fff !important;
    font-size: 1.8rem !important;
}

/* Колір мета-даних і кнопки */
.featured-posts .is-xsmall, 
.featured-posts .button {
    color: #fff !important;
}

/* 3. ЗАТЕМНЕННЯ (Градієнт) */
/* Додаємо підкладку, щоб текст читався на світлих фото */
.featured-posts .box-image::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 60%) !important;
    pointer-events: none;
    z-index: 2;
}

/* Піднімаємо текст над градієнтом */
.featured-posts .box-text {
    z-index: 10;
}

/* =========================================
   💎 FIX: ARCHIVE HERO TEXT OVERLAY
   Прибираємо білий фон під текстом в Hero-банері категорії.
   ========================================= */

/* 1. Робимо фон тексту прозорим */
.sewerin-archive-hero .box-text,
.sewerin-archive-hero .box-text-inner {
    background-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
}

/* 2. Позиціонуємо текст абсолютно (поверх картинки) */
.sewerin-archive-hero .box-text {
    position: absolute !important;
    bottom: 30px !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 10;
    pointer-events: none; /* Щоб клік проходив крізь текст на посилання */
}

/* 3. Стилізуємо текст (Білий з тінню) */
.sewerin-archive-hero .post-title {
    color: #fff !important;
    text-shadow: 0 2px 20px rgba(0,0,0,0.8) !important; /* Сильна тінь для читабельності */
    margin-bottom: 0 !important;
}

/* 4. Прибираємо зайві відступи, які створювали "дірку" знизу */
.sewerin-archive-hero .box-image {
    margin-bottom: 0 !important;
}


/* =========================================
   💎 FIX: ARCHIVE HERO PADDING (AIR)
   Додаємо відступи тексту від країв картинки.
   ========================================= */

/* Десктоп: Великі красиві відступи */
.sewerin-archive-hero .box-text {
    padding-left: 60px !important;  /* Відступ зліва */
    padding-right: 60px !important; /* Відступ справа (щоб не лип до іншого краю) */
    padding-bottom: 40px !important; /* Відступ знизу */
    width: 100% !important;
}

/* Мобільний: Компактні відступи */
@media (max-width: 768px) {
    .sewerin-archive-hero .box-text {
        padding-left: 20px !important;
        padding-right: 20px !important;
        padding-bottom: 20px !important;
    }
    
    /* Трохи зменшимо шрифт заголовка на мобільному в цьому блоці */
    .sewerin-archive-hero .post-title {
        font-size: 1.5rem !important;
    }
}

/* =========================================
   📱 MOBILE ARCHIVE FIX (CLEANUP)
   ========================================= */

@media (max-width: 768px) {

    /* 1. HERO BANNER: Прибираємо білу смугу */
    .sewerin-archive-hero .box {
        background-color: transparent !important;
        box-shadow: none !important;
        border: none !important;
    }
    
    .sewerin-archive-hero .box-text {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        padding: 20px !important;
        background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%) !important; /* Градієнт замість білого */
    }

    .sewerin-archive-hero .post-title {
        font-size: 1.5rem !important; /* Менший шрифт */
        margin-bottom: 0 !important;
        color: #fff !important;
        text-shadow: 0 2px 10px rgba(0,0,0,0.8) !important;
    }

    /* 2. КНОПКИ КАТЕГОРІЙ: Зменшуємо відступи */
    .sewerin-subcat-nav {
        margin-top: 15px !important;
        margin-bottom: 15px !important;
        padding-bottom: 15px !important;
    }
    
    .category-filter-row {
        gap: 5px !important; /* Менший проміжок між кнопками */
    }
    
    .category-filter-row a {
        padding: 6px 16px !important; /* Компактніші кнопки */
        font-size: 11px !important;
    }

    /* 3. ЗАГОЛОВОК СТОРІНКИ (Назва рубрики) */
    .page-title-inner {
        padding: 30px 0 20px !important; /* Менше повітря зверху */
    }
    .page-title-inner .page-title-heading h1 {
        font-size: 2rem !important; /* Акуратний розмір */
        margin-bottom: 5px !important;
    }
}

/* =========================================
   💎 MASTER HEADER FIXES (NO WHITE BOX)
   ========================================= */

/* 1. Робимо текст на банері прозорим і білим */
.sewerin-archive-master-header .box-text, 
.sewerin-archive-master-header .box-text-inner,
.sewerin-archive-master-header .box {
    background-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 10 !important;
}

/* 2. Позиціонування тексту (щоб був на картинці) */
.sewerin-archive-master-header .box-text {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 10;
    /* Гарний градієнт знизу, щоб текст читався */
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%) !important;
    padding-bottom: 30px !important;
}

/* 3. Колір тексту заголовка */
.sewerin-archive-master-header .post-title {
    color: #fff !important;
    text-shadow: 0 2px 15px rgba(0,0,0,0.5) !important;
    margin-bottom: 0 !important;
    font-size: 2.5rem !important;
}

/* 4. Заокруглення картинки */
.sewerin-archive-master-header .box-image,
.sewerin-archive-master-header .image-cover img {
    border-radius: 16px !important;
}

/* =========================================
   💎 FIX: PREVENT BLACK TEXT ON HOVER
   Забороняємо тексту в Hero ставати чорним при наведенні.
   ========================================= */

/* 1. Заголовок і текст при наведенні на картку */
.hero-dynamic-wrapper .box:hover .post-title,
.hero-dynamic-wrapper .box:hover .box-text h5,
.hero-dynamic-wrapper .box:hover .is-xsmall,
.hero-dynamic-wrapper .box:hover .box-text {
    color: #fff !important; /* Тільки білий! */
    text-shadow: 0 2px 10px rgba(0,0,0,0.8) !important; /* Тримаємо тінь */
}

/* 2. Якщо заголовок є посиланням - теж білий */
.hero-dynamic-wrapper .post-title a:hover {
    color: #fff !important;
}

/* 3. Гарантуємо, що градієнт не зникає при наведенні */
.hero-dynamic-wrapper .box:hover .box-image::after {
    opacity: 1 !important;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%) !important;
}


/* =========================================
   📱 MOBILE HERO FIX (TEXT ON IMAGE)
   Примусово накладаємо текст на картинку в мобільній версії.
   ========================================= */

@media (max-width: 768px) {

    /* 1. Контейнер картки */
    /* Робимо фон прозорим і прибираємо відступи, які створюють "білий блок" */
    .hero-dynamic-wrapper .box,
    .hero-dynamic-wrapper .box-text {
        background-color: transparent !important;
        box-shadow: none !important;
        border: none !important;
    }

    /* 2. Позиціонування тексту */
    /* Абсолютне позиціонування "приклеює" текст до низу картинки */
    .hero-dynamic-wrapper .box-text {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        padding: 15px 20px 25px 20px !important; /* Відступи всередині */
        z-index: 10;
        
        /* Градієнт для читабельності тексту */
        background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 50%, transparent 100%) !important;
    }

    /* 3. Текст */
    /* Гарантуємо білий колір */
    .hero-dynamic-wrapper .post-title {
        color: #fff !important;
        font-size: 1.3rem !important; /* Оптимальний розмір для моб */
        line-height: 1.2 !important;
        margin-bottom: 5px !important;
        text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    }
    
    /* 4. Картинка */
    /* Задаємо висоту, щоб блок мав форму */
    .hero-dynamic-wrapper .box-image,
    .hero-dynamic-wrapper .flickity-viewport {
        height: 380px !important; /* Або 400px, як тобі зручніше */
        border-radius: 16px !important;
        overflow: hidden;
    }
    
    /* Розтягуємо фото на всю висоту */
    .hero-dynamic-wrapper .box-image img {
        height: 100% !important;
        object-fit: cover !important;
    }
}

/* =========================================
   📱 MOBILE HOME HERO FIX (TEXT UP)
   Піднімаємо текст на головній, щоб кнопки навігації його не закривали.
   ========================================= */

@media (max-width: 768px) {
    /* Додаємо великий відступ знизу для тексту, 
       рівний висоті кнопок (70px) + 20px повітря */
    .hero-immersive .hero-dynamic-wrapper .box-text {
        padding-bottom: 90px !important; 
    }
    
    /* Додатково: трохи зменшимо сам шрифт на головній, 
       якщо заголовок дуже довгий */
    .hero-immersive .hero-dynamic-wrapper .post-title {
        font-size: 1.3rem !important; /* Оптимально для моб */
    }
}

/* =========================================
   🚑 ARCHIVE VIDEO BUTTON: THE PHP FIX
   ========================================= */

/* 1. ВБИВАЄМО ВСІ СТАРІ КНОПКИ (Дублі) */
.video-overlay, 
.icon-play, 
.play-button {
    display: none !important;
}

/* 2. СТИЛІЗУЄМО НОВУ КНОПКУ (.sewerin-play-icon) */
/* Це порожній div, який ми розтягуємо на всю картинку для центрування */
.sewerin-play-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    pointer-events: none;
}

/* Малюємо КОЛО */
.sewerin-play-icon::after {
    content: "";
    width: 60px;
    height: 60px;
    background: rgba(0,0,0,0.5);
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Малюємо ТРИКУТНИК */
.sewerin-play-icon::before {
    content: "";
    position: absolute;
    /* Центруємо трикутник */
    top: 50%;
    left: 50%;
    transform: translate(-40%, -50%); 
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent #fff;
    z-index: 20; /* Поверх кола */
}

/* 3. ЕФЕКТ ПРИ НАВЕДЕННІ */
.post-item:hover .sewerin-play-icon::after,
.col-inner:hover .sewerin-play-icon::after {
    background: #ff0000;
    border-color: #ff0000;
    transform: scale(1.15);
}

/* =========================================
   💎 TEAM PAGE STYLES
   ========================================= */

/* Сітка */
.sewerin-team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 в ряд */
    gap: 30px;
    margin-top: 40px;
}

/* Мобільна адаптація сітки */
@media (max-width: 1024px) { .sewerin-team-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .sewerin-team-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .sewerin-team-grid { grid-template-columns: 1fr; } }

/* Картка */
.team-member-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.team-member-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border-color: #e0e0e0;
}

/* Аватар */
.member-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 3px solid #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}
.team-member-card:hover .member-avatar {
    transform: scale(1.05);
}

/* Ім'я */
.member-name {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.member-name a {
    color: #111;
    text-decoration: none;
}

/* Мета (кількість статей) */
.member-meta {
    font-size: 11px;
    color: #999;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

/* Біо */
.member-bio {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 20px;
}

/* Посилання */
.member-link {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #000;
    text-decoration: none;
    border-bottom: 1px solid #ddd;
    padding-bottom: 2px;
    transition: all 0.2s;
}
.member-link:hover {
    color: #d2a964;
    border-color: #d2a964;
}

/* =========================================
   💎 AUTHOR ARCHIVE HERO (CENTERED)
   ========================================= */

.sewerin-author-header {
    padding: 60px 0 50px;
    background-color: #fcfcfc;
    border-bottom: 1px solid #eaeaea;
    margin-bottom: 50px;
}

/* Центрування аватарки */
.author-hero-avatar {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.author-hero-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.author-hero-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #999;
    margin-bottom: 10px;
}

.author-hero-name {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 2.8rem;
    font-weight: 800;
    text-transform: none; /* За бажанням можна uppercase */
    color: #111;
    margin-bottom: 20px;
    line-height: 1.1;
}

.author-hero-bio {
    font-size: 1.15rem;
    line-height: 1.6;
    color: #444;
    margin-bottom: 25px;
    max-width: 700px; /* Обмежуємо ширину тексту для зручності */
    margin-left: auto;
    margin-right: auto;
}

.author-hero-meta span {
    display: inline-block;
    padding: 6px 18px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #333;
}
/* =========================================
   🚫 GHOST VIDEO FIX (Прибираємо дубль)
   ========================================= */

/* Ховаємо контейнер відео всередині тексту */
.video-styled-text .video-container,
.video-styled-text .video-resize-container,
.video-styled-text .ux-video {
    display: none !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Ховаємо сам iframe (плеєр), якщо він виліз без контейнера */
.video-styled-text iframe {
    display: none !important;
}

/* =========================================
   💎 FOOTER FORM: OUTLINE STYLE (MATCHING HERO)
   ========================================= */

/* 1. Налаштування контейнера форми */
.footer-form form {
    display: flex !important;
    gap: 10px !important; /* Відступ між полем і кнопкою */
}

/* 2. Поле вводу (Закруглене) */
.footer-form input[type="email"] {
    background-color: #f9f9f9 !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 50px !important; /* Форма пігулки */
    height: 45px !important;
    padding-left: 20px !important; /* Відступ тексту всередині */
    color: #333 !important;
    transition: all 0.3s ease;
}

/* Фокус на полі */
.footer-form input[type="email"]:focus {
    background-color: #fff !important;
    border-color: #000 !important;
    box-shadow: none !important;
}

/* 3. Кнопка (Стиль Outline - Рамка) */
.footer-form button {
    border-radius: 50px !important; /* Форма пігулки */
    background: transparent !important; /* Прозорий фон */
    border: 2px solid #000 !important; /* Чорна жирна рамка */
    color: #000 !important; /* Чорний текст */
    
    font-weight: 800 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    height: 45px !important;
    padding: 0 30px !important; /* Робимо кнопку ширшою */
    min-width: auto !important; /* Скидаємо фіксовану ширину, якщо була */
    transition: all 0.3s ease;
    cursor: pointer;
}

/* 4. Ефект при наведенні (Стає чорною) */
.footer-form button:hover {
    background: #2D2D2D !important;
    color: #fff !important;
    transform: translateY(-2px); /* Легкий підйом */
}

/* =========================================
   💎 AUTHOR HERO STYLING (BIG AVATAR FIX)
   ========================================= */

/* Аватарка: Велика і Виразна */
.author-hero-img {
    width: 220px !important;  /* БУЛО 140px -> РОБИМО 220px */
    height: 220px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid #fff;   /* Трохи товстіша біла рамка */
    box-shadow: 0 15px 40px rgba(0,0,0,0.1); /* Глибша тінь */
    display: inline-block;
    background-color: #fff;   /* На випадок прозорого PNG */
    transition: transform 0.3s ease;
}

/* Ефект при наведенні (легкий зум) */
.author-hero-img:hover {
    transform: scale(1.03);
}

/* Виділення жирного тексту в біографії */
.author-hero-bio strong {
    color: #000;
    font-weight: 700;
}

/* 📱 Мобільна адаптація */
@media (max-width: 768px) {
    .author-hero-name {
        font-size: 2.2rem !important;
    }
    .author-hero-bio {
        font-size: 1rem !important;
        padding: 0 15px;
    }
    /* На мобільному робимо трохи менше, але все одно великим */
    .author-hero-img {
        width: 160px !important; 
        height: 160px !important;
        border-width: 4px;
    }
}

/* Рекламні картки форматів */
.hover-up {
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.hover-up:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border-color: #e0e0e0;
}

/* =========================================
   📱 MOBILE TYPOGRAPHY FIX (ABOUT PAGE)
   Робимо гігантські заголовки читабельними на телефоні.
   ========================================= */

@media (max-width: 768px) {
    
    /* 1. Зменшуємо Заголовок H1 */
    /* Використовуємо селектор, щоб перебити inline-стилі */
    .section-content h1,
    .col-inner h1 {
        font-size: 2rem !important; /* Було 3.5rem. 2rem - це ідеально */
        line-height: 1.1 !important;
        letter-spacing: 0 !important; /* Прибираємо розрядку, бо місця мало */
        word-wrap: break-word; /* Дозволяємо перенос довгих слів, якщо треба */
    }
}    
/* =========================================
   💎 404 PAGE STYLES
   ========================================= */

/* 1. Гігантська цифра (Фон) */
.error-code {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: -5px;
    user-select: none; /* Щоб не виділялась мишкою */
}

/* 2. Стилізація Пошуку */
.search-404-wrapper .search-field {
    background-color: #f9f9f9 !important;
    border: 2px solid #eee !important;
    border-radius: 50px !important; /* Овальний */
    height: 55px !important;
    padding-left: 25px !important;
    font-size: 16px !important;
    color: #333 !important;
    transition: all 0.3s ease;
}

.search-404-wrapper .search-field:focus {
    background-color: #fff !important;
    border-color: #000 !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05) !important;
}

.search-404-wrapper .search-submit {
    background-color: #2D2D2D !important; /* Чорна кнопка */
    color: #fff !important;
    border-radius: 50px !important;
    height: 45px !important;
    width: 45px !important;
    min-width: 45px !important;
    margin: 5px !important; /* Відступ від краю поля */
}

/* 3. Адаптація для мобільного */
@media (max-width: 768px) {
    .error-code {
        font-size: 6rem !important; /* Менша цифра */
        margin-bottom: -20px !important;
    }
    .search-404-wrapper {
        max-width: 100% !important;
    }
}    
/* =========================================
   💬 VIDEO COMMENTS STYLING
   ========================================= */

/* Контейнер коментарів */
.video-comments-wrapper #respond {
    background: #f9f9f9;
    padding: 40px;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
}

/* Список коментарів */
.video-comments-wrapper .comment-list {
    margin-bottom: 40px;
}

.video-comments-wrapper .comment-body {
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
}

/* Аватарки коментаторів */
.video-comments-wrapper .comment-author img {
    border-radius: 50%;
    width: 50px;
    height: 50px;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Ім'я автора */
.video-comments-wrapper .fn {
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.9rem;
    color: #111;
}

/* Кнопка "Відправити" */
.video-comments-wrapper #submit {
    background: #000;
    color: #fff;
    border-radius: 30px;
    padding: 10px 30px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
}
.video-comments-wrapper #submit:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}