/*
|--------------------------------------------------------------------------
| ЭПОХА — Header
|--------------------------------------------------------------------------
| Все стили шапки собраны здесь. Inline CSS из header.php не используется.
*/

/* ==========================================================================
   1. Header shell
   ========================================================================== */

.ws-header-cell {
    padding: 0 !important;
    border-bottom: 1px solid #1b1b1b;
}

.ws-header {
    position: relative;
    z-index: 1000;
    background: #3f430f;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}

/* ==========================================================================
   2. Верхняя строка: логотип / каталог / поиск / действия
   ========================================================================== */

.ws-header__top {
    position: relative;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    min-height: 76px;
    width: min(1360px, calc(100% - 40px));
    margin: 0 auto;
    padding: 12px 0;
    box-sizing: border-box;
}

.ws-header__brand {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    color: #f5e5a3;
    text-decoration: none;
}

.ws-header__brand-name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 32px;
    line-height: 1;
    letter-spacing: .18em;
}

.ws-header__brand-subtitle {
    margin-top: 6px;
    color: #e7dca6;
    font-size: 10px;
    line-height: 1.25;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.ws-header__actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    width: auto;
    gap: 24px;
    margin: 0;
}

.ws-header__action {
    position: relative;
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.ws-header__action:hover {
    color: #f3d77c;
}

/* ==========================================================================
   3. Каталог и поиск
   ========================================================================== */

.ws-header__nav {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    min-width: 0;
    width: auto;
    margin: 0;
    padding: 0;
    gap: 10px;
}

.ws-header__catalog-button {
    display: flex;
    flex: 0 0 155px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 155px;
    min-height: 46px;
    height: 46px;
    padding: 0 20px;
    box-sizing: border-box;
    border: 0;
    border-radius: 6px;
    background: #980000;
    color: #fff;
    font: inherit;
    font-weight: 700;
    letter-spacing: .05em;
    cursor: pointer;
}

.ws-header__catalog-button:hover,
.ws-header__catalog-button.is-open {
    background: #740000;
}

.ws-header__catalog-icon {
    display: inline-grid;
    grid-template-columns: repeat(2, 5px);
    grid-template-rows: repeat(2, 5px);
    gap: 3px;
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
}

.ws-header__catalog-icon i {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 1px;
    background: #fff;
}

.ws-header__search {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    height: 46px;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.ws-header__search input {
    flex: 1;
    min-width: 0;
    padding: 0 18px;
    border: 0;
    outline: 0;
    background: #fff;
    color: #222;
    font: inherit;
    font-size: 15px;
}

.ws-header__search button {
    width: 54px;
    border: 0;
    background: #f0e5ad;
    color: #333;
    font-size: 25px;
    cursor: pointer;
}

.ws-header__search button:hover {
    background: #e4d38c;
}

/* ==========================================================================
   4. Выпадающее меню каталога
   ========================================================================== */

.ws-header__catalog-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    right: auto;
    z-index: 1200;
    width: min(920px, 100%);
    max-width: none;
    padding: 18px 24px 24px;
    box-sizing: border-box;
    border: 1px solid #4d4d16;
    border-top: 0;
    border-radius: 0 0 8px 8px;
    background: #fff;
    color: #222;
    box-shadow: 0 12px 28px rgba(0, 0, .22);
    max-height: calc(100vh - 90px);
    overflow-y: hidden;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    transform: translateX(-50%);
}

.ws-header__catalog-menu[hidden] {
    display: none;
}

.ws-header__catalog-menu::-webkit-scrollbar {
    width: 8px;
}

.ws-header__catalog-menu::-webkit-scrollbar-track {
    background: #f2f2f2;
}

.ws-header__catalog-menu::-webkit-scrollbar-thumb {
    background: #b8b8b8;
    border-radius: 8px;
}

.ws-header__catalog-menu::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.ws-header__catalog-heading {
    margin: 0 0 12px;
    padding-bottom: 9px;
    border-bottom: 1px solid #e2e2e2;
    color: #222;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .08em;
}

.ws-header__catalog-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    height: min(560px, calc(100vh - 170px));
    min-height: 0;
}

.ws-header__catalog-types {
    min-height: 0;
    padding-right: 14px;
    padding-bottom: 14px;
    box-sizing: border-box;
    border-right: 1px solid #e5e5e5;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.ws-header__catalog-type {
    display: block;
    width: 100%;
    margin: 2px 0;
    padding: 10px 14px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #222;
    font: inherit;
    font-size: 14px;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.ws-header__catalog-type:hover {
    background: #f5f5f5;
}

.ws-header__catalog-type.is-active {
    background: #f3f3f3;
    color: #980000;
    font-weight: 700;
}

.ws-header__catalog-type.is-active::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin: 0 8px 2px 0;
    border-radius: 50%;
    background: #980000;
}

.ws-header__catalog-subs {
    min-width: 0;
    min-height: 0;
    padding: 0 10px 0 26px;
    padding-bottom: 14px;
    box-sizing: border-box;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.ws-header__catalog-subpanel[hidden] {
    display: none;
}

.ws-header__catalog-subpanel h3 {
    margin: 2px 0 16px;
    color: #790000;
    font-size: 17px;
}

.ws-header__catalog-subgrid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0 28px;
    align-content: start;
}

.ws-header__catalog-subgrid a {
    display: block;
    margin: 0;
    padding: 6px 0;
    color: #65758b;
    font-size: 14px;
    line-height: 1.35;
    text-decoration: none;
}

.ws-header__catalog-subgrid a:hover {
    color: #980000;
    text-decoration: underline;
}

.ws-header__catalog-empty {
    padding: 10px 0;
    color: #777;
    font-size: 14px;
}

/* ==========================================================================
   5. Адаптивность меню каталога
   ========================================================================== */

