/* =========================================
   МОДУЛЬ: ВСПЛЫВАЮЩАЯ ПАНЕЛЬ И ПОП-АП
========================================= */

.sticky-bottom-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    border-top: 2px solid #df1b53; 
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
    padding: 15px 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    font-family: 'Inter', sans-serif;
}

.sticky-bottom-panel.visible {
    transform: translateY(0);
}

/* ВОДЯНОЙ ЗНАК (ПАТТЕРН) В ПРАВОМ НИЖНЕМ УГЛУ ВСЕЙ ПАНЕЛИ */
.sbp-watermark {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-image: url('/assets/img/logo_watermark.svg');
    background-repeat: no-repeat;
    background-position: right -15px bottom -20px; 
    background-size: 480px auto; 
    opacity: 0.35; 
    pointer-events: none; 
    z-index: 0;
}

.color-info-popup {
    position: absolute;
    bottom: calc(100% + 15px); 
    left: 20px; 
    width: 320px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 15px 45px rgba(0,0,0,0.15);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border: 1px solid #eeeeee;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10000;
}

.color-info-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.popup-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 18px;
    cursor: pointer;
    color: #555555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.popup-close-btn:hover {
    background: #df1b53;
    color: #ffffff;
}

#popup-color-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    background: #f9f9f9;
}

.popup-content h4 {
    margin: 0 0 10px 0;
    font-size: 17px;
    font-weight: 700;
    color: #333333;
}

.popup-content p {
    margin: 0;
    font-size: 13px;
    color: #555555;
    line-height: 1.5;
}

/* --- СЕТКА ПЛАШКИ --- */
.sbp-container {
    max-width: 1500px !important;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 280px 1fr 0px; 
    align-items: flex-start; 
    gap: 40px;
    transition: grid-template-columns 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 10; 
}

.sbp-container.has-mockup {
    grid-template-columns: 280px 1fr 240px !important; 
}

.sbp-container.has-mockup.shape-scarf,
.sbp-container.has-mockup.shape-pled,
.sbp-container.has-mockup.shape-nabori {
    grid-template-columns: 280px 1fr 450px !important; 
}

.sbp-container.has-mockup.shape-wide {
    grid-template-columns: 280px 1fr 420px !important; 
}

.sbp-column {
    display: flex;
    flex-direction: column;
}

/* --- ЛЕВАЯ ЧАСТЬ --- */
.sbp-left {
    align-items: flex-start;
}

.sbp-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sbp-title {
    font-size: 22px;
    font-weight: 700;
    color: #333333;
    margin: 0;
    line-height: 1;
}

.sbp-info-btn {
    background: none;
    border: none;
    padding: 0;
    color: #936098; 
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.sbp-info-btn:hover {
    color: #df1b53; 
}

.sbp-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    margin: 6px 0; 
}

.sbp-icon {
    font-size: 15px;
}

.sbp-wishlist {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #936098; 
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
}

.sbp-wishlist:hover {
    text-decoration: underline;
}

.sbp-inline-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 0; 
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, margin-top 0.4s ease;
}

.sbp-inline-info.visible {
    max-height: 400px; 
    opacity: 1;
    margin-top: 15px; 
}

.sbp-inline-info img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    background: #f9f9f9;
    border: 1px solid #eeeeee;
}

.sbp-inline-info p {
    margin: 0;
    font-size: 13px;
    color: #555555;
    line-height: 1.5;
}

.sbp-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.sbp-prod-label {
    font-size: 14px;
    font-weight: 600;
    color: #555555;
    margin-bottom: 2px;
}

.sbp-active-calculators {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.sbp-bottom-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    width: 100%;
    margin-top: 5px;
    margin-bottom: 50px; 
}

/* ИДЕАЛЬНОЕ ВЫРАВНИВАНИЕ ПО ЛЕВОМУ КРАЮ ВСЕГДА */
.sbp-available-icons {
    display: flex;
    flex-wrap: wrap; 
    justify-content: flex-start; 
    gap: 25px 20px; 
    align-items: center;
    flex-grow: 1; 
}

