/**
 * Advanced Tab CM — Frontend styles
 * Базовые стили аккордеона. Цвета, шрифты и отступы настраиваются через Elementor.
 */

/* ===== Обёртка ===== */
.cm-tabs {
    width: 100%;
}

/* ===== Один таб ===== */
.cm-tab__item {
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
}

.cm-tab__item + .cm-tab__item {
    margin-top: 8px;
}

/* ===== Заголовок ===== */
.cm-tab__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    position: relative;
    outline: none;
}

.cm-tab__title--icon-left {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.cm-tab__title--icon-left .cm-tab__chevron {
    margin-right: 0;
    margin-left: auto;
    flex-shrink: 0;
}

.cm-tab__title:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -2px;
}

/* Текст заголовка */
.cm-tab__label {
    flex: 1;
    min-width: 0;
}

/* ===== Chevron иконка ===== */
.cm-tab__chevron {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease, color 0.2s ease;
    color: inherit;
}

.cm-chevron-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Поворот chevron при открытии */
.cm-tab__title.is-open .cm-tab__chevron {
    transform: rotate(180deg);
}

/* ===== Контент ===== */
.cm-tab__body {
    overflow: hidden;
}

/* hidden атрибут — скрываем, но не ломаем анимацию */
.cm-tab__body[hidden] {
    display: block !important;
    height: 0 !important;
    overflow: hidden !important;
    visibility: hidden;
    padding: 0;
}

/* Когда анимация идёт — visibility нормальная */
.cm-tab__body:not([hidden]) {
    visibility: visible;
}

.cm-tab__body-inner {
    padding: 16px 20px 20px;
}

/* ===== Стили контента из WooCommerce ===== */
.cm-tab__body-inner .woocommerce-product-attributes {
    width: 100%;
    border-collapse: collapse;
}

.cm-tab__body-inner .woocommerce-product-attributes th,
.cm-tab__body-inner .woocommerce-product-attributes td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.cm-tab__body-inner .woocommerce-product-attributes th {
    width: 35%;
    font-weight: 600;
    color: #444;
}

.cm-tab__body-inner .woocommerce-product-attributes tr:last-child th,
.cm-tab__body-inner .woocommerce-product-attributes tr:last-child td {
    border-bottom: none;
}

/* Отзывы */
.cm-tab__body-inner #reviews {
    margin: 0;
}

.cm-tab__body-inner #reviews #comments {
    margin-bottom: 16px;
}

/* ===== Редактор Elementor — заглушка ===== */
.cm-tabs .elementor-edit-mode-placeholder {
    padding: 14px 18px;
    background: #f9f9f9;
    border: 1px dashed #ccc;
    color: #888;
    font-size: 13px;
    border-radius: 4px;
}
