.right_side_nav_container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}

.nav-separator {
    margin: 0 4px;
    color: #aaa;
}

/* тогл згортання верхньої плашки — лише на мобілках */
.accounts-toggle {
    display: none;
}

@media (max-width: 820px) {
    /* плашка: одна компактна строка [Інформація ▾] ... [Українська ▾] */
    #top_page .container-fluid {
        flex-wrap: wrap;
        row-gap: 6px;
        margin: 0 12px !important;
        padding: 4px 0;
    }

    .accounts-toggle {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        order: 1;
        background: none;
        border: none;
        padding: 4px 0;
        font-size: 14px;
        color: #6c757d;
        cursor: pointer;
    }
    .accounts-toggle-chevron {
        width: 16px;
        height: 16px;
        transition: transform .2s ease;
    }
    #top_page.accounts-open .accounts-toggle-chevron {
        transform: rotate(180deg);
    }

    /* розкладаємо вміст light_side прямо в рядок плашки, щоб керувати порядком.
       !important — щоб перебити bootstrap .d-flex (display:flex !important) */
    #top_page .light_side_nav_container.d-flex,
    #top_page .light_side_nav_container {
        display: contents !important;
    }
    /* мова — праворуч у верхній компактній строці */
    #top_page .light_side_nav_container .dropdown {
        order: 2;
        margin-left: auto;
    }

    /* інфо-посилання й телефон сховані, поки не розгорнуто */
    #top_page .right_side_nav_container,
    #top_page .contact-phone {
        display: none;
    }

    /* посилання — стовпчиком на всю ширину */
    #top_page .right_side_nav_container {
        order: 3;
        flex: 0 0 100%;
    }
    #top_page.accounts-open .right_side_nav_container {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding-top: 6px;
    }
    /* у стовпчику роздільники "|" не потрібні */
    #top_page.accounts-open .nav-separator {
        display: none;
    }

    /* телефон — у самому низу, на всю ширину */
    #top_page.accounts-open .contact-phone {
        display: block !important;
        order: 5;
        flex: 0 0 100%;
        width: 100%;
        text-align: center;
        margin-top: 6px;
        padding-top: 8px;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
    }
}

.mini-basket-wrapper button {
    display: flex;
    width: 36px;
    height: 36px;
    padding: 6px;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    border-radius: 21px;
    border: 1px solid #E2E4EC;
    background: #fff;
}

.grid-selection {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    padding: 10px 0 0 0;;
}

.grid-selection button {
    border: 1px solid var(--color-primary-seconday);
    border-radius: 8px;
    cursor: pointer;
    margin-left: 10px;
    padding: 5px;
    transition: all 0.3s ease;
    box-shadow: #6c757d33 0 1px 0;
    background-color: var(--color-primary-seconday)
}


.grid-selection button svg {
    width: 24px;
    height: 24px;
    color: black;
    background-color: var(--color-primary-seconday)
}

.grid-selection button:hover {
    box-shadow: #6c757d33 0 3px 0;
    svg {
        color: white;
    }
}

.grid-selection button:active{
    transform: scale(0.95);
    box-shadow: #6c757d33 0 1px 0;

}



.vostok-auto-brand a {
    color: var(--color-primary-brand);
}

.btn.btn-primary.btn-lg.search-button {
    background-color: var(--color-primary);
    color: white;
    border: var(--color-primary);
}


.log-in-wrapper {
    display: flex;
    flex-direction: row;
    gap: 5px;
}

.log-in-wrapper svg {
    width: 24px;
    height: 24px;
}

.layout_page {
    min-height: 100vh; 
    background-color: #fff;
    display: flex;
    flex-direction: column;
}

