.ui-autocomplete {
    background: #ffffff;
    padding: 0;
    border: 1px solid #cccccc;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);

    max-width: 300px; /* Задайте нужную вам ширину */
}

.ui-autocomplete .ui-menu-item {
    list-style: none;
    padding: 10px;
    max-width: 300px; /* Задайте нужную вам ширину */
}


/* Стили для карточек на странице списка */
.card-deck .card {
    margin-bottom: 1rem;
}

.card-deck .card-body {
    display: flex;
    padding: 1rem;
}

.card-deck .announcement-image {
    flex-shrink: 0;
}

/* Убедимся, что изображения видны */
.card-body .mr-3 {
    flex-shrink: 0;
}

/* Стили для детальной страницы объявления */
.announcement-detail-image {
    width: 300px;
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.announcement-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    margin: 0 auto;
}

/* Карусель для изображений */
.image-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    object-fit: cover;
    object-position: center;
}

.carousel-image.active {
    opacity: 1;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background-color 0.3s ease;
    z-index: 10;
}

.carousel-nav:hover {
    background: rgba(0, 0, 0, 0.7);
}

.carousel-nav.prev {
    left: 8px;
}

.carousel-nav.next {
    right: 8px;
}

.carousel-indicators {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    z-index: 10;
}

.carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.carousel-indicator.active {
    background: rgba(255, 255, 255, 0.9);
}

.carousel-indicator:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* Медиазапрос для мобильных устройств - горизонтальный прямоугольник на всю ширину */
@media (max-width: 767px) {
    .announcement-detail-image {
        width: 100%;
        height: 200px;
        max-height: 200px;
        margin-bottom: 15px;
    }
    
    /* На мобильных картинка и текст в колонку */
    .card-body.d-flex {
        flex-direction: column !important;
    }
    
    .card-body .mr-3 {
        margin-right: 0 !important;
        margin-bottom: 15px;
    }
}

/* Стили для списка объявлений - уменьшенные фото */
.announcement-image {
    width: 200px;
    height: 150px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.announcement-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    margin: 0 auto;
}

/* Медиазапрос для мобильных устройств в списке */
@media (max-width: 767px) {
    .announcement-image {
        width: 120px;
        height: 90px;
    }
}

.advertisment-announcement-image {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    padding: 11px 8px;
    background: #fff;
}

.through-banner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid #e0e0e0;
    padding: 10px;
    margin: 10px 0;
    max-width: 330px;
    background: #fff;
}

.through-banner-content {
    width: 100%;
    display: block;
    text-align: left;
    padding: 8px 0 0;
}

.through-banner-image {
    width: 100%;
    min-height: 0;
    height: auto;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
}

.through-banner-image > a {
    display: block;
    width: 100%;
}

.through-banner-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 365px;
    object-fit: contain;
    object-position: center;
}

