/* ==========================================================================
   Volt City — catalog mega menu
   Left rail: sections. Right pane: wide three-column category tree.
   ========================================================================== */

.vc-mega {
    padding: 0;
    background: var(--vc-white);
    border-top: 1px solid var(--vc-line);
    border-radius: 0 0 20px 20px;
    box-shadow:
        0 24px 60px rgba(43, 47, 54, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.vc-mega__inner {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 0;
    max-height: 70vh;
}

/* Left rail */
.vc-mega__rail {
    min-width: 0;
    max-height: 70vh;
    padding: 18px 18px 20px 0;
    overflow-y: auto;
    border-right: 1px solid var(--vc-line);
    scrollbar-gutter: stable;
}

.vc-mega__rail-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.vc-mega__rail-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 8px 10px;
    color: var(--vc-dark);
    font-size: 0.9375rem;
    font-weight: 650;
    line-height: 1.3;
    text-decoration: none;
    border-radius: 10px;
    transition: color 0.2s var(--vc-ease), background-color 0.2s var(--vc-ease);
}

.vc-mega__rail-link:hover,
.vc-mega__rail-link.is-active {
    color: var(--vc-accent);
    background: var(--vc-light);
}

.vc-mega__rail-link:focus-visible {
    outline: 3px solid var(--vc-accent);
    outline-offset: -2px;
}

.vc-mega__rail-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 3px;
    overflow: hidden;
    background: var(--vc-white);
    border: 1px solid var(--vc-line);
    border-radius: 9px;
}

.vc-mega__rail-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.vc-mega__rail-icon .vc-icon {
    width: 17px;
    height: 17px;
    color: var(--vc-muted);
}

.vc-mega__rail-link.is-active .vc-mega__rail-icon {
    border-color: var(--vc-accent);
}

.vc-mega__rail-name {
    min-width: 0;
    overflow-wrap: break-word;
}

.vc-mega__rail-arrow {
    display: inline-flex;
    flex: none;
    margin-left: auto;
    color: var(--vc-muted);
    opacity: 0.55;
    transition: color 0.2s var(--vc-ease), opacity 0.2s var(--vc-ease), transform 0.2s var(--vc-ease);
}

.vc-mega__rail-arrow .vc-icon {
    width: 14px;
    height: 14px;
}

.vc-mega__rail-link.is-active .vc-mega__rail-arrow {
    color: var(--vc-accent);
    opacity: 1;
    transform: translateX(2px);
}

/* Right pane */
.vc-mega__panels {
    min-width: 0;
    max-height: 70vh;
    padding: 22px 24px 28px 28px;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.vc-mega__panel[hidden] {
    display: none;
}

/* Фото раздела — плашка фиксированного размера в правом верхнем углу панели.
   Одинаковая во всех разделах, поэтому сетка меню не прыгает при переключении.
   Слева плашка растворяется в белом — тексту категорий не мешает. */
.vc-mega__panel {
    position: relative;
    overflow: visible;
    padding-bottom: 4px;
    border-radius: 14px;
}

.vc-mega__panel-head,
.vc-mega__groups {
    position: relative;
    z-index: 1;
}

/* Подвал панели: сначала пункты категорий, ниже — название, описание,
   «Все товары» и фото в стеклянной рамке. */
.vc-mega__panel-foot {
    display: flex;
    gap: 22px;
    align-items: flex-start;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--vc-line);
}

.vc-mega__panel-foot .vc-mega__panel-heading {
    flex: 1 1 auto;
    min-width: 0;
}

