@import url('https://fonts.googleapis.com/css?family=Merriweather');

/* Основные стили navbar */
.navbar-logo {
    padding-left: 15px;
}

.logo-img {
    height: 58px;
    width: auto;
    border-radius: 8px;
}

.navbar-mainbg {
    background-color: #5161ce;
    height: 67px;
}

.navbar {
    --bs-navbar-padding-y: 0px !important;
}

.navbar-logo .navbar-text {
    color: #ecf0f1 !important;
    font-size: 19px;
    margin-left: 10px; 
    display: inline-block;
    vertical-align: middle;
    text-shadow: 1px 1px 0px #000, 0px 0px 1px #fff;
}

/* Меню навигации */
#navbarSupportedContent {
    overflow: hidden;
    position: relative;
    margin-left: auto;
    display: flex;
    justify-content: flex-end;
}

#navbarSupportedContent ul {
    padding: 0px;
    margin: 0px;
}

#navbarSupportedContent li {
    list-style-type: none;
    float: left;
}

#navbarSupportedContent ul li a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    display: block;
    padding: 20px 20px;
    transition: all 0.3s ease;
    position: relative;
    font-size: 18px;
}

#navbarSupportedContent ul li a:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Активный элемент меню */
#navbarSupportedContent ul li.active a {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Корзина */
#navbarSupportedContent ul li.cart-icon a .fa-shopping-cart {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.3s;
}

#navbarSupportedContent ul li.cart-icon a .fa-shopping-cart:hover {
    color: rgba(255, 255, 255, 0.8);
}

#navbarSupportedContent ul li.cart-icon {
    margin-left: auto;
    position: relative;
}

.cart_num {
    position: absolute;
    top: 16px;
    right: 12px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    line-height: 1;
    min-width: 16px;
    text-align: center;
    z-index: 1;
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 991.98px) {
    /* Основной контейнер navbar */
    .navbar.navbar-mainbg {
        height: 67px !important;
        min-height: 67px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    /* Логотип - уменьшаем размер на мобильных */
    .navbar-logo .logo-img {
        height: 55px !important;
    }
    
    .navbar-logo {
        align-self: center;
    }
    
    .navbar-logo .navbar-text {
        font-size: 16px;
        display: none; /* Скрываем текст на мобильных */
    }
    
    /* Гамбургер кнопка */
    .navbar-toggler {
        border: none;
        padding: 10px 15px;
        margin-right: 15px;
        position: relative;
        z-index: 1051;
        align-self: center;
    }
    
    .navbar-toggler .fas {
        font-size: 25px;
    }
    
    .navbar-toggler:focus {
        box-shadow: none;
    }
    
    /* Мобильное меню */
    #navbarSupportedContent {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #5161ce;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 1049;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        border-radius: 0 0 10px 10px;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transform: translateY(-15px);
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        visibility: hidden;
    }
    
    #navbarSupportedContent.show {
        max-height: 400px; /* Достаточная высота для всех пунктов меню */
        opacity: 1;
        transform: translateY(0);
        visibility: visible;
    }
    
    #navbarSupportedContent ul {
        flex-direction: column;
        width: 100%;
    }
    
    #navbarSupportedContent li {
        float: none;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    #navbarSupportedContent li:last-child {
        border-bottom: none;
    }
    
    #navbarSupportedContent ul li a {
        padding: 15px 20px;
        display: block;
        width: 100%;
        text-align: left;
        border-radius: 0;
        transition: all 0.3s ease;
    }
    
    /* Плавные переходы для элементов меню */
    #navbarSupportedContent ul li {
        opacity: 0;
        transform: translateX(-20px);
        transition: all 0.3s ease;
    }
    
    #navbarSupportedContent.show ul li {
        opacity: 1;
        transform: translateX(0);
        transition-delay: 0.2s; /* Задержка после открытия контейнера */
    }
    
    /* Корзина в мобильном меню */
    #navbarSupportedContent ul li.cart-icon {
        margin-left: 0;
        position: relative;
    }
    
    #navbarSupportedContent ul li.cart-icon a {
        position: relative;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    /* Позиционирование счетчика корзины в мобильном меню */
    #navbarSupportedContent ul li.cart-icon .cart_num {
        top: 8px;
        left: 32px;
        right: auto;
        z-index: 1052;
    }
    
    /* Активный элемент в мобильном меню */
    #navbarSupportedContent ul li.active a {
        background-color: rgba(255, 255, 255, 0.15);
        border-radius: 0;
    }
}

/* Планшеты */
@media (min-width: 768px) and (max-width: 991.98px) {
    .navbar-logo .navbar-text {
        display: inline-block;
        font-size: 17px;
    }
    
    .logo-img {
        height: 50px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .navbar-logo {
        padding-left: 10px;
    }
    
    .logo-img {
        height: 40px;
    }
    
    .navbar-toggler {
        margin-right: 10px;
    }
    
    #navbarSupportedContent ul li a {
        padding: 12px 15px;
        font-size: 16px;
    }
}

/* Фиксируем позицию логотипа и гамбургера */
@media (max-width: 991.98px) {
    .navbar-brand {
        position: relative;
        z-index: 1051;
    }
    
    /* Предотвращаем сдвиг элементов при открытии меню */
    .navbar {
        position: relative;
    }
    
    .navbar-brand,
    .navbar-toggler {
        position: relative;
        z-index: 1051;
    }
}