.advertisment-image {
    flex: 0 0 min(41.6667%, 180px);
    width: min(41.6667%, 180px);
    height: 80px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.advertisment-image > a {
    display: block;
    width: 100%;
    height: 100%;
}

.advertisment-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.advertisment-content {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}

.advertisment-link {
    color: #111;
    text-decoration: none;
}

.advertisment-link:hover,
.advertisment-link:focus {
    color: #087b2d;
    text-decoration: underline;
}

.advertisment-title {
    margin: 0 0 2px;
    color: #111;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.advertisment-copy {
    margin: 0 0 6px;
    color: #111;
    font-size: 13px;
    line-height: 1.3;
}

a.advertisment-phone,
a.advertisment-phone:link,
a.advertisment-phone:visited {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-height: 30px;
    margin: 2px 0 5px;
    padding: 4px 9px;
    border: 1px solid #bfc3c5;
    border-radius: 0;
    background: #fff;
    color: #111;
    font-size: 12px;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

a.advertisment-phone:hover,
a.advertisment-phone:focus {
    border-color: #198754;
    color: #087b2d;
    text-decoration: none;
}

.advertisment-announcement-card {
    border-bottom: 1px solid #dedede;
    margin: 0;
}

.advertisment-company-card {
    border: 1px solid #dedede;
    margin: 10px 0;
}

.advertisment-company-card .advertisment-image {
    flex-basis: 82px;
    width: 82px;
    height: 64px;
}

.advertisment-company-card .advertisment-image img {
    object-fit: contain;
}

.advertisment-company-card .advertisment-title {
    color: #111;
    font-size: 13px;
    text-transform: uppercase;
}

.through-banner-title {
    margin: 0 0 4px;
    color: #111;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.through-banner-copy {
    margin: 0 0 7px;
    color: #111;
    font-size: 12px;
    line-height: 1.35;
    white-space: pre-line;
}

.through-banner .advertisment-phone {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 0;
}

.phone-button {
    align-items: center;
    background-color: #198754;
    color: #fff;
    padding: 5px 5px;
    border-radius: 5px;
    text-decoration: none;
}
.phone-icon {
    margin-right: 2px;
    /* Здесь может быть ваш код для иконки телефона */
}
.advertisment-details {
    margin-top: 1px;
    color: #777;
    font-size: 12px;
    line-height: 1.25;
}

.custom-ad-slot {
    margin-bottom: 18px !important;
}

.advertisment-custom {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.advertisment-custom > .list-group {
    margin: 0;
}

.advertisment-custom > .list-group > .list-group-item {
    padding: 10px 14px;
    border-radius: 0;
}

.advertisment-custom .row {
    align-items: center;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.advertisment-custom img {
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.advertisment-custom .row > [class*="col-"]:first-child img {
    max-height: 105px !important;
}

.advertisment-custom p {
    margin-top: 0 !important;
    margin-bottom: 5px !important;
    line-height: 1.35;
}

.advertisment-custom p[style*="font-size"] {
    color: #111;
    font-weight: 700;
}

.advertisment-custom a:not([href^="tel:"]) {
    color: #111;
}

.advertisment-custom a[href^="tel:"] {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 4px 9px;
    border: 1px solid #bfc3c5;
    background: #fff;
    color: #111;
    text-decoration: none;
}

@media (max-width: 991px) {
    .through-banner {
        width: 100%;
        max-width: 330px;
    }
}

@media (max-width: 575px) {
    .advertisment-announcement-image {
        gap: 8px;
        padding: 10px 4px;
    }

    .advertisment-image {
        flex-basis: min(41.6667%, 150px);
        width: min(41.6667%, 150px);
        height: 80px;
    }

    .advertisment-title {
        font-size: 15px;
    }

    .advertisment-custom .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        text-align: center;
    }
}

/* Legacy context-main: compact list row with an optional 5/12 image. */
.context-ad-slot {
    margin-bottom: 0 !important;
}

.context-main-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    padding: 10px 8px;
    border-bottom: 1px solid #dedede;
    background: #fff;
    font-size: 13px;
    line-height: 1.35;
    color: #111;
}

.context-main-banner a {
    color: #111;
    text-decoration: none;
}

.context-main-banner a:hover,
.context-main-banner a:focus {
    color: #087b2d;
    text-decoration: underline;
}

.context-main-image {
    flex: 0 0 min(41.6667%, 180px);
    width: min(41.6667%, 180px);
    height: 80px;
    overflow: hidden;
}

.context-main-image > a,
.context-main-image img {
    display: block;
    width: 100%;
    height: 100%;
}

.context-main-image img {
    object-fit: cover;
    object-position: center;
}

.context-main-text {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}

.context-main-title,
.context-main-desc {
    display: block;
}

.context-main-title {
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
}

.context-main-desc {
    max-height: 68px;
    overflow: hidden;
    white-space: pre-line;
}

.context-main-banner .advertisment-phone {
    margin-bottom: 3px;
}

@media (max-width: 575px) {
    .context-main-image {
        flex-basis: min(41.6667%, 150px);
        width: min(41.6667%, 150px);
    }
}

#productionContainer {
    position: absolute; /* Позиционируем контейнер абсолютно */
    top: 0; /* Располагаем его вверху страницы */
    left: 0; /* Располагаем его слева страницы */
    background-color: white; /* Устанавливаем цвет фона (можете выбрать нужный) */
    z-index: 9999; /* Устанавливаем высокий уровень z-index, чтобы он был поверх других элементов */
    /* Добавьте другие стили по вашему усмотрению */
}

.input-group {
    position: relative; /* Добавьте это, если еще не добавлено */
}

/* Common style for all levels of dropdown menu and submenu */
.dropdown-menu, .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    float: left;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin: 0.125rem 0 0;
    font-size: 1rem;
    color: #212529;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175);
}

/* Header search inputs: wrapper to position clear icon inside.
   Делаем её flex‑элементом, как обычный input, чтобы всё
   влезало в одну строку и на десктопе, и на мобилке. */
.search-input-wrapper {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
}

/* Выравниваем высоту инпутов в шапке: обёрнутые в search-input-wrapper
   должны быть такого же размера, как и обычный input-group-sm */
.input-group-sm .search-input-wrapper > .form-control {
    padding: .25rem .5rem;
    font-size: .875rem;
    line-height: 1.5;
    height: calc(1.5em + .5rem + 2px);
}

/* Строка поиска в шапке всегда в одну линию */
#search-group {
    flex-wrap: nowrap;
}

