/* ═══════════════════════════════════════════════
   AgroExpert — Mega Catalog Dropdown  v3.0
   Palette:
     --agro-primary:   #1A3A5C  (deep navy)
     --agro-dark:      #0D2137  (darkest)
     --agro-accent:    #D4A843  (wheat gold)
     --agro-bg:        #FAFAF7
     --agro-bg-alt:    #F5F3EE
     --agro-border:    #E8E4DC
     --agro-text:      #2D2A25
     --agro-text-sec:  #5C574E
     --agro-hover:     #6A9CC5
   ═══════════════════════════════════════════════ */

/* ── Wrapper ── */
.agro-catalog-wrap {
    position: relative;
}

/* ── Кнопка «Каталог» ── */
.agro-catalog-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 18px 22px;
    background: #1A3A5C;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    border: 1px solid #1A3A5C;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
    line-height: 1;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

/* Сброс cmsmasters theme button::before/::after */
.agro-catalog-btn::before,
.agro-catalog-btn::after {
    display: none !important;
    content: none !important;
}

.agro-catalog-btn:hover,
.agro-catalog-btn:focus-visible {
    background: #0D2137;
    border-color: #0D2137;
    box-shadow: 0 2px 8px rgba(13,33,55,.25);
}

.agro-catalog-btn[aria-expanded="true"] {
    background: #0D2137;
    border-color: #0D2137;
    border-radius: 6px 6px 0 0;
}

/* ── Home variant: прозрачный с белой рамкой ── */
.agro-catalog-wrap--home .agro-catalog-btn {
    background: transparent;
    border: 1px solid #ffffff;
    color: #fff;
}

.agro-catalog-wrap--home .agro-catalog-btn:hover,
.agro-catalog-wrap--home .agro-catalog-btn:focus-visible {
    background: rgba(255,255,255,0.1);
    border-color: #ffffff;
    box-shadow: 0 2px 8px rgba(255,255,255,.15);
}

.agro-catalog-wrap--home .agro-catalog-btn[aria-expanded="true"] {
    background: rgba(255,255,255,0.1);
    border-color: #ffffff;
    border-radius: 6px 6px 0 0;
}

.agro-catalog-icon {
    flex-shrink: 0;
}

.agro-catalog-chevron {
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.agro-catalog-btn[aria-expanded="true"] .agro-catalog-chevron {
    transform: rotate(180deg);
}


/* ── Dropdown контейнер ── */
.agro-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 1200px;
    max-width: calc(100vw - 40px);
    background: #fff;
    border: 1px solid #E8E4DC;
    border-top: 3px solid #D4A843;
    border-radius: 0 8px 8px 8px;
    box-shadow: 0 12px 40px rgba(13,33,55,.15), 0 2px 8px rgba(0,0,0,.06);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    overflow: hidden;
}

.agro-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}


/* ── Body: flex layout ── */
.agro-dropdown__body {
    display: flex;
    height: 72vh;
    max-height: 640px;
    min-height: 380px;
}


/* ── Левая колонка ── */
.agro-dropdown__nav {
    width: 280px;
    min-width: 280px;
    background: #FAFAF7;
    border-right: 1px solid #E8E4DC;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.agro-dropdown__list {
    flex: 1;
    list-style: none;
    margin: 0;
    padding: 6px 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.agro-dropdown__list::-webkit-scrollbar { width: 5px; }
.agro-dropdown__list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }


/* ── Пункт левого меню ── */
.agro-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    border-left: 3px solid transparent;
    position: relative;
}

.agro-dropdown__item:hover,
.agro-dropdown__item.is-active {
    background: #fff;
    border-left-color: #D4A843;
}

.agro-dropdown__item.is-active {
    box-shadow: inset -1px 0 0 #fff;
}

.agro-dropdown__icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}

.agro-dropdown__link {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #2D2A25;
    text-decoration: none;
    line-height: 1.3;
}

