/* Общие стили */
body {
    font-family: "Open Sans", sans-serif;
    font-size: 16px;
    color: #333;
    padding-top: 70px;
}

a {
    text-decoration: none !important;
    color: #333;
}

.rules-agreement {
    margin: 15px 0;
    font-size: 0.9em;
    color: #666;
}

.rules-agreement a {
    color: #337ab7;
    text-decoration: none;
}

.rules-agreement a:hover {
    text-decoration: underline;
}

main>.container {
    padding: 60px 15px 20px;
    max-width: 1600px;
}

div.alert.alert-success {
    background-color: #e7f3ff !important;
    /* Светло-синий фон для лучшей читаемости */
    color: #003087;
    /* Темно-синий текст */
    border-color: #b3d7ff;
    /* Светло-синяя граница */
}

/* Стили для header */
.navbar {
    z-index: 1000;
    position: fixed;
    /* Фиксируем шапку */
    top: 0;
    /* Прижимаем к верху */
    left: 0;
    right: 0;
    width: 100%;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 15px;
    max-width: 1600px;
    margin: 0 auto;
}

.navbar-brand {
    color: white;
    font-size: 20px;
}

.required-star {
    color: red;
}

.navbar-brand:hover {
    transform: scale(1.05);
    transition: all 0.8s ease;
    color: #999999;
}

.bg-dark {
    background-color: #2e2e2e !important;
}

/* Стили для меню */
.navbar-nav.me-auto,
.navbar-nav.ms-auto {
    flex-grow: 0;
}

.nav-link-with-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.2em 0.5em;
    transition: all 0.2s ease-in-out;
    color: #ffffff;
    font-size: 16px;
}

.nav-link-with-icon:hover {
    transform: scale(1.03);
    transition: all 0.8s ease;
    color: #999999;
}

.nav-icon,
.nav-icon-avatar {
    width: 32px;
    height: 32px;
    margin-bottom: 0.2rem;
    display: block;
    object-fit: cover;
}

.nav-icon {
    filter: brightness(100%) grayscale(0) invert(1);
}

.nav-icon-avatar {
    border-radius: 50%;
    border: 1px solid white;
}

.navbar-nav .nav-link.active {
    background-color: transparent !important;
}

/* Поиск */
.search-container {
    position: relative;
    flex-grow: 1;
    margin: 0 20px;
    max-width: 600px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border-radius: 20px;
    border: 1px solid #ccc;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: #007bff;
}

.search-icon {
    position: absolute;
    right: 10px;
    color: #666;
    font-size: 18px;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.search-results .result-item {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.search-results .result-item:last-child {
    border-bottom: none;
}

.search-results .result-item:hover {
    background-color: #f8f9fa;
}

.search-results .result-item a {
    color: #333;
    text-decoration: none;
    display: block;
}

/* Для экранов 1600px и выше */
@media (min-width: 1600px) {
    .navbar-container {
        padding: 0 20px;
    }

    .navbar-brand {
        font-size: 24px;
    }

    .nav-link-with-icon {
        font-size: 18px;
        padding: 0.3em 0.6em;
    }

    .nav-icon,
    .nav-icon-avatar {
        width: 36px;
        height: 36px;
    }

    .search-container {
        margin: 0 30px;
        max-width: 800px;
    }

    .search-input {
        padding: 12px 45px 12px 20px;
        font-size: 18px;
    }

    .search-icon {
        right: 12px;
        font-size: 20px;
    }

    .search-results {
        max-height: 350px;
    }

    .search-results .result-item {
        padding: 12px 20px;
        font-size: 16px;
    }
}

/* Промежуточный диапазон (1200px - 1599px) */
@media (min-width: 1200px) and (max-width: 1599px) {
    .navbar-container {
        padding: 0 50px;
    }

    .navbar-brand {
        font-size: 18px;
    }

    .nav-link-with-icon {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 6px;
        font-size: 14px;
        padding: 0.2em 0.3em;
    }

    .nav-icon,
    .nav-icon-avatar {
        width: 28px;
        height: 28px;
        margin-bottom: 0;
    }

    .search-container {
        margin: 0 10px;
        max-width: 450px;
    }

    .search-input {
        padding: 8px 35px 8px 12px;
        font-size: 14px;
    }

    .search-icon {
        right: 8px;
        font-size: 16px;
    }

    .search-results .result-item {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* Планшеты (768px - 1024px) */
@media (max-width: 1024px) {
    .navbar-container {
        padding: 0 10px;
    }

    .navbar-brand {
        font-size: 18px;
    }

    .nav-link-with-icon {
        font-size: 15px;
    }

    .nav-icon,
    .nav-icon-avatar {
        width: 28px;
        height: 28px;
    }

    .search-container {
        margin: 0 15px;
        max-width: 400px;
    }

    .search-input {
        padding: 8px 35px 8px 12px;
        font-size: 15px;
    }

    .search-icon {
        right: 8px;
        font-size: 16px;
    }

    .search-results .result-item {
        padding: 8px 12px;
        font-size: 15px;
    }
}

/* Мобильные устройства (<768px) */
@media (max-width: 767px) {
    body {
        padding-top: 60px;
    }

    .navbar-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 8px;
        position: relative;
    }

    .navbar-brand {
        font-size: 16px;
    }

    .navbar-toggler {
        padding: 4px 8px;
        font-size: 14px;
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1001;
    }

    .navbar-collapse {
        width: 100%;
        margin-top: 50px;
        background-color: #343a40;
        border-radius: 4px;
        position: absolute;
        top: 45px;
        left: 0;
        z-index: 1000;
    }

    .navbar-nav.me-auto,
    .navbar-nav.ms-auto {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-link {
        padding: 8px 12px;
        width: 100%;
    }

    .nav-link-with-icon {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        font-size: 14px;
        gap: 8px;
    }

    .nav-icon,
    .nav-icon-avatar {
        width: 24px;
        height: 24px;
        margin-bottom: 0;
    }

    .search-container {
        margin: 8px 0;
        max-width: 100%;
        width: 100%;
    }

    .search-input {
        padding: 8px 35px 8px 12px;
        font-size: 14px;
    }

    .search-icon {
        right: 8px;
        font-size: 16px;
    }

    .search-results {
        max-height: 200px;
    }

    .search-results .result-item {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* Очень маленькие экраны (<576px) */
@media (max-width: 576px) {
    body {
        padding-top: 56px;
    }

    .navbar-container {
        padding: 6px;
    }

    .navbar-brand {
        font-size: 14px;
    }

    .navbar-toggler {
        padding: 3px 6px;
        font-size: 12px;
        right: 6px;
    }

    .navbar-collapse {
        margin-top: 48px;
    }

    .nav-link-with-icon {
        font-size: 13px;
        gap: 6px;
    }

    .nav-icon,
    .nav-icon-avatar {
        width: 20px;
        height: 20px;
    }

    .search-container {
        margin: 6px 0;
    }

    .search-input {
        padding: 6px 30px 6px 10px;
        font-size: 13px;
    }

    .search-icon {
        right: 6px;
        font-size: 14px;
    }

    .search-results .result-item {
        padding: 6px 10px;
        font-size: 13px;
    }
}

.no-products-message {
    text-align: center;
    font-size: 18px;
    color: #888;
    margin-top: 20px;
}