/* Делим ширину примерно поровну между полями,
   включая текстовый поиск */
#search-group .search-input-wrapper,
#search-group #search2 {
    flex: 1 1 0;
    min-width: 0;
}

@media (max-width: 575.98px) {
    /* Чуть уменьшаем шрифт и отступы, чтобы всё влезло */
    #search-group .form-control,
    #search-group .btn {
        font-size: .8rem;
        padding-top: .2rem;
        padding-bottom: .2rem;
    }
}

/* Small text clear (×) in header search filters, shown inside input on the right */
.clear-filter {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-block;
    font-size: 14px;
    line-height: 1;
    color: #999999;
    cursor: pointer;
    user-select: none;
}
.clear-filter:hover {
    color: #2e7d32;
}

/* Positioning for submenu */
.submenu {
    position: absolute;
    top: 0; /* Align the top edge of the submenu with the top edge of its parent */
    left: 100%; /* Position the submenu to the right of its parent */
    min-width: 200px; /* Set a minimum width for the submenu */
    min-height: 100%; /* Set a minimum height for the submenu */
    display: none; /* Hide the submenu by default */
}

/* Positioning for nested submenu */
.submenu .submenu {
    left: 100%;
    top: 0;
}

/* Common style for menu items */
.dropdown-menu li, .submenu li {
    cursor: pointer;
    padding: 0.25rem 1rem;
    clear: both;
    font-weight: normal;
    line-height: 1.5;
    color: #212529;
    white-space: nowrap;
}

/* Additional style for menu items with submenu */
.dropdown-menu li.has-submenu, .submenu li.has-submenu {
    position: relative;
}

/* Style for arrow ">" in items with submenu */
.dropdown-menu li.has-submenu .caret::after, .submenu li.has-submenu .caret::after {
    content: ' >'; /* Use the greater-than sign */
    position: absolute; /* Position it absolutely */
    left: 0; /* Position it 5px from the right edge of the menu item */
    top: 50%; /* Center it vertically */
    transform: translateY(-50%); /* This ensures the symbol is perfectly centered, regardless of its size */
}

/* Style for active (selected) menu items */
.dropdown-menu li.active, .submenu li.active {
    background-color: #2e7d32;
    color: #fff;
}

/* Ensure active items inside dropdown menus (including Bootstrap links) use green, not blue */
.dropdown-menu li.active > a,
.dropdown-menu .dropdown-item.active,
.dropdown-menu .dropdown-item:active {
    background-color: #2e7d32 !important;
    color: #ffffff !important;
}

/* Style for hovered menu items */
.dropdown-menu li:hover, .submenu li:hover {
    background-color: #f8f9fa; /* Change to the color you want for hover */
    color: #212529;
}

