/**
 * Mobile Navbar - Liquid Glass Styles
 * Стили для мобильной навигационной панели в стиле liquid glass
 */

/* Основной контейнер */
.mobile-navbar-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10006;
    padding: 8px 9px 9px;
    pointer-events: none;
    display: flex;
    justify-content: center;
    
}

@media (max-width: 768px) {
    .mobile-navbar-wrapper {
        display: block;
    }
}

/* Эффект стекла - базовые стили для navbar */
#mobile-navbar-glass.glass-surface {
    /*
    width: 100%;
    */
    width: auto; /* вместо 100% */
    max-width: 95%; /* ограничь ширину */
    margin: 0 auto; /* центрируй */
    height: 55px;
    border-radius: 24px;
    pointer-events: auto;
    /* Объединенные тени: свечение сверху + тени по периметру + внутренние тени */
    box-shadow: 
        /* Внешние тени - только светлые свечения сверху */
        0 -6px 24px rgba(255, 255, 255, 0.25),
        0 -3px 12px rgba(255, 255, 255, 0.4),
        0 -2px 8px rgba(255, 255, 255, 0.1),
        0 3px 12px rgba(0, 0, 0, 0.06),
        0 6px 24px rgba(0, 0, 0, 0.09),
        0 9px 30px rgba(0, 0, 0, 0.11),
        /* Внутренние тени: светлее сверху слева, темнее снизу справа */
        inset -2px -2px 8px rgba(255, 255, 255, 0.2),
        inset -1px -1px 4px rgba(255, 255, 255, 0.3),
        inset 2px 2px 8px rgba(0, 0, 0, 0.15),
        inset 1px 1px 4px rgba(0, 0, 0, 0.1),
        /* Белый смазанный бордер по краям */
        inset 0 0 0 4px rgba(255, 255, 255, 0.4),
        inset 0 0 8px rgba(255, 255, 255, 0.2),
        inset 0 0 12px rgba(255, 255, 255, 0.15);
}

/* Навигационная панель */
.mobile-navbar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    padding: 6px 5px;
}


/* Элемент навигации */
.navbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: rgba(12, 12, 12, 0.9);
    transition: all 0.1s cubic-bezier(0.3, 0, 0.2, 1);
    padding: 6px 12px;
    border-radius: 16px;
    position: relative;
    flex: 1;
    max-width: 80px;
    min-width: 60px;
}

.navbar-item:hover:not(.active),
.navbar-item:focus:not(.active) {

    transform: translateY(-2px);
    outline: none;
}

/* Для активного элемента hover/focus не должны менять цвет */
.navbar-item.active:hover,
.navbar-item.active:focus {
    color: #ffffff;
    transform: none;
    outline: none;
}

.navbar-item.active {
    color: #ffffff;
    background: #04040470;
    padding: 4px 4px;
    border-radius: 24px;
    position: relative;
}

.navbar-item.active .navbar-icon {
    transform: scale(1.1);
}

/* Иконка */
.navbar-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.navbar-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Badge для корзины с эффектом glass */
.cart-badge.glass-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 59, 48, 0.9);
    backdrop-filter: blur(20px) saturate(1.8) brightness(1.1);
    -webkit-backdrop-filter: blur(20px) saturate(1.8) brightness(1.1);
    z-index: 10;
    line-height: 1;
}

/* Текст под иконкой */
.navbar-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Анимация при клике */
.navbar-item:active {
    transform: translateY(0) scale(0.95);
}


/* Скрываем навигацию на десктопе */
@media (min-width: 769px) {
    .mobile-navbar-wrapper {
        display: none !important;
    }
}

/* Совместимость с темой Woodmart */
body.woodmart-mobile-menu-opened .mobile-navbar-wrapper {
    opacity: 0.5;
    pointer-events: none;
}

/* Отступ для контента, чтобы не перекрывался */
@media (max-width: 768px) {
    body.mobile-navbar-active {
        padding-bottom: 100px;
    }
    
    /* Для WooCommerce страниц */
    .woocommerce-page .site-content,
    .woocommerce .site-content {
        padding-bottom: 100px;
    }
}

/* Плавное появление */
.mobile-navbar-wrapper {
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Эффект ripple при клике */
.navbar-item {
    position: relative;
    overflow: hidden;
}

.navbar-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.navbar-item:active::after {
    width: 200px;
    height: 200px;
}

/* Анимация волны для navbar при клике - только по ширине */
#mobile-navbar-glass.glass-surface {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#mobile-navbar-glass.glass-surface.wave-animation {
    animation: waveDrop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes waveDrop {
    0% {
        transform: scaleX(1);
    }
    25% {
        transform: scaleX(0.97);
    }
    50% {
        transform: scaleX(1.03);
    }
    75% {
        transform: scaleX(0.99);
    }
    100% {
        transform: scaleX(1);
    }
}


/* ========== STICKY NAVBAR НА СТРАНИЦЕ ТОВАРА ========== */
.mobile-product-sticky-bar {
    position: fixed;
    bottom: 70px; /* Размещаем над нижним navbar (55px высота + 25px padding) */
    left: 0;
    right: 0;
    z-index: 10002;
    padding: 8px 9px 0;
    pointer-events: none;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
}

.mobile-product-sticky-bar.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.mobile-product-sticky-bar .product-sticky-glass {
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    width: 100%;
    min-height: 45px;
    /* Объединенные тени: свечение сверху + тени по периметру + внутренние тени */
    box-shadow: 
        /* Внешние тени */
        0 -6px 24px rgba(255, 255, 255, 0.25),
        0 -3px 12px rgba(255, 255, 255, 0.15),
        0 3px 12px rgba(0, 0, 0, 0.06),
        0 6px 24px rgba(0, 0, 0, 0.09),
        0 9px 30px rgba(0, 0, 0, 0.11),
        /* Внутренние тени: светлее сверху слева, темнее снизу справа */
        inset -2px -2px 8px rgba(255, 255, 255, 0.2),
        inset -1px -1px 4px rgba(255, 255, 255, 0.3),
        inset 2px 2px 8px rgba(0, 0, 0, 0.15),
        inset 1px 1px 4px rgba(0, 0, 0, 0.1),
        /* Белый смазанный бордер по краям */
        inset 0 0 0 1px rgba(255, 255, 255, 0.4),
        inset 0 0 8px rgba(255, 255, 255, 0.2),
        inset 0 0 12px rgba(255, 255, 255, 0.15);
}

.product-sticky-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
    position: relative;
    z-index: 1;
    padding: 0;
}

