/**
 * cgm-archive.css — Archive/Taxonomy layout
 * curly.sale / CGM Navigator
 *
 * Стили для страниц archive/taxonomy:
 *   /marcas/{brand}/           → taxonomy-curly_brand.php
 *   /productos/{type}/         → taxonomy-curly_product_type.php
 *   /productos/ (archive)      → archive-cgm_product.php
 *   /pelo/{type}/              → taxonomy-curly_hair_type.php  ← Sprint 18
 *   /pelo/                     → page-pelo.php (hub)           ← Sprint 18 fix
 *
 * Зависимости: curly-global.css · cgm-card.css (карточки уже там)
 *
 * ⚠️  Стили карточки товара перенесены в cgm-card.css (Sprint 24).
 *     Здесь только: wrapper, breadcrumb, header, filters, pagination,
 *     empty state, SEO-текст.
 *
 * Upload to:
 *   /www/wwwroot/curly.sale/wp-content/themes/generatepress-child/assets/css/cgm-archive.css
 *
 * @version 2.1.0 (Sprint 18 fix — hair type nav + type pills + /pelo/ hub, May 2026)
 */

/* ============================================================
   1. ARCHIVE WRAPPER
   ============================================================ */
.cgm-archive-wrap {
    max-width: var(--cgm-max);           /* 1200px из curly-global */
    margin-left: auto;
    margin-right: auto;
    padding: 0 16px 56px;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .cgm-archive-wrap {
        padding: 0 24px 72px;
    }
}

/* ============================================================
   2. BREADCRUMB
   ============================================================ */
.cgm-breadcrumb {
    font-size: 12px;
    color: var(--fg-2);
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
    line-height: 1.5;
}

.cgm-breadcrumb .rank-math-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.cgm-breadcrumb a,
.cgm-breadcrumb .rank-math-breadcrumb a {
    color: var(--fg-2);
    text-decoration: none;
    transition: color var(--motion);
}

.cgm-breadcrumb a:hover,
.cgm-breadcrumb .rank-math-breadcrumb a:hover {
    color: var(--brand);
}

.cgm-breadcrumb .rank-math-breadcrumb .separator {
    color: var(--fg-3);
    margin: 0 2px;
}

/* ============================================================
   3. ARCHIVE HEADER — LIGHT
   ——————————————————————————————————————————————————————————
   Белый фон, тёмный текст — как на главной странице.
   Sage-акцент только через левую полоску h1.
   ============================================================ */
.cgm-archive-header {
    background: transparent;
    padding: 28px 0 20px;
    margin: 0 0 24px;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.cgm-archive-title {
    font-size: clamp(20px, 3.5vw, 28px);
    font-weight: 800;
    color: var(--fg-1, #1a1a1a);
    margin: 0 0 8px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    padding-left: 14px;
    border-left: 3px solid var(--brand, #4A7C6F);
}

.cgm-archive-subtitle {
    font-size: 14px;
    color: var(--fg-2, #6b7280);
    margin: 0;
    line-height: 1.5;
    padding-left: 14px;
}

.cgm-archive-subtitle .cgm-clear-filters {
    color: var(--brand, #4A7C6F);
    text-decoration: none;
    margin-left: 8px;
    font-size: 12px;
    font-weight: 600;
    transition: opacity var(--motion);
}

.cgm-archive-subtitle .cgm-clear-filters:hover {
    opacity: 0.75;
}

.cgm-archive-desc {
    margin-top: 10px;
    padding-left: 14px;
    font-size: 14px;
    color: var(--fg-2, #6b7280);
    line-height: 1.65;
    max-width: 640px;
}

.cgm-archive-desc p {
    margin: 0;
}

/* ============================================================
   4. FILTERS BAR
   ——————————————————————————————————————————————————————————
   DS: --radius-md: 4px, input padding + focus ring с sage.
   Кнопка "Aplicar filtros" — btn-primary стиль.
   ============================================================ */
.cgm-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 4px;   /* --radius-md */
    padding: 16px 20px;
    margin-bottom: 24px;
}

.cgm-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 160px;
}

.cgm-filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--fg-2);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1;
}

/* DS input style: inp class */
.cgm-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--bg-surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23718096' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding: 8px 32px 8px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;   /* --radius-md */
    font-size: 13px;
    color: var(--fg-1);
    cursor: pointer;
    width: 100%;
    transition: border-color var(--motion), box-shadow var(--motion);
    font-family: inherit;
}

.cgm-select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(74, 124, 111, 0.18);
}