@media (max-width: 900px) {
    .ws-header__catalog-layout {
        grid-template-columns: 210px minmax(0, 1fr);
    }

    .ws-header__catalog-subgrid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 680px) {
    .ws-header__catalog-menu {
        max-height: none;
        overflow-y: visible;
    }

    .ws-header__catalog-layout {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
    }

    .ws-header__catalog-types {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding: 0 0 10px;
        border-right: 0;
        border-bottom: 1px solid #e5e5e5;
        overflow-y: visible;
    }

    .ws-header__catalog-type {
        width: auto;
        min-width: max-content;
    }

    .ws-header__catalog-subs {
        padding: 18px 0 0;
        overflow-y: visible;
    }

    .ws-header__catalog-subgrid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   6. Избранное / корзина — единый бейдж
   ========================================================================== */

.ws-header__favorite,
.ws-header__cart,
.ws-header__badge-action {
    position: relative;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.ws-header__favorite-icon {
    margin-right: 3px;
    font-size: 18px;
    line-height: 1;
}

.ws-header__favorite-label {
    position: relative;
    line-height: 1.2;
}

#ws-header-favorite-count.ws-header-count,
#ws-header-cart-count.ws-header-count {
    position: absolute;
    top: -9px;
    right: -13px;
    min-width: 20px;
    width: auto;
    height: 20px;
    padding: 0 5px;
    margin: 0;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: #e6003c;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    text-shadow: none;
    box-shadow: none;
    z-index: 999;
}

/* ==========================================================================
   7. Нижняя навигация
   ========================================================================== */

.ws-header__links {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0;
    width: min(1360px, calc(100% - 40px));
    min-height: 34px;
    margin: 0 auto;
    border-top: 1px solid rgba(255, 255, 255, .14);
    border-bottom: 1px solid rgba(0, 0, 0, .35);
    overflow-x: auto;
    scrollbar-width: thin;
}

.ws-header__links a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 16px;
    border-right: 1px solid rgba(255, 255, 255, .12);
    color: #f4e8aa;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}

.ws-header__links a:first-child {
    padding-left: 4px;
}

.ws-header__links a:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

/* ==========================================================================
   8. Sticky верхней строки
   ========================================================================== */

.ws-header__top-spacer {
    display: none;
}

.ws-header__top.ws-header__top--fixed {
    position: fixed;
    top: 0;
    z-index: 1100;
    background: transparent;
    overflow: visible;
}

.ws-header__top.ws-header__top--fixed::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    background: #3f430f;
    z-index: -1;
    pointer-events: none;
}

.ws-header__top.ws-header__top--fixed + .ws-header__top-spacer {
    display: block;
}

#ws-header-catalog-menu[data-sticky-moved="1"] {
    position: fixed;
    z-index: 10000;
    box-sizing: border-box;
    margin: 0;
    transform: none !important;
}

#ws-header-catalog-menu[data-sticky-moved="1"][hidden] {
    display: none;
}

/* ==========================================================================
   9. Основной контент и legacy-обвязка
   ========================================================================== */

.ws-layout-content {
    width: min(1360px, calc(100% - 40px));
    max-width: 1360px;
    margin: 0 auto;
    box-sizing: border-box;
    text-align: left;
}

.ws-site-table > tbody > tr > td[style*="width:15%"],
.ws-legacy-sidebar {
    display: none !important;
    width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: #E6E6E6;
    color: #222;
}

.site-main {
    width: 100%;
    box-sizing: border-box;
}

.ws-layout-content {
    padding: 24px 0 40px;
}

.site-footer {
    width: 100%;
    box-sizing: border-box;
    border-top: 1px solid #1b1b1b;
    background: #3f430f;
    color: #fff;
}

.site-footer__inner {
    width: min(1360px, calc(100% - 40px));
    margin: 0 auto;
    padding: 14px 0 18px;
    box-sizing: border-box;
    font-size: 10px;
}

.site-footer__inner b {
    font-size: 10px;
}

.site-footer__inner a {
    color: #f5e5a3;
    text-decoration: none;
}

.site-footer__inner a:hover {
    color: #fff;
    text-decoration: underline;
}

.site-footer__inner p {
    display: inline;
    margin: 0 0 0 8px;
}

/* ==========================================================================
   10. Responsive
   ========================================================================== */

@media (max-width: 900px) {
    .ws-header__top {
        align-items: center;
    }

    .ws-header__actions {
        gap: 12px;
    }
}

@media (max-width: 700px) {
    #ws-header-favorite-count.ws-header-count,
    #ws-header-cart-count.ws-header-count {
        top: -7px;
        right: -11px;
        min-width: 19px;
        height: 19px;
        font-size: 10px;
        line-height: 19px;
    }
}

@media (max-width: 600px) {
    .ws-header__top {
        flex-wrap: wrap;
        width: auto;
        padding-left: 14px;
        padding-right: 14px;
    }

    .ws-header__brand {
        width: 100%;
    }

    .ws-header__nav {
        width: 100%;
        flex-direction: row;
    }

    .ws-header__catalog-button {
        min-width: 155px;
    }

    .ws-header__links {
        width: auto;
        margin-left: 14px;
        margin-right: 14px;
    }

    .ws-header__links a {
        padding-left: 12px;
        padding-right: 12px;
        font-size: 12px;
    }

    .ws-header__catalog-menu {
        left: 0;
        right: 0;
        width: 100%;
        transform: none;
        padding: 20px 18px 22px;
        transform: none;
    }

    .ws-header__actions {
        width: auto;
        flex-wrap: wrap;
    }

    .ws-layout-content {
        width: calc(100% - 28px);
        padding-top: 18px;
    }

    .site-footer__inner {
        width: calc(100% - 28px);
    }
}