.agro-dropdown__item:hover .agro-dropdown__link,
.agro-dropdown__item.is-active .agro-dropdown__link {
    color: #1A3A5C;
    font-weight: 600;
}

.agro-dropdown__arrow {
    flex-shrink: 0;
    color: #bbb;
    transition: color 0.15s, transform 0.15s;
}

.agro-dropdown__item:hover .agro-dropdown__arrow,
.agro-dropdown__item.is-active .agro-dropdown__arrow {
    color: #D4A843;
    transform: translateX(2px);
}


/* ── Кнопка «Все категории» ── */
.agro-dropdown__all {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    margin: 6px 10px 10px;
    background: #fff;
    border: 1px solid #E8E4DC;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #1A3A5C;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.agro-dropdown__all:hover {
    background: #F5F3EE;
    border-color: #D4A843;
    color: #1A3A5C;
}

.agro-dropdown__all svg {
    color: #D4A843;
    flex-shrink: 0;
}


/* ── Правая колонка ── */
.agro-dropdown__content {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.agro-dropdown__content::-webkit-scrollbar { width: 5px; }
.agro-dropdown__content::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }


/* ── Подменю ── */
.agro-submenu {
    display: none;
    padding: 16px 20px;
}

.agro-submenu.is-active {
    display: block;
}

.agro-submenu__grid {
    column-count: 2;
    column-gap: 32px;
}


/* ── Блок подкатегории 1-го уровня ── */
.agro-subcategory {
    display: inline-block;
    width: 100%;
    break-inside: avoid;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #F0EDE8;
}

.agro-subcategory:last-child {
    border-bottom: none;
}

.agro-subcategory__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.agro-subcategory__thumb {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 6px;
    background: #FAFAF7;
    border: 1px solid #E8E4DC;
    padding: 3px;
    flex-shrink: 0;
}

.agro-subcategory__title {
    font-size: 14px;
    font-weight: 700;
    color: #2D2A25;
    text-decoration: none;
    line-height: 1.3;
    transition: color 0.15s;
}

.agro-subcategory__title:hover {
    color: #D4A843;
}


/* ── Дети 2-го уровня ── */
.agro-subcategory__children {
    list-style: none;
    padding: 0 0 0 56px;
    margin: 4px 0 0;
}

.agro-subcategory__children li {
    margin-bottom: 3px;
}

.agro-subcategory__children li::before {
    content: "–";
    color: #D4A843;
    margin-right: 6px;
    font-weight: 600;
}

.agro-subcategory__children a {
    font-size: 13px;
    font-weight: 500;
    color: #5C574E;
    text-decoration: none;
    transition: color 0.15s;
}

.agro-subcategory__children a:hover {
    color: #1A3A5C;
}


/* ── Разделитель по центру между колонками ── */
.agro-submenu__grid {
    position: relative;
}

.agro-submenu__grid::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: #E8E4DC;
    transform: translateX(-50%);
    pointer-events: none;
}


/* ── Responsive: 1200–1500 ── */
@media (min-width: 1200px) and (max-width: 1500px) {
    .agro-dropdown {
        width: 1060px;
    }
    .agro-dropdown__nav {
        width: 250px;
        min-width: 250px;
    }
}

/* ── Responsive: < 1200 ── */
@media (max-width: 1199px) {
    .agro-dropdown {
        width: 920px;
    }
    .agro-dropdown__nav {
        width: 230px;
        min-width: 230px;
    }
    .agro-submenu__grid {
        column-count: 1;
    }
    .agro-submenu__grid::before {
        display: none;
    }
}

/* ── Responsive: < 992 ── */
@media (max-width: 991px) {
    .agro-dropdown {
        width: calc(100vw - 20px);
        left: -10px;
        border-radius: 0 0 8px 8px;
    }
    .agro-dropdown__body {
        height: auto;
        max-height: 70vh;
        flex-direction: column;
    }
    .agro-dropdown__nav {
        width: 100%;
        min-width: unset;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid #E8E4DC;
    }
    .agro-dropdown__content {
        max-height: 40vh;
    }
}