/* Style for active parent when we are in a deeper level */
.dropdown-menu li.has-submenu:focus-within, .submenu li.has-submenu:focus-within {
    background-color: #f8f9fa; /* Change to the color you want for active parent */
    color: #212529;
}

/* Style for arrow ">" in items with submenu */
li.has-submenu::after {
    content: '>'; /* Use the greater-than sign */
    position: absolute; /* Position it absolutely */
    right: 5px; /* Position it 5px from the right edge of the menu item */
    top: 50%; /* Center it vertically */
    transform: translateY(-50%); /* This ensures the symbol is perfectly centered, regardless of its size */
    font-size: 1.5em; /* Make the arrow bigger */
}

/* Make the arrow bold on hover */
li.has-submenu:hover::after {
    font-weight: bold;
}

/* ===== Header user button and dropdown tuning ===== */
.user-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    line-height: 1;
    border: 2px solid #2e7d32;
    border-radius: 28px;
    background: #ffffff;
}

@media (max-width: 767px) {
    .user-link {
        padding: 6px 12px;
        height: 44px; /* align visually with logo area */
    }
}

/* sticky footer: ensure footer sticks to bottom on short pages */
html, body {
    height: 100%;
}
body > article {
    min-height: calc(100vh - 220px); /* approx header+footer height */
}

/* Make the dropdown compact on mobile and allow long text wrapping */
.dropdown-menu.dropdown-menu-right {
    width: 280px;
    max-width: 90vw;
    padding-top: 8px;
    padding-bottom: 8px;
}

.dropdown-menu.dropdown-menu-right .dropdown-item {
    white-space: normal; /* allow wrapping for long text */
    line-height: 1.3;
}

/* Stronger selector for the header user button to override Bootstrap */
#user-menu.user-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    height: auto; /* avoid oval on mobile */
    box-sizing: border-box;
    line-height: 1;
    border: none;
    background: transparent;
    margin-top: 0;
}

@media (min-width: 768px) {
    #user-menu.user-link {
        height: 48px;
        padding: 8px 14px;
    }
}

/* Tighten dropdown spacing under the button */
.dropdown-menu[aria-labelledby="user-menu"] {
    margin-top: 0 !important; /* no gap between button and menu */
    right: 0; /* keep inside viewport */
    left: auto; /* align to the right edge of button */
    transform: translateY(-2px); /* overlap by 2px to avoid hover gap */
    border-top: 0; /* seamless joint */
    min-width: 220px;
}

/* Avatar button */
.user-avatar-btn .avatar-circle {
    width: 46px; height: 46px; /* +15% from 40px */
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: #ffffff; /* white background so logos on white are visible with border */
    color: #2e7d32;
    border: 2px solid #2e7d32; /* always green ring */
    overflow: hidden;
    position: relative;
}
.user-avatar-btn .avatar-circle img {
    width: 100%; height: 100%; object-fit: cover; object-position: center;
}
.dropdown-avatar { width: 32px; height: 32px; min-width: 32px; min-height: 32px; border-radius: 50%; border: 1px solid #2e7d32; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.6); }
.dropdown-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center; opacity: .85; }
.user-avatar-btn .avatar-circle i {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    line-height: 1;
}

/* Align avatar to top of text block in dropdown header */
.dropdown-menu .dropdown-header.d-flex {
    align-items: flex-start;
}
.dropdown-menu .dropdown-header .dropdown-avatar {
    margin-top: 2px;
}

/* Constrain text block width in dropdown header so long lines wrap nicely */
.dropdown-header .dropdown-user-text {
    max-width: 180px;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal; /* allow wrapping */
    min-width: 0; /* allow flex item to shrink and wrap */
}

@media (min-width: 768px) {
    .dropdown-header .dropdown-user-text {
        max-width: 220px;
    }
}

/* Ensure dropdown header itself permits wrapping (Bootstrap sets nowrap) */
.dropdown-menu .dropdown-header {
    white-space: normal !important;
}

