/**
 * QP Configurator v2.0 — Стили конфигуратора ПК
 */

/* === Основной контейнер === */
#qp-configurator {
    max-width: 1200px;
    margin: 24px auto;
    padding: 24px;
    font-family: inherit;
    background: #6969691F;
    border-radius: 16px;
    color: #fff;
}

/* Wrapper для Elementor — заливаем всю ширину тёмным фоном */
.qp-configurator-wrapper {
    background: #0d0d1a;
}

/* === Двухколоночный layout (десктоп) === */
.qp-cfg-columns {
    display: flex;
    flex-direction: column;
}

@media (min-width: 1024px) {
    .qp-cfg-columns {
        flex-direction: row;
        gap: 28px;
        align-items: flex-start;
    }

    .qp-cfg-col-left {
        flex: 1 1 58%;
        min-width: 0;
    }

    .qp-cfg-col-right {
        flex: 0 0 40%;
        position: sticky;
        top: 24px;
        align-self: flex-start;
    }
}

/* === Ошибка === */
.qp-cfg-error {
    background: #ff4444;
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    animation: qp-fade-in 0.3s ease;
}

/* === Секция компонента === */
.qp-cfg-section {
    margin-bottom: 16px;
}

.qp-cfg-section__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    margin-bottom: 6px;
}

.qp-cfg-section__icon {
    font-size: 20px;
}

.qp-cfg-section__title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.8);
}

/* === Опция (radio-карточка) === */
.qp-cfg-section__options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.qp-cfg-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.qp-cfg-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(148, 21, 21, 0.4);
}

.qp-cfg-option--selected {
    background: rgba(148, 21, 21, 0.12);
    border-color: #941515;
    box-shadow: 0 0 0 1px rgba(148, 21, 21, 0.3);
}

.qp-cfg-option--disabled {
    display: none !important;
}

/* Radio скрыт */
.qp-cfg-option__radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Кастомный чек */
.qp-cfg-option__check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s ease;
}

.qp-cfg-option--selected .qp-cfg-option__check {
    border-color: #941515;
    background: #941515;
}

.qp-cfg-option--selected .qp-cfg-option__check::after {
    content: '';
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Название */
.qp-cfg-option__name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Бейдж DDR4/DDR5 */
.qp-cfg-option__badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.qp-cfg-option__badge--ddr4 {
    background: rgba(255, 152, 0, 0.2);
    color: #ffb74d;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.qp-cfg-option__badge--ddr5 {
    background: rgba(0, 200, 83, 0.2);
    color: #69f0ae;
    border: 1px solid rgba(0, 200, 83, 0.3);
}

/* === Карточки корпусов (платформ) === */
.qp-cfg-platforms {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.qp-cfg-platform-card {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.qp-cfg-platform-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(148, 21, 21, 0.4);
}

.qp-cfg-platform-card--selected {
    border-color: #941515;
    background: rgba(148, 21, 21, 0.12);
    box-shadow: 0 0 0 1px rgba(148, 21, 21, 0.3);
}

.qp-cfg-platform-card--disabled {
    display: none !important;
}

.qp-cfg-platform-card__radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.qp-cfg-platform-card__img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    background: rgba(255, 255, 255, 0.02);
}

.qp-cfg-platform-card__img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: rgba(255, 255, 255, 0.02);
}

.qp-cfg-platform-card__info {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.qp-cfg-platform-card__name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-align: center;
}

/* На мобильных: сводка и итого уходят вниз правой колонки */
.qp-cfg-col-right {
    display: flex;
    flex-direction: column;
}

.qp-cfg-col-right .qp-cfg-summary {
    order: 10;
}

.qp-cfg-col-right .qp-cfg-total {
    order: 11;
}

@media (min-width: 1024px) {
    .qp-cfg-col-right .qp-cfg-summary {
        order: 0;
    }

    .qp-cfg-col-right .qp-cfg-total {
        order: 0;
    }
}

/* === Сводка выбранных компонентов === */
.qp-cfg-summary {
    margin-top: 16px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

.qp-cfg-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.qp-cfg-summary__row:last-child {
    border-bottom: none;
}

.qp-cfg-summary__label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    margin-right: 12px;
}

.qp-cfg-summary__name {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    text-align: right;
}

/* === Итого === */
.qp-cfg-total {
    margin-top: 20px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.qp-cfg-total__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
}

.qp-cfg-total__label {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.qp-cfg-total__price {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    transition: transform 0.3s ease, color 0.3s ease;
}

.qp-cfg-total__price--updated {
    transform: scale(1.05);
    color: #ff9800;
}

/* Контейнер кнопок */
.qp-cfg-total__buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Общие стили кнопок */
.qp-cfg-total__btn {
    display: block;
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Кнопка «Получить консультацию» — прозрачная с рамкой */
.qp-cfg-total__btn--consult {
    background: transparent !important;
    color: #FFFFFF !important;
    border: 1px solid #BBBBBB !important;
}

.qp-cfg-total__btn--consult:hover {
    background: #941515 !important;
    border-color: #941515 !important;
    color: #FFFFFF !important;
    transform: translateY(-1px);
}

/* Кнопка «Заказать конфигурацию» — красная */
.qp-cfg-total__btn--order {
    background: #941515 !important;
    color: #FFFFFF !important;
    border: 1px solid #BBBBBB !important;
}

.qp-cfg-total__btn--order:hover {
    background: #FFFFFF !important;
    color: #000000 !important;
    border-color: #BBBBBB !important;
    transform: translateY(-1px);
}

.qp-cfg-total__btn:active {
    transform: translateY(0);
}

.qp-cfg-total__btn:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

/* === Анимация === */
@keyframes qp-fade-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Адаптив === */
@media (max-width: 480px) {
    #qp-configurator {
        padding: 16px;
    }

    .qp-cfg-option {
        padding: 10px 12px;
        gap: 8px;
    }

    .qp-cfg-option__name {
        font-size: 13px;
    }

    .qp-cfg-total__price {
        font-size: 24px;
    }

    .qp-cfg-platforms {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .qp-cfg-platform-card__name {
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    .qp-cfg-platforms {
        grid-template-columns: 1fr;
    }
}
