/* Ensure 10px gap between the floating zone (zone13) and the search/header zone (zone15) on desktop */
@media (min-width: 1280px) {
    html body #zone13 {
        margin-bottom: 10px !important;
    }

    html body #zone15 {
        margin-top: 10px !important;
    }
}

/* DESKTOP: prevent header from being fixed and overlapping content on large screens
   Some JS toggles .fixed-active; override it for desktop so header stays in flow. */
@media (min-width: 1280px) {
    html body .zone-fixtop.fixed-active,
    html body .zone-fixtop.fixed-active #zone1,
    html body .zone-fixtop.fixed-active #header {
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        z-index: 50 !important; /* lowered from high value to avoid overlapping */
        width: auto !important;
    }

    /* Ensure any compensator used for fixed header does not add extra spacing on desktop */
    html body .topfix {
        height: 0 !important;
    }
}

/* === АДАПТИВНОСТЬ КАТАЛОГА ДЛЯ БОЛЬШИХ ЭКРАНОВ === */
/* На больших экранах также блокируем ссылки неактивного каталога */
@media (min-width: 1280px) {
    html body .container_12 .grid_2#block58 .menu-button:not(.active) .menu-button-body a,
    html body .container_12 .grid_2#block58 .menu-button:not(.active) .menu-button-body a *,
    html body .container_12 .grid_2#block58 .menu-button:not(.active) .menu-button-body li a,
    html body .container_12 .grid_2#block58 .menu-button:not(.active) .menu-button-body li a * {
        pointer-events: none !important;
        cursor: default !important;
        opacity: 0.5 !important;
    }
    
    /* Скрываем неактивный каталог на больших экранах */
    html body .container_12 .grid_2#block58 .menu-button:not(.active) .menu-button-body {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
}

/* Адаптивность для больших экранов */
@media (min-width: 1280px) {
    #block54 .advantage-items {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 20px !important;
        padding: 0 20px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
        list-style: none !important;
        align-items: stretch !important;
        justify-items: stretch !important;
    }
    
    /* ПРИНУДИТЕЛЬНО РАСТЯГИВАЕМ ЭЛЕМЕНТЫ НА БОЛЬШИХ ЭКРАНАХ */
    #block54 .advantage-items > li {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        float: none !important;
        display: block !important;
        box-sizing: border-box !important;
        justify-self: stretch !important;
        align-self: stretch !important;
        /* ПРИНУДИТЕЛЬНО ОДИНАКОВАЯ ВЫСОТА НА БОЛЬШИХ ЭКРАНАХ */
        height: auto !important;
        min-height: 150px !important;
        max-height: none !important;
    }
    
    #block54 .advantage-items .adv-info {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        /* ПРИНУДИТЕЛЬНО ОДИНАКОВАЯ ВЫСОТА СОДЕРЖИМОГО НА БОЛЬШИХ ЭКРАНАХ */
        height: 100% !important;
        min-height: 150px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }
    
    /* ПРИНУДИТЕЛЬНО РАСТЯГИВАЕМ ОБЪЕКТЫ ВНУТРИ ЭЛЕМЕНТОВ */
    #block54 .advantage-items .obj {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* ПРИНУДИТЕЛЬНО ВЫРАВНИВАЕМ ИЗОБРАЖЕНИЯ И ТЕКСТ НА БОЛЬШИХ ЭКРАНАХ */
    #block54 .advantage-items .image-default {
        width: 100% !important;
        max-width: 100% !important;
        height: 53px !important;
        min-height: 53px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin-bottom: 13px !important;
    }
    
    #block54 .advantage-items .image-default img {
        max-width: 27px !important;
        max-height: 27px !important;
        object-fit: contain !important;
    }
    
    #block54 .advantage-items .adv-data {
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }
    
    #block54 .advantage-items .adv-name {
        width: 100% !important;
        max-width: 100% !important;
        font-size: 12px !important;
        line-height: 1.4 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Desktop: increase right spacing for search field to separate from header icons */