/* ЗАЩИТА ОТ ЯЙЦЕОБРАЗНОСТИ И УВЕЛИЧЕНИЕ ОБЕРТКИ */
.prod-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #eeeeee;
    border-radius: 100px; 
    padding: 4px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0; 
    box-sizing: border-box;
    height: 84px; 
    min-height: 84px;
}

.prod-item:not(.selected) {
    width: 84px; 
    min-width: 84px;
    justify-content: center;
}

/* ПАТТЕРН ДЛЯ РАСКРЫТОЙ СТРОКИ С ЦЕНАМИ */
.prod-item.selected {
    border-color: #936098; 
    box-shadow: 0 4px 15px rgba(147, 96, 152, 0.15);
    background-color: #ffffff;
    background-image: url('/assets/img/logo_watermark.svg'); 
    background-repeat: repeat;
    background-size: auto 100%; 
    background-position: center left;
}

/* ИДЕАЛЬНЫЙ КРУГ ДЛЯ КНОПОК И УВЕЛИЧЕННЫЙ РАЗМЕР */
.prod-icon-btn {
    position: relative; 
    width: 72px; 
    height: 72px; 
    min-width: 72px; 
    min-height: 72px;
    border-radius: 50%;
    background: #fdfafb;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
    flex-shrink: 0; 
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

/* НАСТРОЙКА ИКОНКИ-МАСКИ */
.icon-mask {
    width: 46px; 
    height: 46px; 
    min-width: 46px;
    min-height: 46px;
    background-color: #888888; 
    -webkit-mask-size: contain;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-size: contain;
    mask-position: center;
    mask-repeat: no-repeat;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s ease;
    z-index: 2;
    position: relative;
    flex-shrink: 0;
}

/* ЭФФЕКТ ПРИТЯЖЕНИЯ К КЛИЕНТУ: сильное увеличение до 1.35 */
.prod-item:hover .prod-icon-btn .icon-mask {
    transform: scale(1.35); 
    background-color: #936098; 
}

.prod-icon-btn::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid rgba(223, 27, 83, 0.5); 
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none; 
    z-index: 1;
}

.prod-item:hover .prod-icon-btn::after {
    opacity: 1;
    transform: scale(1);
    border-color: #df1b53; 
}

/* Стили активного состояния */
.prod-item.selected .prod-icon-btn {
    background: #936098; 
}

.prod-item.selected .prod-icon-btn .icon-mask {
    background-color: #ffffff; 
}

.prod-item.selected:hover .prod-icon-btn::after {
    border-color: #df1b53; 
}