/* Чекбоксы */
.cgm-filter-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding-bottom: 2px;
}

.cgm-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--fg-2);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.cgm-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--brand);
    cursor: pointer;
    flex-shrink: 0;
}

/* Кнопка «Aplicar filtros» — DS: .btn-primary */
.cgm-filter-btn {
    padding: 8px 16px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 4px;   /* --radius-md */
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: filter var(--motion), transform var(--motion);
    align-self: flex-end;
    font-family: inherit;
}

.cgm-filter-btn:hover {
    filter: brightness(0.92);
}

.cgm-filter-btn:active {
    transform: translateY(1px);
}

.cgm-filters--sort-only {
    gap: 8px;
}

/* ============================================================
   5. PRODUCTS GRID — перенесено в cgm-card.css (Sprint 24)
   ============================================================ */
/* → см. cgm-card.css §1 */

/* ============================================================
   6–12. CARD STYLES — перенесены в cgm-card.css (Sprint 24)
   ============================================================ */
/* → см. cgm-card.css §2–9 */

/* ============================================================
   13. PAGINATION
   ——————————————————————————————————————————————————————————
   paginate_links(type='list') → ul.page-numbers
   DS: кнопки — radius 4px, sage active
   ============================================================ */
.cgm-pagination {
    margin: 8px 0 0;
    display: flex;
    justify-content: center;
}

.cgm-pagination ul.page-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.cgm-pagination ul.page-numbers li {
    margin: 0;
}

.cgm-pagination ul.page-numbers a.page-numbers,
.cgm-pagination ul.page-numbers span.page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 4px;   /* --radius-md */
    font-size: 13px;
    font-weight: 500;
    color: var(--fg-1);
    text-decoration: none;
    background: var(--bg-surface);
    transition: border-color var(--motion), background var(--motion), color var(--motion);
}

.cgm-pagination ul.page-numbers a.page-numbers:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: rgba(74, 124, 111, 0.06);
    text-decoration: none;
}

.cgm-pagination ul.page-numbers span.current {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.cgm-pagination ul.page-numbers a.prev,
.cgm-pagination ul.page-numbers a.next {
    font-size: 12px;
    padding: 0 14px;
    color: var(--fg-2);
}

.cgm-pagination ul.page-numbers .dots {
    border: none;
    background: transparent;
    color: var(--fg-3);
    padding: 0 4px;
    min-width: auto;
}

/* ============================================================
   14. EMPTY STATE
   ============================================================ */
.cgm-empty-state {
    text-align: center;
    padding: 64px 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 4px;   /* --radius-md */
    margin-bottom: 32px;
}

.cgm-empty-state__icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 16px;
}

.cgm-empty-state h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--fg-1);
    margin: 0 0 12px;
}

.cgm-empty-state p {
    font-size: 14px;
    color: var(--fg-2);
    margin: 0;
}

.cgm-empty-state a {
    color: var(--brand);
    font-weight: 500;
}

/* ============================================================
   15. SEO TEXT BLOCK
   ——————————————————————————————————————————————————————————
   DS: border-radius 4px. Sage левая полоска = accent.
   ============================================================ */
.cgm-tax-seo-text {
    margin-top: 40px;
    padding: 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 4px;   /* --radius-md */
    border-left: 3px solid var(--brand);
}

.cgm-tax-seo-text h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--fg-1);
    margin: 0 0 10px;
    line-height: 1.35;
}

.cgm-tax-seo-text p {
    font-size: 13px;
    color: var(--fg-2);
    line-height: 1.7;
    margin: 0;
}