/* Кнопка «Перейти в раздел» — акцентная, в стиле кнопок сайта. */
.vc-mega__panel-foot .vc-mega__all {
    display: inline-flex;
    flex: none;
    gap: 8px;
    align-items: center;
    align-self: center;
    padding: 11px 18px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    background: var(--vc-accent, var(--vc-accent));
    border: 0;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(240, 78, 54, 0.24);
    transition: filter 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.vc-mega__panel-foot .vc-mega__all:hover,
.vc-mega__panel-foot .vc-mega__all:focus-visible {
    color: #fff;
    filter: brightness(0.93);
    box-shadow: 0 10px 22px rgba(240, 78, 54, 0.32);
    transform: translateY(-1px);
}

.vc-mega__panel-foot .vc-mega__all .vc-icon {
    color: currentColor;
}

.vc-mega__panel-photo {
    display: block;
    flex: none;
    width: 176px;
    height: 104px;
    padding: 5px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 10px 26px rgba(43, 47, 54, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(10px) saturate(1.15);
    backdrop-filter: blur(10px) saturate(1.15);
    pointer-events: none;
}

.vc-mega__panel-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
    border-radius: 10px;
}

.vc-mega__all + .vc-mega__panel-photo,
.vc-mega__panel-photo + .vc-mega__all {
    margin-left: 18px;
}

.vc-mega__panel {
    background-image: linear-gradient(115deg, #fff 0%, #fff 55%, var(--vc-light) 100%);
}

.vc-mega__panel-head {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--vc-line);
}

.vc-mega__panel-heading {
    min-width: 0;
}

.vc-mega__panel-eyebrow {
    margin: 0 0 4px;
    color: var(--vc-muted);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.vc-mega__panel-title {
    margin: 0;
    color: var(--vc-dark);
    font-size: 1.375rem;
    font-weight: 750;
    line-height: 1.2;
    letter-spacing: -0.02em;
    overflow-wrap: break-word;
}

.vc-mega__panel-desc {
    max-width: 620px;
    margin: 6px 0 0;
    color: var(--vc-muted);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.vc-mega__all {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    padding: 8px 0;
    color: var(--vc-accent);
    font-size: 0.8125rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.vc-mega__all .vc-icon {
    width: 15px;
    height: 15px;
    transition: transform 0.2s var(--vc-ease);
}

.vc-mega__all:hover .vc-icon {
    transform: translateX(3px);
}

/* Three columns of subcategories */
.vc-mega__groups {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px 30px;
    align-items: start;
}

.vc-mega__groups.is-single {
    grid-template-columns: minmax(0, 1fr);
}

.vc-mega__groups.is-single .vc-mega__leaf {
    max-width: 620px;
}

.vc-mega__empty-card {
    display: flex;
    align-items: center;
    gap: 22px;
    max-width: 680px;
    padding: 22px 24px;
    background: var(--vc-light);
    border: 1px solid var(--vc-line);
    border-radius: 14px;
}

.vc-mega__empty-media {
    display: grid;
    flex: none;
    place-items: center;
    width: 112px;
    height: 112px;
    padding: 10px;
    background: var(--vc-white);
    border: 1px solid var(--vc-line);
    border-radius: 12px;
}

.vc-mega__empty-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.vc-mega__empty-media .vc-icon {
    width: 32px;
    height: 32px;
    color: var(--vc-muted);
}

.vc-mega__empty-body {
    min-width: 0;
}

.vc-mega__empty-title {
    margin: 0;
    color: var(--vc-dark);
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: break-word;
}

.vc-mega__empty-text {
    max-width: 380px;
    margin: 5px 0 10px;
    color: var(--vc-muted);
    font-size: 0.875rem;
    line-height: 1.5;
}

.vc-mega__empty-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    color: var(--vc-accent);
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
}

.vc-mega__empty-link .vc-icon {
    width: 15px;
    height: 15px;
    transition: transform 0.2s var(--vc-ease);
}

.vc-mega__empty-link:hover .vc-icon {
    transform: translateX(3px);
}

.vc-mega__leaf,
.vc-mega__group-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 42px;
    padding: 9px 0;
    color: var(--vc-dark);
    font-size: 0.875rem;
    line-height: 1.4;
    text-decoration: none;
    border-bottom: 1px solid rgba(43, 47, 54, 0.07);
}

.vc-mega__leaf > span:first-child,
.vc-mega__group-name {
    min-width: 0;
    overflow-wrap: break-word;
    word-break: normal;
}

.vc-mega__leaf:hover,
.vc-mega__group-summary:hover {
    color: var(--vc-accent);
}

.vc-mega__leaf:focus-visible,
.vc-mega__group-summary:focus-visible {
    outline: 3px solid var(--vc-accent);
    outline-offset: 2px;
}

.vc-mega__count {
    flex: none;
    color: var(--vc-muted);
    font-size: 0.75rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.vc-mega__group {
    min-width: 0;
    border-bottom: 1px solid rgba(43, 47, 54, 0.07);
}

.vc-mega__group > summary {
    list-style: none;
    cursor: pointer;
}

.vc-mega__group > summary::-webkit-details-marker {
    display: none;
}

.vc-mega__group > summary::marker {
    content: "";
}

.vc-mega__group-summary {
    border-bottom: 0;
}

.vc-mega__group-name {
    font-weight: 650;
}

.vc-mega__group-marker {
    position: relative;
    flex: none;
    width: 22px;
    height: 22px;
    border: 1px solid var(--vc-line);
    border-radius: 6px;
}

.vc-mega__group-marker::before,
.vc-mega__group-marker::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 9px;
    height: 1.5px;
    content: "";
    background: var(--vc-muted);
    border-radius: 1px;
    transform: translate(-50%, -50%);
    transition: transform 0.2s var(--vc-ease);
}

.vc-mega__group-marker::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.vc-mega__group[open] .vc-mega__group-marker::after {
    transform: translate(-50%, -50%) rotate(90deg) scaleX(0);
}

.vc-mega__sublist {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 0 0 8px;
    padding: 0 0 0 12px;
    list-style: none;
    border-left: 1px solid var(--vc-line);
}

.vc-mega__sublink {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    color: var(--vc-muted);
    font-size: 0.8125rem;
    line-height: 1.4;
    text-decoration: none;
}

.vc-mega__sublink > span:first-child {
    min-width: 0;
    overflow-wrap: break-word;
}

.vc-mega__sublink:hover {
    color: var(--vc-accent);
}

.vc-mega__sublink:first-child {
    font-weight: 600;
}

.vc-mega__sublink:focus-visible {
    outline: 3px solid var(--vc-accent);
    outline-offset: 2px;
}

.vc-mega__empty {
    padding: 8px 0;
    color: var(--vc-muted);
    font-size: 0.875rem;
}

.vc-mega__empty-title {
    margin: 0;
}

/* Nested mobile accordion */
.vc-acc--sub {
    margin: 2px 0 2px 12px;
    border-left: 1px solid var(--vc-line);
}

.vc-acc--sub > .vc-acc__summary {
    padding: 8px 0 8px 12px;
    font-size: 0.875rem;
}

.vc-acc--sub .vc-acc__list {
    padding-left: 12px;
}

.vc-acc__list a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.vc-drawer__count {
    flex: none;
    color: var(--vc-muted);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 1199px) {
    .vc-mega__inner {
        grid-template-columns: 250px minmax(0, 1fr);
    }

    .vc-mega__groups {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .vc-mega__inner {
        grid-template-columns: 230px minmax(0, 1fr);
    }

    .vc-mega__panels {
        padding-left: 20px;
    }
}

@media (max-width: 767px) {
    .vc-mega {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vc-mega__rail-link,
    .vc-mega__rail-arrow,
    .vc-mega__all .vc-icon,
    .vc-mega__group-marker::before,
    .vc-mega__group-marker::after {
        transition-duration: 0.01ms;
    }
}