@media (min-width: 1280px) {
    html body .container_12 .grid_8#block33 .searchform {
        gap: 48px !important; /* larger gap between input and button (doubled) */
    }

    html body .container_12 .grid_8#block33 .searchform-inp input.inp {
        padding-right: 48px !important; /* more inner right padding (doubled) */
    }
}

/* Add extra right spacing so search aligns visually with slider on desktop */
@media (min-width: 1280px) {
    html body .container_12 .grid_8#block33 .header_search {
        padding-right: 43px !important; /* reduced by 1.5x from 64px */
        box-sizing: border-box !important;
    }

    /* limit searchform width so the right padding produces visible space */
    html body .container_12 .grid_8#block33 .searchform {
        max-width: calc(100% - 43px) !important;
        box-sizing: border-box !important;
    }
}

/* На больших экранах тоже применяем принудительно */
@media (min-width: 1280px) {
    html body #zone15 .container_12 {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 7.5px !important;
    }
    
    /* Адаптивные стили для больших экранов */
    html body .container_12 .grid_8#block33 .searchform {
        gap: 7.5px !important;
    }
    
    html body .container_12 .grid_8#block33 .searchform-inp input.inp {
        padding: 12px 15px !important;
        font-size: 14px !important;
    }
    
    html body .container_12 .grid_8#block33 .btn-strt input {
        padding: 12px 20px !important;
        font-size: 14px !important;
        min-width: 80px !important;
    }
    
    /* Убираем иконку с кнопки поиска на больших экранах */
    html body .container_12 .grid_8#block33 .btn-strt::before,
    html body .container_12 .grid_8#block33 .btn-strt input::before,
    html body .container_12 .grid_8#block33 .btn-strt input::after {
        content: none !important;
        display: none !important;
        background: none !important;
        background-image: none !important;
    }
    
    /* Критично важно: отменяем ВСЕ иконки на кнопке поиска для больших экранов */
    html body .container_12 .grid_8#block33 .btn-strt,
    html body .container_12 .grid_8#block33 .btn-strt input {
        background-image: none !important;
        background: #e73d25 !important;
    }
    
    html body .container_12 .grid_8#block33 .btn-strt.iconsCol::before,
    html body .container_12 .grid_8#block33 .btn-strt.iconsCol::after,
    html body .container_12 .grid_8#block33 .btn-strt input.iconsCol::before,
    html body .container_12 .grid_8#block33 .btn-strt input.iconsCol::after {
        content: none !important;
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }
    
    /* Кнопка каталога на больших экранах */
    html body .container_12 .grid_2#block58 .menu-button-head {
        padding: 12px 16px !important;
        font-size: 14px !important;
    }
    
    /* Логотип на больших экранах */
    html body .container_12 .grid_2#block15 .logo-img img {
        max-height: 70px !important;
    }
}

/* Align header icons baseline on desktop: reset vertical offsets and ensure same line */
@media (min-width: 1280px) {
    /* remove manual top offsets that cause misalignment */
    #block36 { top: 0 !important; }
    #block47 { top: 0 !important; }
    #block5  { top: 0 !important; }

    /* ensure icon pseudo-elements are vertically centered */
    #block36 .icons.i_user2:before,
    #block47 .icons.i_favorite:before,
    #block5 .basket_mini_a:before {
        top: 50% !important;
        transform: translateY(-50%) !important;
        position: absolute !important;
        left: 0 !important;
        display: block !important;
        width: 30px !important;
        height: 30px !important;
        background-size: contain !important;
        background-position: center !important;
    }

    /* Lower cart icon by 3px for visual alignment */
    #block5 .basket_mini_a:before {
        top: calc(50% + 3px) !important;
    }

    /* align the wrappers */
    #block36 .regper_link,
    #block47 .regper_link,
    #block5 .basket_mini_a {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 30px !important;
        width: 30px !important;
        position: relative !important;
        top: 0 !important;
        margin: 0 4px !important;
    }
}