/* Show submenu on hover */
li[data-has-submenu="true"]:hover .submenu {
    display: block;
}

/* Show caret when submenu is not open */
li[data-has-submenu="true"] > .caret {
    display: inline;
}

/* Hide caret when submenu is open */
li[data-has-submenu="true"].open > .caret {
    display: none;
}

/* Hide the back and close buttons by default */
.back-button, .close-button {
    display: none;
}

/* Show the back and close buttons on small screens */
@media (max-width: 767px) {
    .dropdown-menu, .submenu {
        width: 100%; /* Или 50%, в зависимости от ваших предпочтений */
        left: 0 !important; /* Переопределите любые динамические изменения, сделанные с JS */
    }

    .dropdown-menu {
        min-height: 400px;
    }

    .back-button, .close-button {
        display: block;
    }

    .submenu,
    .submenu.submenu,
    .submenu.submenu.submenu,
    .submenu.submenu.submenu.submenu {
        position: fixed; /* Позиционируем подменю фиксированно */
        top: 0; /* Располагаем его вверху страницы */
        left: 0; /* Располагаем его слева страницы */
        width: 100%; /* Занимаем всю ширину экрана */
        height: 100%; /* Занимаем всю высоту экрана */
        overflow: auto; /* Добавляем прокрутку, если контент не помещается */
        padding-top: 40px; /* add padding-top */
        /* Нарисовать линию разделения после 40px от края */
        border-top: 1px solid #ddd;
    }

    .dropdown-menu {
        padding-top: 30px !important; /* add padding-top */
    }

    .dropdown-menu > .back-button {
        color: #ddddbb; /* Change the color of the back button */
    }

    .dropdown-menu > .back-button,
    .dropdown-menu > .close-button {
        display: block; /* Hide the back and close buttons on the first dropdown menu */
    }

    .submenu > .back-button,
    .submenu > .close-button {
        display: block; /* Show the back and close buttons on the submenus */
    }

    .submenu.open {
        z-index: 2000;
    }

    .submenu .submenu.open {
        z-index: 2000;
    }

    .submenu .submenu .submenu.open {
        z-index: 2000;
    }

    .back-button, .close-button {
        position: absolute;
        top: 0;
        padding: 7.5px; /* increase padding */
        font-size: 1.5rem; /* increase font size */
        background: none;
        border: none;
        cursor: pointer;
    }

    .back-button {
        left: 0;
    }

    .close-button {
        right: 0;
    }

    .back-button::before {
        content: "\f053"; /* Unicode for Bootstrap's left arrow icon */
        font-family: "Font Awesome 5 Free"; /* Assuming you're using Font Awesome 5 */
        font-weight: 900;
    }

    .close-button::before {
        content: "\f00d"; /* Unicode for Bootstrap's close icon */
        font-family: "Font Awesome 5 Free"; /* Assuming you're using Font Awesome 5 */
        font-weight: 900;
    }
}

.user-link i {
    color: #2e7d32;
    font-size: 1.8rem;
    margin-right: 8px;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.user-link {
    display: inline-flex;
    border: 2px solid #2e7d32;
    border-radius: 20px;
    padding: 5px 10px;
    text-decoration: none;
    color: #2e7d32;
    transition: border-width 0.5s;
    position: relative; /* Добавляем это свойство */
}

.user-link .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    border-radius: 0;
    border: 0;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    overflow-x: hidden;
}

.header {
    background-color: #ffffff;
    padding: 20px;
    text-align: center;
}

.form-container {
    background-color: #ffffff;
    border: 0 solid #dddddd;
    padding: 20px;
    margin-top: 20px;
}

.form-container .form-group input {
    border: 1px solid #dddddd;
}

 .dropdown:hover .dropdown-menu {
     display: block;
 }

.btn .badge {
    position: relative;
    top: -1px;
    text-decoration: none;
}

.btn-default .badge {
    color: #fff;
    background-color: #333;
}

.my-dropdown-btn {
    border: 1px solid #ccc; /* Измените цвет на нужный */
}

