/* ===== CENTERPACK MEGA MENU INTEGRATION WITH WOODMART v1.0.9 ===== */

/* Блокировка скролла при открытом меню */
body.centerpack-menu-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
}

/* Сброс стилей Woodmart */
.centerpack-menu-wrapper,
.centerpack-menu-wrapper * {
    box-sizing: border-box;
}

.centerpack-menu-wrapper ul,
.centerpack-menu-wrapper ol,
.centerpack-menu-wrapper li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.centerpack-menu-wrapper ul:before,
.centerpack-menu-wrapper ol:before,
.centerpack-menu-wrapper li:before {
    display: none !important;
}

.centerpack-menu-wrapper a {
    text-decoration: none !important;
    color: inherit !important;
}

/* Wrapper для интеграции с Woodmart header */
.centerpack-menu-wrapper {
    position: relative;
    display: inline-flex;
    z-index: 1001;
}

/* Адаптация под Woodmart header builder */
.whb-element .centerpack-menu-wrapper {
    height: 100%;
    align-items: center;
}

/* Стили для разных вариантов интеграции */
.centerpack-style-minimal .catalog-button {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
}

/* Основные стили кнопки остаются из исходной верстки */
.header {
    padding: 15px 0;
    border-top: 1px solid rgba(25, 29, 34, 0.08);
    border-bottom: 1px solid rgba(25, 29, 34, 0.08);
    background: #FFF;
    position: relative;
    z-index: 1001;
}