@media (min-width: 1460px) {
    header {
        display: block;
        margin: 0 20px;
        padding: 0 12px;
    }

    .aside-menu-wrapper {
        display: none !important;
    }

    .page_inner_1 {
        padding: 15px 0;
        margin: 0 80px;
    }

    .page_inner {
        /*padding: 0 20px;*/
        margin: 0 80px 20px;
        border: none !important;
        box-shadow: none !important;
    }

    .primary_inner,
    .mini-basket-wrapper,
    .primary-nav-bar {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 5px;
    }

    .search_bar {
        display: flex;
        width: 1100px;
        align-items: center;
    }

    .nav-primary-other-dimensions {
        display: none;
    }

    .mini-basket-wrapper button img {
        background: none !important;
    }

    .container {
        max-width: 1900px !important;
    }

    .container.page {
        padding: 0 !important;
        margin: 0 20px !important;
        width: 100% !important;

    }


    /* По умолчанию - базовый grid */
    .products-grid.grid-net {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        width: 100%;
        overflow: hidden;
        gap: 0;
    }

    /* Очень большие экраны: 7 колонок */
    @media (min-width: 1700px) {
        .products-grid.grid-net {
            grid-template-columns: repeat(7, 1fr);
        }
    }

    /* Большие экраны: 6 колонок */
    @media (min-width: 1460px) and (max-width: 1699px) {
        .products-grid.grid-net {
            grid-template-columns: repeat(6, 1fr);
        }
    }

    /* Средние-большие экраны: 5 колонок */
    @media (min-width: 1200px) and (max-width: 1459px) {
        .products-grid.grid-net {
            grid-template-columns: repeat(5, 1fr);
        }
    }

    /* Средние экраны: 4 колонки */
    @media (min-width: 1024px) and (max-width: 1199px) {
        .products-grid.grid-net {
            grid-template-columns: repeat(4, 1fr);
        }
    }

    /* Планшеты: 3 колонки */
    @media (min-width: 768px) and (max-width: 1023px) {
        .products-grid.grid-net {
            grid-template-columns: repeat(3, 1fr);
        }
    }

    /* Маленькие планшеты: 2 колонки */
    @media (min-width: 480px) and (max-width: 767px) {
        .products-grid.grid-net {
            grid-template-columns: repeat(2, 1fr);
        }
    }

    /* Мобильные: 1 колонка */
    @media (max-width: 479px) {
        .products-grid.grid-net {
            grid-template-columns: repeat(1, 1fr);
        }
    }

    .log-in-wrapper {
        display: flex;
        flex-direction: row;
        gap: 5px;
    }

    .footer-content {
        left: 40%;
    }

    .pagination {
        margin-top: 10px !important;
    }

    .products-grid.grid-net > .col:nth-child(1) .product-card {
        border-top-left-radius: 12px;
    }

    .products-grid.grid-net > .col:nth-child(7) .product-card {
        border-top-right-radius: 12px;
    }

    .products-grid.grid-net > .col:nth-last-child(-n+7):nth-child(7n + 1) .product-card {
        border-bottom-left-radius: 12px;
    }

    .products-grid.grid-net > .col:nth-last-child(-n+7):nth-child(7n),
    .products-grid.grid-net > .col:last-child .product-card {
        border-bottom-right-radius: 12px;
    }
}


/* Очень большие экраны: 7 колонок */
@media (min-width: 1700px) {
    .products-grid.grid-net {
        grid-template-columns: repeat(7, 1fr);
    }
    
    .products-grid.grid-net > .col:nth-child(1) .product-card {
        border-top-left-radius: 12px;
    }
    
    .products-grid.grid-net > .col:nth-child(7) .product-card {
        border-top-right-radius: 12px;
    }
    
    .products-grid.grid-net > .col:nth-last-child(-n+7):nth-child(7n + 1) .product-card {
        border-bottom-left-radius: 12px;
    }
    
    .products-grid.grid-net > .col:nth-last-child(-n+7):nth-child(7n),
    .products-grid.grid-net > .col:last-child .product-card {
        border-bottom-right-radius: 12px;
    }
}