/* Стили для card-deck - отображение карточек по одной в строке на десктопе */
@media (min-width: 768px) {
    .card-deck {
        display: flex;
        flex-direction: column;
    }
    
    .card-deck .card {
        width: 100%;
        margin-bottom: 1rem;
    }
}

/* На мобильных устройствах также отображаем карточки в колонку */
@media (max-width: 767px) {
    .card-deck {
        display: flex;
        flex-direction: column;
    }
    
    .card-deck .card {
        width: 100%;
        margin-bottom: 1rem;
    }
}

.iti {
    width: 100%;
}

/* Контейнер основного контента для предотвращения переполнения */
article .container-fluid .row > .col-lg-7.col-md-8.col-sm-12.col-12 {
    overflow-x: hidden;
    position: relative;
}

/* Дополнительная защита от переполнения для всех таблиц на странице разделов */
.table-responsive,
.table-wrapper {
    max-width: 100%;
    overflow-x: auto;
}

/* Фикс для предотвращения горизонтального скролла всей страницы */
body {
    overflow-x: hidden;
}

/* Убедимся, что контент не выходит за границы на странице разделов */
.breadcrumb,
h1,
h2,
h3,
.card-deck,
.pagination {
    max-width: 100%;
    overflow-wrap: break-word;
}

/* Price table with horizontal scroll */
.price-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch; /* Для плавного скролла на iOS */
    margin-bottom: 20px;
    position: relative;
    /* Предотвращаем выход контента за пределы контейнера */
    contain: layout style;
    /* Дополнительная изоляция */
    isolation: isolate;
}

/* Минимальная ширина для таблицы прайсов */
.price-table-wrapper table {
    min-width: 800px; /* Минимальная ширина таблицы */
    width: 100%;
    table-layout: fixed; /* Фиксированная раскладка для лучшего контроля */
    margin-bottom: 0; /* Убираем margin у таблицы Bootstrap */
}

/* Убедимся, что Bootstrap стили не ломают нашу раскладку */
.price-table-wrapper .table {
    margin-bottom: 0;
}

/* Предотвращаем расширение таблицы за пределы wrapper */
.price-table-wrapper table.table-striped {
    max-width: none; /* Разрешаем таблице быть шире контейнера */
    width: max-content; /* Но только внутри скроллящегося контейнера */
}

/* Ограничиваем ширину ячеек таблицы */
.price-table-wrapper table th,
.price-table-wrapper table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Специальные стили для столбцов */
.price-table-wrapper table th:nth-child(1),
.price-table-wrapper table td:nth-child(1) {
    width: 20%;
    min-width: 150px;
}

.price-table-wrapper table th:nth-child(2),
.price-table-wrapper table td:nth-child(2) {
    width: 30%;
    min-width: 200px;
}

.price-table-wrapper table th:nth-child(3),
.price-table-wrapper table td:nth-child(3) {
    width: 35%;
    min-width: 250px;
}

.price-table-wrapper table th:nth-child(4),
.price-table-wrapper table td:nth-child(4) {
    width: 15%;
    min-width: 100px;
}

/* Стили для скроллбара */
.price-table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.price-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.price-table-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.price-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .price-table-wrapper {
        margin-left: -15px;
        margin-right: -15px;
        padding-left: 15px;
        padding-right: 15px;
    }

    .price-table-wrapper table {
        min-width: 600px;
    }

    /* Уменьшаем размер шрифта для мобильных */
    .price-table-wrapper table td,
    .price-table-wrapper table th {
        font-size: 14px;
        padding: 8px 5px;
        white-space: normal; /* Разрешаем перенос текста на мобильных */
    }

    /* Адаптируем ширину столбцов для мобильных */
    .price-table-wrapper table th:nth-child(1),
    .price-table-wrapper table td:nth-child(1) {
        min-width: 100px;
    }

    .price-table-wrapper table th:nth-child(2),
    .price-table-wrapper table td:nth-child(2) {
        min-width: 150px;
    }

    .price-table-wrapper table th:nth-child(3),
    .price-table-wrapper table td:nth-child(3) {
        min-width: 180px;
    }

    .price-table-wrapper table th:nth-child(4),
    .price-table-wrapper table td:nth-child(4) {
        min-width: 80px;
    }
}