.centerpack-menu-wrapper .catalog-button {
    padding: 9px 16px !important;
    border-radius: 10px !important;
    background: linear-gradient(84deg, #DB3340 -6.25%, #FF3A5B 85.18%) !important;
    box-shadow: 0 4px 4px 0 rgba(255, 71, 87, 0.25) !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: #FFF !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    font-family: 'Graphik LCG', sans-serif !important;
    transition: all .3s !important;
    border: none !important;
    cursor: pointer !important;
	text-transform: none !important;
}

.catalog-button__icon {
    position: relative;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalog-button__menu-icon,
.catalog-button__close-icon {
    position: absolute;
    top: 0;
    left: 0;
    transition: all 0.15s ease-in-out;
}

.catalog-button__close-icon {
    opacity: 0;
    transform: scale(0.8) rotate(90deg);
}

.catalog-button__menu-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.catalog-button--active .catalog-button__menu-icon {
    opacity: 0;
    transform: scale(0.8) rotate(-90deg);
}

.catalog-button--active .catalog-button__close-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}



.centerpack-menu-wrapper .catalog-button:hover {
    background: linear-gradient(43deg, #DB3340 6.25%, #FF3A5B 50.18%) !important;
}

.centerpack-menu-wrapper .megamenu {
    border-radius: 0 0 10px 10px !important;
    background: #FFF !important;
    box-shadow: -248px 947px 250px 0 rgba(0, 0, 0, 0.00), -159px 606px 250px 0 rgba(0, 0, 0, 0.01), -89px 341px 212px 0 rgba(0, 0, 0, 0.05), -10px 38px 86px 0 rgba(0, 0, 0, 0.10) !important;
    position: fixed !important;
    top: var(--header-height, 80px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 99999 !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    transform: translateY(-100%) !important;
    opacity: 0 !important;
    font-family: 'Graphik LCG', sans-serif !important;
    visibility: hidden !important;
    max-height: calc(100vh - var(--header-height, 80px)) !important;
}

.centerpack-menu-wrapper .megamenu--active {
    opacity: 1 !important;
    transform: translateY(0) !important;
    visibility: visible !important;
}

/* Overlay только на мобиле */
@media (max-width: 1024px) {
    .megamenu--active .megamenu__overlay {
        opacity: 1;
        visibility: visible;
    }
}

/* Десктопное отображение */
@media (min-width: 1025px) {
    .megamenu--active .mobile-menu {
        display: none !important;
    }
}

.megamenu__container {
    display: flex;
    padding-bottom: 13px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.megamenu__sidebar {
    flex: 1 1 100%;
    max-width: 427px;
    padding: 40px 25px;
    border-left: 1px solid rgba(28, 27, 40, 0.1);
    border-right: 1px solid rgba(28, 27, 40, 0.1);
}

.centerpack-menu-wrapper .megamenu__list-top {
    padding-bottom: 28px !important;
    margin-bottom: 28px !important;
    border-bottom: 1px solid rgba(28, 27, 40, 0.1) !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 5px !important;
    list-style: none !important;
}

.centerpack-menu-wrapper .megamenu__list {
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
    list-style: none !important;
}

.centerpack-menu-wrapper .megamenu__link {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 11px !important;
    padding: 10px 16px !important;
    transition: all .3s !important;
    border-radius: 5px !important;
    text-decoration: none !important;
    color: inherit !important;
}

.centerpack-menu-wrapper .megamenu__item--new {
    color: rgba(219, 30, 80, 1) !important;
}

.centerpack-menu-wrapper .megamenu__item--new .megamenu__text {
    color: rgba(219, 30, 80, 1) !important;
}

.centerpack-menu-wrapper .megamenu__item--akcii {
    color: rgba(0, 133, 233, 0.9) !important;
}

.centerpack-menu-wrapper .megamenu__item--akcii .megamenu__text {
    color: rgba(0, 133, 233, 0.9) !important;
}

.centerpack-menu-wrapper .megamenu__item:hover .megamenu__link {
    background: #F9F9F9 !important;
}

.centerpack-menu-wrapper .megamenu__item--special .megamenu__text {
    font-weight: 400 !important;
}

.megamenu__icon {
    line-height: 0;
}

.megamenu__icon img {
	border-radius: 0 !important;
}

.centerpack-menu-wrapper .megamenu__list .megamenu__icon img {
    opacity: .2 !important;
    filter: grayscale(1) !important;
    transition: all .3s !important;
}

.centerpack-menu-wrapper .megamenu__list .megamenu__item--active .megamenu__icon img,
.centerpack-menu-wrapper .megamenu__list .megamenu__item:hover .megamenu__icon img {
    opacity: 1 !important;
    filter: none !important;
}

.centerpack-menu-wrapper .megamenu__text {
    font-size: 16px !important;
    font-style: normal !important;
    font-weight: 400 !important;
    line-height: normal !important;
    transition: all .3s !important;
}


.megamenu__arrow {
    margin-left: auto;
    filter: grayscale(1);
    opacity: .2;
    transition: all .3s;
}

.megamenu__item--active:not(.megamenu__item--special) .megamenu__link {
    background: rgba(219, 30, 80, 0.03);
}


.megamenu__item--active .megamenu__arrow,
.megamenu__item:hover .megamenu__arrow {
    filter: none;
    opacity: 1;
}

.megamenu__content {
    flex: 1 1 100%;
    max-width: 100%;
}

.megamenu__tab {
    display: none;
    padding: 40px 66px 60px 55px;
}

.megamenu__tab--active {
    display: block;
}

.megamenu__tab-header {
    margin-bottom: 45px;
}

.megamenu__title {
    color: #191D22;
    font-size: 22px;
    font-weight: 500;
    font-family: 'Graphik LCG';
}

.megamenu__columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 55px;
}

.megamenu__column {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.megamenu__section-title {
    margin: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.megamenu__section-text {
    color: #191D22;
    font-size: 16px;
    font-weight: 400;
    font-family: 'Graphik LCG';
    transition: all .3s;
}

.megamenu__section-text:hover {
    color: #DB1E50;
}

.megamenu__section-arrow {
    line-height: 0;
    filter: grayscale(1);
    opacity: .2;
    transition: all .3s;
    cursor: pointer;
}

.megamenu__section--expanded .megamenu__section-arrow {
    filter: none;
    opacity: 1;
    transform: rotate(180deg);
}

.megamenu__section--expanded .megamenu__section-text {
    color: #DB1E50;
}

.megamenu__sublist {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    display: none;
}

.megamenu__section--expanded .megamenu__sublist {
    display: flex;
}

.megamenu__sublink {
    width: 100%;
    color: #191D22;
    font-size: 16px;
    font-weight: 400;
    transition: all .3s;
    opacity: 0.5;
}

.megamenu__sublink:hover {
    opacity: 1;
}


/* Оверлей для всех устройств */
.megamenu__overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}

.mobile-menu {
    display: none;
}

@media (max-width: 1200px) {
    .megamenu__sidebar {
        max-width: 357px;
    }
}

@media (max-width: 1024px) {
	
	.centerpack-menu-wrapper .catalog-button {
		padding: 8px !important;
	}
	.centerpack-menu-wrapper .megamenu {
		top: 0 !important;
		height: 100vh !important;
		max-height: 100vh !important;
		background: transparent !important;
	}
    .mobile-menu {
        display: block;
    }

    .megamenu--active .megamenu__overlay {
        opacity: 1;
        visibility: visible;
    }
    
    .megamenu--active .mobile-menu {
        display: block !important;
    }

    .catalog-button__text {
        display: none;
    }

    .catalog-button__icon svg,
    .catalog-button__icon {
        width: 24px;
        height: 24px;
    }

    .catalog-button {
        padding: 5px;
        border-radius: 5px;
    }

    .megamenu__container {
        display: none;
    }

    .megamenu {
        position: fixed !important;
        height: 100vh !important;
        width: 100% !important;
        right: auto !important;
        left: 0 !important;
        top: 0 !important;
        transform: none;
		max-height: 100vh !important;
    }
    
    .megamenu--active {
        transform: none;
    }


    /* НОВОЕ МОБИЛЬНОЕ МЕНЮ */
    .mobile-menu {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 312px;
        height: 100vh;
        background: #fff;
        z-index: 1002;
        padding: 14px 12px;
        box-sizing: border-box;
        overflow: hidden;
    }

    .mobile-menu__close,
    .mobile-menu__back {
        width: 34px !important;
        height: 34px !important;
        border-radius: 4px !important;
        background: linear-gradient(84deg, #DB3340 -6.25%, #FF3A5B 85.18%);
        box-shadow: 0 4px 4px 0 rgba(255, 71, 87, 0.25);
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        position: absolute !important;
        top: 14px !important;
        left: 12px !important;
        border: none;
        cursor: pointer;
		        min-height: fit-content !important;
    }

    .mobile-menu__header {
        max-width: 80%;
        height: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 30px;
        margin-inline: auto;
    }

    .mobile-menu__title {
        margin-block: 0;
        color: #191D22;
        text-align: center;
        font-size: 18px;
        font-weight: 600;
        line-height: 20px;
    }

    .mobile-menu__search {
        margin-bottom: 25px;
        display: flex;
        gap: 0;
        border-radius: 5px;
        overflow: hidden;
    }

    .mobile-menu__search-input {
        flex: 1 !important;
        padding: 14px 19px !important;
        border: 1px solid #CFCFCF !important;
        border-radius: 5px 0 0 5px !important;
        background: #FFF !important;
        font-size: 13px !important;
        color: #333 !important;
        outline: none !important;
        border-right: 0 !important;
    }

    .mobile-menu__search-input::placeholder {
        color: #999;
    }

    .mobile-menu__search-btn {
        padding: 14px 18px !important;
        border: none !important;
        color: white !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        cursor: pointer !important;
        transition: all 0.3s;
        background: #DB1E50 !important;
        position: relative;
    }

    .mobile-menu__search-btn::after {
        position: absolute;
        content: "";
        width: 8px;
        height: 16px;
        position: absolute;
        left: -1px;
        bottom: 16px;
        border-top: 8px solid #DB3340;
        border-right: 8px solid #DB3340;
        border-bottom: 8px solid #DB3340;
        background: #DB3340;
        transform: rotate(45deg);
    }

    .mobile-menu__category-title {
        margin: 0 0 20px 0;
        font-size: 18px;
        font-weight: 600;
        color: #191D22;
        padding: 0;
    }

    .mobile-menu__level {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        padding: 14px 12px;
        box-sizing: border-box;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        background: #fff;
        overflow-y: auto;
    }

    .mobile-menu__level--active {
        transform: translateX(0);
    }

    .mobile-menu__nav {
        max-height: calc(100vh - 180px);
        overflow-y: auto;
    }

    .centerpack-menu-wrapper .mobile-menu__list {
        display: flex !important;
        flex-direction: column !important;
        gap: 3px !important;
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .centerpack-menu-wrapper .mobile-menu__list--bottom {
        padding-top: 22px !important;
        margin-top: 22px !important;
        border-top: 1px solid rgba(25, 29, 34, 0.1) !important;
        list-style: none !important;
    }

    .centerpack-menu-wrapper .mobile-menu__link {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 3px !important;
        padding-right: 10px !important;
        text-decoration: none !important;
        color: inherit !important;
        list-style: none !important;
    }

    .mobile-menu__icon {
        width: 32px;
        height: 32px;
        border-radius: 4px;
        border: 0.8px solid rgba(28, 27, 40, 0.10);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .mobile-menu__icon img {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
        aspect-ratio: 1/1;
        object-fit: contain;
		border-radius: 0 !important;
    }

    .mobile-menu__text {
        color: rgb(25, 29, 34);
        font-size: 13px;
        font-weight: 400;
        line-height: normal;
        opacity: 0.9;
        flex: 1;
    }

    .mobile-menu__arrow {
        line-height: 0;
        margin-left: auto;
        flex-shrink: 0;
    }

    .mobile-menu__list--sub .mobile-menu__arrow {
        opacity: 0.2;
        filter: grayscale(1);
    }

    .mobile-menu__list--sub {
        gap: 16px !important;
    }

}