/* Большие экраны: 6 колонок */
@media (min-width: 1451px) and (max-width: 1699px) {
    .products-grid.grid-net {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .products-grid.grid-net > .col:nth-child(1) .product-card {
        border-top-left-radius: 12px;
    }
    
    .products-grid.grid-net > .col:nth-child(6) .product-card {
        border-top-right-radius: 12px;
    }
    
    .products-grid.grid-net > .col:nth-last-child(-n+6):nth-child(6n + 1) .product-card {
        border-bottom-left-radius: 12px;
    }
    
    .products-grid.grid-net > .col:nth-last-child(-n+6):nth-child(6n),
    .products-grid.grid-net > .col:last-child .product-card {
        border-bottom-right-radius: 12px;
    }
}


/* Средние экраны: 5 колонок */
@media (min-width: 1025px) and (max-width: 1450px) {
    .products-grid.grid-net {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .products-grid.grid-net > .col:nth-child(1) .product-card {
        border-top-left-radius: 12px;
    }
    
    .products-grid.grid-net > .col:nth-child(5) .product-card {
        border-top-right-radius: 12px;
    }
    
    .products-grid.grid-net > .col:nth-last-child(-n+5):nth-child(5n + 1) .product-card {
        border-bottom-left-radius: 12px;
    }
    
    .products-grid.grid-net > .col:nth-last-child(-n+5):nth-child(5n),
    .products-grid.grid-net > .col:last-child .product-card {
        border-bottom-right-radius: 12px;
    }
}


@media (max-width: 1450px) {
    header {
        display: block;
        margin: 0 65px !important;
        padding: 0 12px;
    }

    .aside-menu-wrapper {
        display: none !important;
    }

    .page_inner_1 {
        padding: 10px 0;
    }

    .primary_inner,
    .mini-basket-wrapper,
    .primary-nav-bar {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 5px;
    }

    .search_bar {
        display: flex;
        width: 750px;
        align-items: center;
    }

    .container.page {
        padding: 0 !important;
        margin-top: 0 !important;
    }

    .page .page_inner {
        border: none !important;
        box-shadow: none !important;
    }


    .footer-content {
        left: 36%;
    }

    .pagination {
        margin-top: 10px !important;
    }
}


@media (max-width: 1024px) {

    body header {
        margin: 0 !important;
        padding: 0 12px;

    }

    .aside-menu-wrapper {
        display: none !important;
    }

    .row {
        flex-wrap: wrap;
    }

    .sidebar,
    .brand,
    .navbar-details {
        display: none !important;
    }

    .col-sm-8.col-md-9 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    .page_inner_1 {
        display: flex;
        padding: 15px 0;
    }

    #first {
        order: 1;
    }

    #second {
        order: 0;
    }


    .primary_inner,
    .mini-basket-wrapper {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 5px;
    }

    .search_bar {
        display: flex;
        width: 530px;
        align-items: center;
        margin-right: 10px;
    }

    .container.page {
        padding: 0 !important;
        margin-top: 0 !important;
    }

    .page .page_inner {
        border: none !important;
        box-shadow: none !important;
    }

    .log-in-wrapper {
        display: flex;
        flex-direction: row;
        gap: 5px;
    }

    .footer-content {
        left: 33%;
    }
}