/* Stronger desktop overrides: ensure WhatsApp+phone is left of admin icon and items don't overlap */
@media (min-width: 1280px) {
    /* constrain phone block width and ensure inline layout inside it */
    html body #block17 {
        max-width: 160px !important;
        width: auto !important;
    }

    html body #block17 .tel_links {
        display: inline-flex !important;
        gap: 6px !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }

    /* Adjust absolute positions around center to avoid overlap */
    html body #block17 { left: calc(50% - 140px) !important; }
    html body #block36 { left: calc(50% - 40px) !important; }
    html body #block47 { left: calc(50% + 8px) !important; }
    html body #block5  { left: calc(50% + 44px) !important; }

    /* Move WhatsApp icon left on desktop only */
    html body #block17 .whatsap:before {
        left: -27px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
    }

    /* Ensure icons keep their size and are centered inside blocks */
    html body #block36 .regper_link,
    html body #block47 .regper_link,
    html body #block5 .basket_mini_a {
        width: 34px !important;
        height: 34px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* keep wrapper pointer-events handling */
    html body #zone1 #header .centered-controls > * { pointer-events: auto !important; }
}

/* Final override: nudge cart icon down by 3px on desktop */
@media (min-width: 1280px) {
    html body #zone1 #header #block5 .basket_mini,
    html body #zone1 #header #block5 .basket_mini_rel {
        margin-top: 3px !important;
        transform: translateY(3px) !important;
    }

    /* keep internal link vertically centered */
    html body #zone1 #header #block5 .basket_mini_open {
        display: flex !important;
        align-items: center !important;
    }
}

/* Nudge phone item slightly left on desktop */
@media (min-width: 1280px) {
    html body #block17 .tel_lp_item {
        /* Increased by 1.5x from -18px -> -27px */
        margin-left: -27px !important;
        transform: translateX(-27px) !important;
        display: inline-block !important;
    }
}
/* === Center-align header controls on desktop (WhatsApp, phone, profile, favorites, cart) === */
@media (min-width: 1280px) {
    /* keep header layout but create a centered controls group */
    html body #zone1 #header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        position: relative !important;
    }

    /* create a centered wrapper for the controls by using a pseudo-container */
    html body #zone1 #header:after {
        content: '' !important;
        display: block !important;
        width: 0 !important;
        height: 0 !important;
        visibility: hidden !important;
    }

    /* center group items individually */
    /* group these elements visually and absolutely center the group */
    html body #block17 .tel_links,
    html body #block36 .tel_links,
    html body #block47 .tel_links,
    html body #block5 .basket_mini {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important; /* reduced by ~1.5x from 6px */
        column-gap: 4px !important;
        white-space: nowrap !important;
    }

    /* wrap the four blocks into a single centered group using absolute positioning */
    /* place a container in the center and move the blocks into it visually */
    html body #block17,
    html body #block36,
    html body #block47,
    html body #block5 {
        position: relative !important;
        display: inline-block !important;
        vertical-align: middle !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* create a central container overlay that aligns the four elements next to each other */
    html body #zone1 #header .centered-controls {
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        pointer-events: none !important; /* pointer-events disabled on wrapper; enable on children */
        /* Ensure this overlay sits below dropdowns: create stacking context and keep low z-index */
        z-index: 1 !important;
    }

    /* allow children to receive pointer events */
    html body #zone1 #header .centered-controls > * {
        pointer-events: auto !important;
    }

    /* WhatsApp link */
    html body #block17 .whatsap,
    html body #block17 .whatsap a {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* phone */
    html body #block17 .tel_lp_item a {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* small icons area: equal size and centered */
    html body #block36 .regper_link,
    html body #block47 .regper_link,
    html body #block5 .basket_mini_a {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 34px !important;
        height: 34px !important;
        padding: 0 !important;
        margin: 0 3px !important; /* reduce lateral margin to keep icons 5-6px apart visually */
        box-sizing: border-box !important;
    }

    /* basket price label centered under icon */
    html body #block5 .basket_mini_open .basket_m_price {
        display: block !important;
        text-align: center !important;
        font-size: 12px !important;
        line-height: 1 !important;
        margin-top: 2px !important;
    }

    /* Force the four header blocks to sit compactly in the center by absolute positioning
       These values are tuned for typical icon sizes; adjust if needed. */
    html body #zone1 #header {
        position: relative !important;
    }

    /* sizing for small icon blocks */
    html body #block36,
    html body #block47,
    html body #block5 {
        width: 34px !important;
        height: auto !important;
    }

    /* whatsapp+phone block slightly wider */
    html body #block17 {
        width: auto !important;
        max-width: 180px !important;
    }

    /* absolutely position each block around the center to form a compact row */
    html body #block17 {
        position: absolute !important;
        left: calc(50% - 92px) !important; /* leftmost */
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 999 !important;
    }

    html body #block36 {
        position: absolute !important;
        left: calc(50% - 28px) !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 999 !important;
    }

    html body #block47 {
        position: absolute !important;
        left: calc(50% + 18px) !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 999 !important;
    }

    html body #block5 {
        position: absolute !important;
        left: calc(50% + 64px) !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 999 !important;
    }

    /* Reduce internal gaps so icons touch closely */
    html body #block36 .regper_link,
    html body #block47 .regper_link,
    html body #block5 .basket_mini_a,
    html body #block17 .tel_links {
        gap: 6px !important;
        column-gap: 6px !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Desktop: stack WhatsApp above phone and prevent overlap with icons */