/* Стили для кнопки показа телефона */
.phone-show-btn {
    background-color: #2e7d32;
    color: #ffffff !important;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.phone-show-btn:hover {
    background-color: #4caf50;
    color: #ffffff !important;
    text-decoration: none;
}

.phone-show-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.phone-show-btn i {
    font-size: 16px;
}

.phone-display {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    color: #2e7d32;
    background-color: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    display: inline-block;
    margin-top: 8px;
}

/* === Palki green theme overrides for Bootstrap 4 === */

/* Links */
a,
a:link,
a:visited {
    color: #2e7d32;
}

a:hover,
a:focus {
    color: #4caf50;
    text-decoration: underline;
}

/* Primary / success buttons */
.btn-primary,
.btn-success {
    background-color: #2e7d32;
    border-color: #2e7d32;
    color: #ffffff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-success:hover,
.btn-success:focus {
    background-color: #4caf50;
    border-color: #4caf50;
    color: #ffffff !important;
}

.btn-outline-primary {
    color: #2e7d32;
    border-color: #2e7d32;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: #2e7d32;
    border-color: #2e7d32;
    color: #fff;
}

/* Pills, active nav items */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: #2e7d32;
}

/* Pagination from Bootstrap */
.page-item.active .page-link,
.page-link:focus {
    background-color: #2e7d32;
    border-color: #2e7d32;
}

.page-link {
    color: #2e7d32;
}

.page-link:hover {
    color: #4caf50;
}

/* Utility colors */
.text-primary {
    color: #2e7d32 !important;
}

.bg-primary {
    background-color: #2e7d32 !important;
}

.border-primary {
    border-color: #2e7d32 !important;
}

.badge-primary {
    background-color: #2e7d32;
}

.list-group-item.active {
    background-color: #2e7d32;
    border-color: #2e7d32;
}

.progress-bar {
    background-color: #2e7d32;
}

/* Form focus outline */
.form-control:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 0.2rem rgba(46, 125, 50, 0.25);
}

/* Active filters/toggles styled via custom .btn-active helper */
.btn-active {
    background-color: #2e7d32 !important;
    border-color: #2e7d32 !important;
    color: #fff !important;
}

.section-context-menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 1.15rem;
    min-height: 24px;
    margin: 0.25rem 0 1rem;
}

.section-context-menu__link {
    color: #111111;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
}

.section-context-menu__link:hover,
.section-context-menu__link:focus {
    color: #1b7f35;
    text-decoration: underline;
}

.section-context-menu__link--active {
    color: #111111;
    font-weight: 800;
    text-decoration: underline;
    text-decoration-color: #2e7d32;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

/* Section headings with icon pill (green background, white icon) */
.section-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 1.5rem 0 1rem;
    font-size: 1.6rem; /* ~30% larger headings */
}

.section-heading-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 8px; /* квадрат с лёгким скруглением */
    background-color: #2e7d32;
    color: #ffffff;
    font-size: 20px; /* ~30% крупнее иконка */
}

.section-heading a {
    color: #111111;
    text-decoration: none;
}

.section-heading a:hover {
    color: #2e7d32;
    text-decoration: underline;
}

/* Faces selector in company reviews: square green icons with white faces */
.rating-face {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid #2e7d32;
    background-color: #2e7d32;
    color: #ffffff;
}
.rating-face i {
    color: #ffffff;
}
.rating-face:hover,
.rating-face:focus {
    background-color: #4caf50;
    border-color: #4caf50;
    color: #ffffff;
}
.yandex-partner-slot {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    margin: 1rem 0;
    overflow: hidden;
}

.yandex-partner-slot > div,
.yandex-partner-slot iframe {
    max-width: 100%;
}