/* Планшеты: 3 колонки */
@media (min-width: 821px) and (max-width: 1024px) {
    .products-grid.grid-net {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .products-grid.grid-net > .col:nth-child(1) .product-card {
        border-top-left-radius: 12px;
    }
    
    .products-grid.grid-net > .col:nth-child(3) .product-card {
        border-top-right-radius: 12px;
    }
    
    .products-grid.grid-net > .col:nth-last-child(-n+3):nth-child(3n + 1) .product-card {
        border-bottom-left-radius: 12px;
    }
    
    .products-grid.grid-net > .col:nth-last-child(-n+3):nth-child(3n),
    .products-grid.grid-net > .col:last-child .product-card {
        border-bottom-right-radius: 12px;
    }
}


@media (max-width: 820px) {
    body header {
        margin: 0 !important;
        padding: 0;
    }

    /* на мобілці лише стандартна сітка — перемикач вигляду ховаємо */
    .grid-selection {
        display: none !important;
    }

    .row {
        flex-wrap: wrap;
    }

    .sidebar,
    .brand,
    .navbar-details {
        display: none !important;
    }

    .col-sm-8.col-md-9 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    /* колонкою: шапка (primary_inner) на всю ширину зверху, навігація під нею —
       інакше display:flex(row) з блоку ≤1024 стискав primary_inner і пошук */
    .page_inner_1 {
        display: flex;
        flex-direction: column;
        padding: 15px 0;
    }

    .primary_inner {
        display: flex;
        flex-direction: row;
        gap: 10px;
        align-items: center;
        flex-wrap: nowrap;
        padding: 8px 12px !important;
        box-sizing: border-box;
    }

    /* однакові бічні відступи контенту сторінок на мобілках */
    .page_inner {
        padding-left: 12px !important;
        padding-right: 12px !important;
        box-sizing: border-box;
    }

    /* фантомний margin-left:10px (інлайн) лишається після приховування aside
       на мобілці → асиметрія й вихід за екран. Прибираємо. */
    .layout2_subcontent_container {
        margin-left: 0 !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    .layout2_content_container {
        display: block !important;
    }

    /* бургер-меню видиме на всіх телефонах (не лише ≤400), планшетне ховаємо */
    .aside-menu-wrapper,
    .smartphone-menu-container {
        display: block !important;
    }
    .aside-menu-wrapper {
        flex: 0 0 auto;
    }
    .tablet-aside-menu-wrapper {
        display: none !important;
    }

    .search_bar {
        display: flex;
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        margin-right: 0;
        align-items: center;
    }

    /* Кошик на мобілці більше НЕ ховаємо: раніше .mini-basket-wrapper тут був
       display:none, і кошик існував лише в бічному меню — знайти його було
       нереально. Тепер кошик у шапці та в нижній навігації, а службові кнопки
       (акаунт/дашборд/вихід) лишились у меню — див. mobile.css. */

    .container.page {
        width: 100% !important;
        padding: 0 !important;
    }

    .page .page_inner {
        border: none !important;
        box-shadow: none !important;
    }

    /* форма/група займають усю ширину search_bar і не вилазять */
    .search_bar form,
    .search_bar .input-group {
        width: 100%;
        flex-wrap: nowrap;
        margin: 0;
    }

    .search_bar input {
        width: 100%;
        box-sizing: border-box;
        padding: 6px 10px;
        /* 16px — щоб iOS Safari не зумив екран при фокусі на полі пошуку */
        font-size: 16px;
        /* кнопка submit прихована → інпут має повне заокруглення й праву рамку */
        border-radius: 8px !important;
        border: 1px solid #ccc;
    }

    .search_bar button {
        display: none;
    }

    .custom-dropdown-toggle {
        width: 170px;
        height: 43px;
        font-size: 25px !important;
    }

    .custom-dropdown-toggle span {
        padding: 0 10px !important;
    }

    .custom-dropdown-toggle svg {
        display: none;
    }

    .footer-content {
        left: 20%;
    }


}


/* Маленькие планшеты/большие смартфоны: 2 колонки */
@media (min-width: 401px) and (max-width: 820px) {
    .products-grid.grid-net {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .products-grid.grid-net > .col:nth-child(1) .product-card {
        border-top-left-radius: 12px;
    }
    
    .products-grid.grid-net > .col:nth-child(2) .product-card {
        border-top-right-radius: 12px;
    }
    
    .products-grid.grid-net > .col:nth-last-child(-n+2):nth-child(2n + 1) .product-card {
        border-bottom-left-radius: 12px;
    }
    
    .products-grid.grid-net > .col:nth-last-child(-n+2):nth-child(2n),
    .products-grid.grid-net > .col:last-child .product-card {
        border-bottom-right-radius: 12px;
    }
}

/* Блок @media (max-width: 400px) прибрано на етапі 3.
   Мобільний брейкпоінт у проєкті один — max-width 820px (див. mobile.css).
   Що було в блоці і куди пішло:
   • одна колонка в сітці товарів і радіуси під неї → тепер дві колонки на
     всіх мобільних ширинах (mobile.css, етап 3);
   • #messages, .alertinner, .page_inner, .container.page,
     .layout2_subcontent_container → перенесено в mobile.css;
   • .primary_inner / .search_bar / .log-in-wrapper → замінені правилами
     шапки з етапу 1;
   • .cart-button, .menu-toggle, .custom-navbar, .custom-dropdown-toggle,
     .nav-primary, .contact-phone, .text-secondary → мертвий код: класи
     живуть лише в nav_primary.html (закоментований у layout.html) або
     в прихованій на мобілці верхній смузі. */
