/**
 * Стили компонента "Промо-топбар"
 * 
 * Содержит базовые стили и темы оформления.
 * Переопределяет/дополняет существующие стили из main_styles.css
 * 
 * @package Chronos
 * @version 1.0
 */

/* ==========================================================================
   Базовые стили
   ========================================================================== */

.promo-bar {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 50px;
    z-index: 1000;
    background-color: #1a1a3e;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Фоновые изображения через CSS-переменные */
.promo-bar[style*="--promo-bar-bg-desktop"] {
    background-image: var(--promo-bar-bg-desktop);
}

@media (max-width: 768px) {
    .promo-bar[style*="--promo-bar-bg-mobile"] {
        background-image: var(--promo-bar-bg-mobile);
    }
}

.promo-bar__inner {
    height: var(--topbar-h);
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 50px 10px 20px;
    min-height: 50px;
}

.promo-bar__content {
    min-height: 100%;
    padding: 0 4rem 0 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.promo-bar__text {
    padding-right: 2em;
    font-size: 1.125rem;
    margin: 0;
    line-height: 1.4;
    color: #fff;
    text-align: center;
}

.promo-bar__label {
    font-weight: 600;
    margin-right: 5px;
}

.promo-bar__close {
    height: 100%;
    padding: .5rem;
    border: 0;
    cursor: pointer;
    color: inherit;
    font-size: 1.125rem;
    background: 0;
    position: absolute;
    right: 2rem;
    top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition:
        opacity 0.2s ease,
        color 0.2s ease;
}

.promo-bar__close:hover,
.promo-bar__close:focus-visible {
    opacity: 0.7;
}

.promo-bar__close:active {
    opacity: 0.5;
}

/* Модификатор для темного крестика (светлый фон) */
.promo-bar--close-dark .promo-bar__close {
    color: rgba(0, 0, 0, 0.5);
}

.promo-bar--close-dark .promo-bar__close:hover {
    color: #000;
}

/* Кнопка в баре */
.promo-bar .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}


/* ==========================================================================
   Темы оформления
   ========================================================================== */

/* Синяя тема (по умолчанию) */
.promo-bar--theme-blue {
    background: linear-gradient(88.84deg, #3d4eec 0, #2fa1f4 100%);
    color: #fff;
}

.promo-bar--theme-blue .btn--pink {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8fab 100%);
    color: #fff;
}

.promo-bar--theme-blue .btn--pink:hover {
    background: linear-gradient(135deg, #ff8fab 0%, #ff6b9d 100%);
}

/* Новогодняя тема */
.promo-bar--new-year {
    width: 100%;
    color: #fff;
    min-height: 3rem;
    background-image: url(/local/templates/furniture_gray/images/topbar-new-year-bg.png);
    background-color: #3F0000;
    background-position: center;
    background-repeat: no-repeat;
    background-size: auto 100%;
}

/* PRO скидка 50% */
.promo-bar--pro-discount50 {
    width: 100%;
    color: #fff;
    min-height: 3rem;
    background-image: url(/local/templates/furniture_gray/images/topbar-pro-discount50-bg.png);
    background-color: #08005B;
    background-position: center;
    background-repeat: no-repeat;
    background-size: auto 100%;
}

/* Денежная тема (с картинкой) */
.promo-bar--money {
    width: 100%;
    color: #fff;
    min-height: 3rem;
    background-color: #08005B;
    background-position: center;
    background-repeat: no-repeat;
    background-size: auto 100%;
}

/* Зелёная тема */
.promo-bar--theme-green {
    background: linear-gradient(135deg, #0d5c3e 0%, #1a8f5c 100%);
}

.promo-bar--theme-green .btn {
    background: #fff;
    color: #0d5c3e;
}

.promo-bar--theme-green .btn:hover {
    background: #e8f5e9;
}

/* Фиолетовая тема */
.promo-bar--theme-purple {
    background: linear-gradient(135deg, #4a148c 0%, #7b1fa2 100%);
}

.promo-bar--theme-purple .btn {
    background: linear-gradient(135deg, #e040fb 0%, #ea80fc 100%);
    color: #fff;
}

/* Оранжевая тема */
.promo-bar--theme-orange {
    background: linear-gradient(135deg, #e65100 0%, #ff9800 100%);
}

.promo-bar--theme-orange .btn {
    background: #fff;
    color: #e65100;
}

.promo-bar--theme-orange .btn:hover {
    background: #fff3e0;
}


/* ==========================================================================
   Стили кнопок
   ========================================================================== */

.promo-bar .btn--pink {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8fab 100%);
    color: #fff;
    border: none;
}

.promo-bar .btn--white {
    background: #fff;
    color: #1a1a3e;
    border: none;
}

.promo-bar .btn--white:hover {
    background: #f5f5f5;
}

.promo-bar .btn--gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%);
    color: #1a1a3e;
    border: none;
}

.promo-bar .btn--gold:hover {
    background: linear-gradient(135deg, #ffed4a 0%, #ffd700 100%);
}

.promo-bar .btn--outline {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
}

.promo-bar .btn--outline:hover {
    background: rgba(255, 255, 255, 0.1);
}


/* ==========================================================================
   Стили текста
   ========================================================================== */

.promo-bar .text--pink {
    color: #ff6b9d;
}

.promo-bar .text--gold {
    color: #ffd700;
}

.promo-bar .text--white {
    color: #fff;
}


/* ==========================================================================
   Адаптивность
   ========================================================================== */

@media(max-width:575px) {
    .promo-bar {
        position: fixed;
        bottom: 0;
        z-index: 10;
    }

    .promo-bar__inner {
        height: auto;
    }

    .promo-bar__content {
        padding: 1rem 3rem 1rem 1rem;
    }

    .promo-bar__text {
        padding-right: 1em;
        font-size: 1rem;
    }

    .promo-bar__close {
        right: 1rem;
    }

    .promo-bar--money {
        width: 100%;
        min-width: 100%;
        min-height: 117px;
        background-size: cover;
        background-position: center;
        aspect-ratio: 393 / 117;
    }

    @supports not (aspect-ratio: 1) {
        .promo-bar--money {
            position: relative;
            padding-top: 0.89%;
        }
    }
}

@media (max-width: 991px) {
    .promo-bar__inner {
        padding: 8px 45px 8px 15px;
    }
    
    .promo-bar__text {
        font-size: 14px;
    }
    
    .promo-bar .btn {
        padding: 6px 16px;
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .promo-bar__inner {
        padding: 10px 40px 10px 10px;
    }
    
    .promo-bar__content {
        flex-direction: column;
        gap: 8px;
    }
    
    .promo-bar__text {
        font-size: 13px;
    }
    
    .promo-bar__close {
        right: 8px;
        font-size: 18px;
    }
}


/* ==========================================================================
   Утилиты
   ========================================================================== */

.promo-bar .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