/* ============================================================
   16. CLEAR FILTERS LINK (outside subtitle)
   ============================================================ */
.cgm-clear-filters {
    font-size: 12px;
    color: var(--fg-2);
    text-decoration: underline;
    transition: color var(--motion);
}

.cgm-clear-filters:hover {
    color: var(--cgm-crimson);
}

/* ============================================================
   17. RESPONSIVE
   ============================================================ */

@media (max-width: 639px) {
    /* Фильтры в колонку */
    .cgm-filters {
        flex-direction: column;
        padding: 14px 16px;
        gap: 12px;
    }

    .cgm-filter-group {
        min-width: 100%;
    }

    .cgm-filter-checks {
        gap: 10px;
    }

    .cgm-filter-btn {
        width: 100%;
        padding: 10px;
        font-size: 14px;
    }

    /* Карточка компактнее — переменесено в cgm-card.css §10 */

    .cgm-tax-seo-text {
        padding: 16px;
    }
}

/* Очень узкий — 1 колонка: см. cgm-card.css §1 */

/* ============================================================
   18. HAIR TYPE SWITCHER NAV  — /pelo/{type}/
   ——————————————————————————————————————————————————————————
   Горизонтальная полоса табов между типами волос.
   На мобайле — горизонтальный скролл без обрезки.
   ============================================================ */
.cgm-hair-type-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 0 12px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    margin-bottom: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.cgm-hair-type-nav::-webkit-scrollbar {
    display: none;
}