@media (min-width: 1280px) {

    /* Stack in two rows inside block17 */

    html body #block17 .tel_links {

        display: inline-flex !important;

        flex-direction: column !important;

        align-items: flex-start !important;

        justify-content: center !important;

        gap: 2px !important;

        padding: 0 !important;

        margin: 0 !important;

        white-space: nowrap !important;

    }



    html body #block17 .whatsap {

        display: block !important;

        padding: 0 !important;

        margin: 0 0 2px 0 !important;

    }



    html body #block17 .whatsap a {

        display: inline-block !important;

        white-space: nowrap !important;

        font-size: 13px !important;

        line-height: 1 !important;

        color: #38c500 !important;

    }



    html body #block17 .tel_lp_item a {

        display: inline-block !important;

        font-size: 14px !important;

        line-height: 1 !important;

        color: inherit !important;

    }



    /* Adjust absolute positions to avoid overlap: move block17 further left */

    html body #block17 { left: calc(50% - 200px) !important; top: calc(50% + 37px) !important; transform: translateY(-50%) !important; }

    html body #block36 { left: calc(50% - 48px)  !important; top: 50% !important; transform: translateY(-50%) !important; }

    html body #block47 { left: calc(50% + 2px)   !important; top: calc(50% + 5px) !important; transform: translateY(-50%) !important; }

    html body #block5  { left: calc(50% + 48px)  !important; top: calc(50% + 7px) !important; transform: translateY(-50%) !important; }



    /* Make sure the blocks are compact */

    html body #block36 .regper_link,

    html body #block47 .regper_link,

    html body #block5 .basket_mini_a {

        width: 34px !important;

        height: 34px !important;

        padding: 0 !important;

        margin: 0 !important;

        display: inline-flex !important;

        align-items: center !important;

        justify-content: center !important;

    }



    /* Ensure block17 internal spacing is small so stacked items align */

    html body #block17 .tel_links > * { margin: 0 !important; padding: 0 !important; }

}

/* Final override: nudge cart icon down by 3px on desktop */
@media (min-width: 1280px) {
    html body #zone1 #header #block5 .basket_mini,
    html body #zone1 #header #block5 .basket_mini_rel {
        margin-top: 3px !important;
        transform: translateY(3px) !important;
    }

    /* keep internal link vertically centered */
    html body #zone1 #header #block5 .basket_mini_open {
        display: flex !important;
        align-items: center !important;
    }
}