/* ИДЕАЛЬНОЕ ЦЕНТРИРОВАНИЕ ТЕКСТА ПОД ИКОНКАМИ */
.prod-item-title {
    position: absolute;
    top: 100%; 
    left: 50%; 
    transform: translateX(-50%); 
    margin-top: 8px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px; 
    pointer-events: none; 
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.main-title {
    font-size: 13px;
    font-weight: 600;
    color: #666666;
    transition: color 0.3s ease;
}

/* ЗОЛОТИСТЫЙ ЭЛИТНЫЙ БЕЙДЖ "С ЛОГО" В 1 СТРОКУ */
.sub-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap !important; 
    
    background: linear-gradient(110deg, #d4af37 0%, #ffeb99 25%, #f2c75c 50%, #d4af37 75%, #aa7c11 100%);
    background-size: 200% auto;
    color: #4a3100 !important; 
    
    padding: 2px 10px;
    border-radius: 12px; 
    box-shadow: 0 3px 8px rgba(212, 175, 55, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5); 
    
    animation: goldShineBg 3s linear infinite;
    
    opacity: 0;
    transform: translateY(-2px); 
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: -3px; 
}

@keyframes goldShineBg {
    to { background-position: 200% center; }
}

.prod-item:hover .main-title {
    color: #936098;
}

.prod-item:hover .sub-title {
    opacity: 1;
    transform: translateY(0);
}

.prod-item.selected .prod-item-title {
    opacity: 0;
    visibility: hidden;
}

/* Шкала калькулятора */
.prod-scale-wrapper {
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    display: flex;
    align-items: center;
    transition: max-width 0.6s ease, opacity 0.5s ease, margin 0.3s ease;
    margin: 0;
    padding: 0;
}

.prod-item.selected .prod-scale-wrapper {
    max-width: 1200px !important; 
    opacity: 1;
    margin-left: 10px;
    margin-right: 10px;
}

.prod-scale-track {
    display: flex;
    gap: 4px;
    background: #fcf9fa;
    border-radius: 30px;
    padding: 6px;
    border: 1px solid #eeeeee;
}

.scale-val {
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 700;
    color: #666666;
    border-radius: 20px;
    cursor: pointer;
    transition: 0.2s;
    user-select: none;
}

.scale-val:hover {
    background: #eeeeee;
}

.scale-val.active {
    background: #df1b53; 
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(223, 27, 83, 0.3);
}

.prod-price-result {
    margin-left: 20px;
    font-size: 20px;
    font-weight: 800;
    color: #936098;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.prod-price-result.show {
    opacity: 1;
    transform: translateX(0);
}

.price-currency {
    font-size: 13px;
    color: #888888;
    font-weight: 600;
}

.prod-logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid #eeeeee;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.4s ease 0.2s, transform 0.4s ease 0.2s;
}

.prod-item.selected .prod-logo-section {
    opacity: 1;
    transform: translateX(0);
}

.logo-buttons-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.prod-logo-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    color: #936098;
    border: 1px dashed #936098;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.prod-logo-btn:hover {
    background: #fcf9fa;
    border-color: #df1b53;
    color: #df1b53;
}

.prod-logo-btn.uploaded {
    border: 1px solid #10b981;
    color: #10b981;
    background: #f0fdf4;
}

.prod-logo-hint {
    font-size: 12px;
    color: #666666;
    line-height: 1.3;
    white-space: nowrap;
}

.prod-logo-hint strong {
    color: #df1b53;
}

.use-for-all-btn {
    background: transparent;
    color: #936098;
    border: 1px solid #936098;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    display: none; 
    transition: all 0.2s;
}

.use-for-all-btn.visible {
    display: inline-block;
}

.use-for-all-btn:hover {
    background: #936098;
    color: #ffffff;
}

.sbp-input-group {
    display: flex;
    width: 100%;
    max-width: 320px; 
    border: 2px solid #936098; 
    border-radius: 40px;
    overflow: hidden;
    background: #ffffff;
    margin: 0; 
    flex-shrink: 0; 
    position: relative;
    z-index: 2; 
}

.sbp-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 14px 18px;
    font-size: 14px;
    color: #333333;
    outline: none;
}

.sbp-input::placeholder {
    color: #a0a0a0;
}

.sbp-btn {
    background: #936098;
    color: #ffffff;
    border: none;
    padding: 0 24px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap; 
}

.sbp-btn:hover {
    background: #7b4a80;
}

@media screen and (max-width: 1150px) {
    .sbp-container, 
    .sbp-container.has-mockup, 
    .sbp-container.has-mockup.shape-scarf, 
    .sbp-container.has-mockup.shape-pled,
    .sbp-container.has-mockup.shape-nabori,
    .sbp-container.has-mockup.shape-wide {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    .sbp-left {
        align-items: center; 
        text-align: center;
    }
    .sbp-status {
        justify-content: center;
    }
    .sbp-bottom-action-row {
        flex-direction: column;
        align-items: center;
    }
    .sbp-available-icons {
        justify-content: center;
        flex-wrap: wrap; 
        gap: 45px 10px; 
    }
    .color-info-popup {
        right: 20px;
        left: 20px;
        width: auto;
    }
}