.cgm-hair-type-tab {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 14px 7px;
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 20px;
    text-decoration: none;
    color: var(--fg-2, #6b7280);
    transition: border-color var(--motion, .15s), color var(--motion, .15s), background var(--motion, .15s);
    white-space: nowrap;
    flex-shrink: 0;
}

.cgm-hair-type-tab:hover {
    border-color: var(--brand, #4A7C6F);
    color: var(--brand, #4A7C6F);
    background: rgba(74, 124, 111, 0.05);
    text-decoration: none;
}

.cgm-hair-type-tab.is-active {
    background: var(--brand, #4A7C6F);
    border-color: var(--brand, #4A7C6F);
    color: #fff;
}

.cgm-hair-type-tab__code {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    opacity: 0.8;
}

.cgm-hair-type-tab.is-active .cgm-hair-type-tab__code {
    opacity: 0.9;
}

.cgm-hair-type-tab__name {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Код типа в h1 */
.cgm-hair-type-code {
    font-size: 0.7em;
    font-weight: 600;
    color: var(--fg-2, #6b7280);
    margin-left: 6px;
    vertical-align: middle;
}

/* ============================================================
   19. PRODUCT TYPE PILLS  — /pelo/{type}/ quick filter
   ——————————————————————————————————————————————————————————
   Горизонтальный ряд кнопок-пилюль для фильтрации по категории.
   ============================================================ */
.cgm-type-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 0 16px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    margin-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.cgm-type-pills::-webkit-scrollbar {
    display: none;
}

.cgm-type-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px 6px;
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--fg-2, #6b7280);
    text-decoration: none;
    transition: border-color var(--motion, .15s), color var(--motion, .15s), background var(--motion, .15s);
    white-space: nowrap;
    flex-shrink: 0;
}

.cgm-type-pill span {
    font-size: 11px;
    color: var(--fg-3, #9ca3af);
    font-weight: 400;
}

.cgm-type-pill:hover {
    border-color: var(--brand, #4A7C6F);
    color: var(--brand, #4A7C6F);
    background: rgba(74, 124, 111, 0.05);
    text-decoration: none;
}

.cgm-type-pill.is-active {
    background: var(--brand, #4A7C6F);
    border-color: var(--brand, #4A7C6F);
    color: #fff;
}

.cgm-type-pill.is-active span {
    color: rgba(255, 255, 255, 0.7);
}

/* ============================================================
   20. TIPS LIST  — /pelo/{type}/ SEO text section
   ============================================================ */
.cgm-tips-list {
    margin: 12px 0 0;
    padding-left: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cgm-tips-list li {
    font-size: 13px;
    color: var(--fg-2, #6b7280);
    line-height: 1.5;
    padding-left: 18px;
    position: relative;
}

.cgm-tips-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--brand, #4A7C6F);
    font-weight: 700;
    font-size: 12px;
}

/* ============================================================
   21. /pelo/ HUB PAGE  — page-pelo.php
   ——————————————————————————————————————————————————————————
   Сетка из 5 карточек типов волос.
   ============================================================ */
.cgm-pelo-hub__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin: 8px 0 40px;
}

.cgm-pelo-hub__card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 24px 20px 20px;
    background: var(--card-bg, #F9FAFB);
    border: 1px solid var(--card-border, #e5e7eb);
    border-radius: 8px;
    text-decoration: none;
    color: var(--fg-1, #1a1a1a);
    transition: box-shadow var(--motion, .15s), transform var(--motion, .15s);
}

.cgm-pelo-hub__card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    transform: translateY(-2px);
    text-decoration: none;
}

.cgm-pelo-hub__card-emoji {
    font-size: 28px;
    line-height: 1;
    margin-bottom: 4px;
}

.cgm-pelo-hub__card-code {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--brand, #4A7C6F);
    text-transform: uppercase;
}

.cgm-pelo-hub__card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--fg-1, #1a1a1a);
    line-height: 1.25;
}

.cgm-pelo-hub__card-intro {
    font-size: 13px;
    color: var(--fg-2, #6b7280);
    line-height: 1.55;
    margin: 2px 0 0;
    flex-grow: 1;
}

.cgm-pelo-hub__card-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--fg-2, #6b7280);
    margin-top: 6px;
}

.cgm-pelo-hub__card-cta {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand, #4A7C6F);
}

@media (max-width: 639px) {
    .cgm-hair-type-nav {
        flex-wrap: nowrap;
        padding-bottom: 10px;
    }

    .cgm-type-pills {
        flex-wrap: nowrap;
    }

    .cgm-pelo-hub__grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .cgm-pelo-hub__card {
        padding: 16px 14px 14px;
    }

    .cgm-pelo-hub__card-emoji {
        font-size: 22px;
    }

    .cgm-pelo-hub__card-name {
        font-size: 14px;
    }

    .cgm-pelo-hub__card-intro {
        display: none;
    }
}

@media (max-width: 400px) {
    .cgm-pelo-hub__grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   22. /marcas/ HUB PAGE  — page-marcas.php
   ——————————————————————————————————————————————————————————
   Сетка брендов: auto-fill minmax(180px) → компактнее чем
   /pelo/ hub (5 карточек), брендов может быть много.
   ============================================================ */
.cgm-marcas-hub__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin: 8px 0 40px;
}

.cgm-marcas-hub__card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px 16px 16px;
    background: var(--bg-page, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    text-decoration: none;
    color: var(--fg-1, #1a1a1a);
    transition: box-shadow var(--motion, .15s), transform var(--motion, .15s);
}

.cgm-marcas-hub__card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    transform: translateY(-2px);
    text-decoration: none;
}

.cgm-marcas-hub__card-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--fg-1, #1a1a1a);
    line-height: 1.25;
}

.cgm-marcas-hub__card-desc {
    font-size: 12px;
    color: var(--fg-2, #6b7280);
    line-height: 1.5;
    margin: 2px 0 0;
    flex-grow: 1;
}

.cgm-marcas-hub__card-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--fg-2, #6b7280);
    margin-top: 4px;
}

.cgm-marcas-hub__card-cta {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand, #4A7C6F);
}

@media (max-width: 600px) {
    .cgm-marcas-hub__grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .cgm-marcas-hub__card {
        padding: 14px 12px 12px;
    }

    .cgm-marcas-hub__card-name {
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .cgm-marcas-hub__grid {
        grid-template-columns: 1fr;
    }
}