.product-sticky-price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    flex: 1;
}

.product-price-current,
.product-price-sale {
    font-size: 18px;
    font-weight: 700;
    color: rgba(12, 12, 12, 0.95);
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.product-price-regular {
    font-size: 13px;
    font-weight: 500;
    color: rgba(12, 12, 12, 0.6);
    text-decoration: line-through;
    line-height: 1.2;
}

.product-sticky-buy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 24px;
    background: #ff5314bd;
    border: none;
    border-radius: 16px;
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(255, 83, 20, 0.3);
    cursor: pointer;
}

.product-sticky-buy-btn:hover,
.product-sticky-buy-btn:focus {
    background: #e6490f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 83, 20, 0.4);
    color: #ffffff;
    outline: none;
}

.product-sticky-buy-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(255, 83, 20, 0.3);
    background: #d4410d;
}

.buy-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.buy-btn-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
}

.buy-btn-text {
    line-height: 1;
}

/* Адаптация для темной темы */
@media (prefers-color-scheme: dark) {
    .product-price-current,
    .product-price-sale {
        color: rgba(255, 255, 255, 0.95);
    }
    
    .product-price-regular {
        color: rgba(255, 255, 255, 0.6);
    }
    
    .product-sticky-buy-btn {
        background: #ff5314;
        color: #ffffff;
    }
    
    .product-sticky-buy-btn:hover,
    .product-sticky-buy-btn:focus {
        background: #e6490f;
        color: #ffffff;
    }
}

/* Плавное появление sticky navbar снизу вверх */
.mobile-product-sticky-bar.visible {
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-product-sticky-bar.desktop-version.visible {
    animation: slideUpDesktop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUpDesktop {
    from {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ========== СТИЛИ ДЛЯ PC ВЕРСИИ ========== */
.mobile-product-sticky-bar.desktop-version {
    bottom: 0;
    padding: 8px 9px 9px;
    left: 50%;
    right: auto;
    transform: translateX(-50%) translateY(100%);
    width: 75%;
    max-width: 900px;
}

.mobile-product-sticky-bar.desktop-version.visible {
    transform: translateX(-50%) translateY(0);
}

.mobile-product-sticky-bar.desktop-version .product-sticky-glass {
    height: 70px;
    padding: 0 20px;
    /* Объединенные тени: свечение сверху + тени по периметру + внутренние тени */
    box-shadow: 
        /* Внешние тени */
        0 -6px 24px rgba(255, 255, 255, 0.25),
        0 -3px 12px rgba(255, 255, 255, 0.15),
        0 3px 12px rgba(0, 0, 0, 0.06),
        0 6px 24px rgba(0, 0, 0, 0.09),
        0 9px 30px rgba(0, 0, 0, 0.11),
        /* Внутренние тени: светлее сверху слева, темнее снизу справа */
        inset -2px -2px 8px rgba(255, 255, 255, 0.2),
        inset -1px -1px 4px rgba(255, 255, 255, 0.3),
        inset 2px 2px 8px rgba(0, 0, 0, 0.15),
        inset 1px 1px 4px rgba(0, 0, 0, 0.1),
        /* Белый смазанный бордер по краям */
        inset 0 0 0 1px rgba(255, 255, 255, 0.4),
        inset 0 0 8px rgba(255, 255, 255, 0.2),
        inset 0 0 12px rgba(255, 255, 255, 0.15);
}

.mobile-product-sticky-bar.desktop-version .product-sticky-content {
    gap: 16px;
}

.product-sticky-image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.2);
}

.product-sticky-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-sticky-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.product-sticky-name {
    font-size: 14px;
    font-weight: 600;
    color: rgba(12, 12, 12, 0.95);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.mobile-product-sticky-bar.desktop-version .product-sticky-price {
    gap: 4px;
}

.mobile-product-sticky-bar.desktop-version .product-price-current,
.mobile-product-sticky-bar.desktop-version .product-price-sale {
    font-size: 16px;
}

.mobile-product-sticky-bar.desktop-version .product-price-regular {
    font-size: 12px;
}

/* Адаптация для темной темы - PC версия */
@media (prefers-color-scheme: dark) {
    .product-sticky-name {
        color: rgba(255, 255, 255, 0.95);
    }
}

