/* ===== Totem visual configuration ===== */

.customizer-premium {
    position: relative;
    overflow: hidden;
    padding: clamp(88px, 9vw, 124px) 0;
    border-top: 1px solid rgba(96, 165, 250, 0.1);
    background:
        radial-gradient(circle at 12% 16%, rgba(37, 99, 235, 0.1), transparent 28%),
        radial-gradient(circle at 88% 78%, rgba(14, 165, 233, 0.06), transparent 24%),
        linear-gradient(180deg, #0c1420 0%, #0a101a 100%);
}

.customizer-premium::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(96, 165, 250, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(96, 165, 250, 0.025) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: linear-gradient(180deg, transparent, #000 16%, #000 84%, transparent);
    pointer-events: none;
}

.customizer-premium .container {
    position: relative;
    z-index: 1;
}

.customizer-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.52fr);
    align-items: end;
    gap: clamp(48px, 8vw, 112px);
    margin-bottom: 54px;
}

.customizer-header .section-badge {
    margin-bottom: 20px;
}

.customizer-title {
    max-width: 800px;
    font-size: clamp(2.4rem, 4vw, 3.7rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
    text-wrap: balance;
}

.customizer-title .gradient-text {
    display: block;
}

.customizer-intro {
    padding-left: 26px;
    border-left: 1px solid rgba(96, 165, 250, 0.24);
}

.customizer-intro p {
    color: #a7b3c3;
    font-size: 1rem;
    line-height: 1.7;
}

.customizer-intro span {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 14px;
    color: #79adf1;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.55;
}

.customizer-intro i {
    margin-top: 3px;
}

.customizer-premium-container {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(560px, 1.1fr);
    align-items: start;
    gap: 22px;
}

/* Preview */

.totem-preview-area {
    position: sticky;
    top: 100px;
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 14px;
}

.preview-stage {
    position: relative;
    display: flex;
    min-height: 660px;
    overflow: hidden;
    flex-direction: column;
    padding: 24px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 20px;
    background:
        radial-gradient(circle at 50% 44%, rgba(59, 130, 246, 0.12), transparent 38%),
        linear-gradient(145deg, rgba(19, 31, 48, 0.95), rgba(7, 13, 23, 0.98));
    box-shadow: 0 24px 54px rgba(0, 0, 0, 0.24);
}

.preview-stage::before {
    content: '';
    position: absolute;
    inset: 76px 24px 84px;
    border: 1px solid rgba(96, 165, 250, 0.08);
    border-radius: 16px;
    background:
        linear-gradient(rgba(96, 165, 250, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(96, 165, 250, 0.035) 1px, transparent 1px);
    background-size: 36px 36px;
    pointer-events: none;
}

.preview-stage-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.preview-stage-header > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.preview-stage-header span {
    color: #6fa8f5;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.preview-stage-header strong {
    color: #edf3f9;
    font-family: var(--font-display);
    font-size: 1rem;
}

.preview-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 9px;
    border: 1px solid rgba(96, 165, 250, 0.17);
    border-radius: 50px;
    background: rgba(59, 130, 246, 0.06);
    color: #8ebfff !important;
    font-size: 0.6rem !important;
    letter-spacing: 0.03em !important;
    white-space: nowrap;
}

.totem-image-container {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 500px;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 30px 24px 18px;
}

.totem-real-image {
    width: 100%;
    height: 100%;
    max-height: 510px;
    object-fit: contain;
    opacity: 1;
    filter: drop-shadow(0 32px 52px rgba(0, 0, 0, 0.56));
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.totem-real-image.changing {
    opacity: 0;
    transform: scale(0.985);
}

.image-loader {
    position: absolute;
    z-index: 10;
    top: 50%;
    left: 50%;
    display: none;
    align-items: center;
    flex-direction: column;
    gap: 12px;
    transform: translate(-50%, -50%);
}

.image-loader.active {
    display: flex;
}

.loader-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(59, 130, 246, 0.18);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: customizer-spin 0.8s linear infinite;
}

@keyframes customizer-spin {
    to {
        transform: rotate(360deg);
    }
}

.image-loader p {
    color: #92a0b3;
    font-size: 0.78rem;
    font-weight: 600;
}

.view-controls {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    margin-top: auto;
}

.view-btn {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 10px;
    background: rgba(6, 13, 23, 0.78);
    color: #94a7be;
    font-size: 0.78rem;
    font-weight: 600;
}

.view-btn.active {
    border-color: rgba(96, 165, 250, 0.34);
    background: rgba(37, 99, 235, 0.12);
    color: #a9d0ff;
}

.model-info {
    padding: 24px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 15px;
    background: rgba(8, 15, 25, 0.7);
}

.model-info-label {
    display: block;
    margin-bottom: 8px;
    color: #6fa8f5;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.model-info h3 {
    margin-bottom: 7px;
    color: #edf3f9;
    font-family: var(--font-display);
    font-size: 1.3rem;
}

.model-info p {
    max-width: 560px;
    margin-bottom: 18px;
    color: #8f9caf;
    font-size: 0.83rem;
    line-height: 1.6;
}

.model-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.model-specs span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 9px;
    border: 1px solid rgba(96, 165, 250, 0.12);
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.035);
    color: #a8b4c4;
    font-size: 0.7rem;
    font-weight: 600;
}

.model-specs i {
    color: #6fa8f5;
}

/* Configuration panel */

.customization-panel {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 22px;
    padding: clamp(26px, 3vw, 38px);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(18, 29, 45, 0.94), rgba(8, 15, 25, 0.98));
}

.panel-step {
    display: block;
    margin-bottom: 9px;
    color: #6fa8f5;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.panel-header {
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.panel-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: #edf3f9;
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 2vw, 1.55rem);
    line-height: 1.3;
}

.panel-header h3 i {
    color: #6fa8f5;
    font-size: 1rem;
}

.panel-header p {
    color: #8f9caf;
    font-size: 0.85rem;
    line-height: 1.6;
}

.preset-configurations {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.preset-header {
    margin-bottom: 16px;
    text-align: left;
}

.preset-header h4 {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    margin-bottom: 5px;
    color: #e7edf5;
    font-size: 0.95rem;
    font-weight: 700;
}

.preset-header h4 i {
    color: #6fa8f5;
}

.preset-header p {
    color: #7f8da1;
    font-size: 0.76rem;
    line-height: 1.5;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.preset-card {
    position: relative;
    min-width: 0;
    min-height: 118px;
    overflow: hidden;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: 11px;
    background: rgba(7, 14, 24, 0.56);
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition:
        transform var(--transition-normal),
        border-color var(--transition-normal),
        background var(--transition-normal);
}

.preset-card::before,
.preset-card.active::after {
    content: none;
}

.preset-card:hover {
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, 0.3);
    background: rgba(23, 39, 61, 0.72);
    box-shadow: none;
}

.preset-card.active {
    border-color: rgba(96, 165, 250, 0.62);
    background: rgba(37, 99, 235, 0.11);
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.12);
}

.preset-preview {
    position: relative;
    z-index: 1;
    display: flex;
    height: 32px;
    gap: 4px;
    margin-bottom: 10px;
    overflow: hidden;
    border-radius: 6px;
}

.preset-body,
.preset-led,
.preset-text {
    min-width: 0;
    border-radius: 4px;
    box-shadow: none;
    filter: none;
}

.preset-body {
    flex: 2;
}

.preset-led,
.preset-text {
    flex: 1;
}

.preset-info {
    position: relative;
    z-index: 1;
    padding-right: 18px;
}

.preset-info h5 {
    margin-bottom: 3px;
    overflow: hidden;
    color: #e7edf5;
    font-size: 0.78rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preset-info p {
    overflow: hidden;
    color: #748296;
    font-size: 0.63rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preset-check {
    position: absolute;
    z-index: 2;
    top: 9px;
    right: 9px;
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    font-size: 0.58rem;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.preset-card.active .preset-check {
    opacity: 1;
    transform: scale(1);
}

.preset-card:focus-visible,
.view-btn:focus-visible,
.action-buttons button:focus-visible {
    outline: 3px solid rgba(96, 165, 250, 0.42);
    outline-offset: 3px;
}

.config-summary {
    padding: 20px;
    border: 1px solid rgba(96, 165, 250, 0.14);
    border-radius: 13px;
    background: rgba(5, 11, 20, 0.52);
}

.config-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.config-summary h4 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: #e7edf5;
    font-size: 0.88rem;
    font-weight: 700;
}

.config-summary h4 i {
    color: #6fa8f5;
}

.config-summary-header > span {
    padding: 5px 8px;
    border: 1px solid rgba(96, 165, 250, 0.14);
    border-radius: 50px;
    color: #7faee9;
    font-size: 0.59rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.summary-items {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.summary-item {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.09);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.018);
}

.summary-label {
    color: #718096;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.summary-value {
    max-width: 100%;
    overflow: hidden;
    color: #dce5ef;
    font-size: 0.76rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.action-guidance {
    margin-bottom: -10px;
    color: #7f8da1;
    font-size: 0.76rem;
    line-height: 1.55;
}

.action-buttons {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 10px;
}

.action-buttons button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition:
        transform var(--transition-normal),
        border-color var(--transition-normal),
        background var(--transition-normal),
        box-shadow var(--transition-normal);
}

.action-buttons button:hover {
    transform: translateY(-2px);
}

.btn-reset {
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(71, 85, 105, 0.12);
    color: #aeb9c8;
}

.btn-reset:hover {
    border-color: rgba(148, 163, 184, 0.32);
    background: rgba(71, 85, 105, 0.22);
}

.btn-save {
    border: 1px solid rgba(96, 165, 250, 0.28);
    background: rgba(37, 99, 235, 0.12);
    color: #a9d0ff;
    box-shadow: none;
}

.btn-save:hover {
    border-color: rgba(96, 165, 250, 0.46);
    background: rgba(37, 99, 235, 0.2);
    box-shadow: none;
}

.btn-quote {
    grid-column: 1 / -1;
    border: 1px solid rgba(16, 185, 129, 0.36);
    background: linear-gradient(135deg, #0e9f6e, #087f5b);
    color: #fff;
    box-shadow: 0 10px 24px rgba(5, 150, 105, 0.16);
}

.btn-quote:hover {
    background: linear-gradient(135deg, #10a979, #078662);
    box-shadow: 0 13px 28px rgba(5, 150, 105, 0.22);
}

@media (prefers-reduced-motion: reduce) {
    .totem-real-image,
    .preset-card,
    .preset-check,
    .action-buttons button {
        transition: none;
    }

    .loader-spinner {
        animation: none;
    }

    .preset-card:hover,
    .action-buttons button:hover {
        transform: none;
    }
}

@media (max-width: 1100px) {
    .customizer-premium-container {
        grid-template-columns: minmax(0, 0.82fr) minmax(520px, 1.18fr);
    }

    .preview-stage {
        min-height: 610px;
    }

    .totem-image-container {
        min-height: 450px;
    }
}

@media (max-width: 1024px) {
    .customizer-header {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 0.58fr);
        gap: 48px;
    }

    .customizer-premium-container {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .totem-preview-area {
        position: static;
        display: grid;
        grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
        align-items: stretch;
    }

    .preview-stage {
        min-height: 560px;
    }

    .totem-image-container {
        min-height: 400px;
    }

    .model-info {
        display: flex;
        justify-content: center;
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .customizer-premium {
        padding: 80px 0;
    }

    .customizer-header {
        grid-template-columns: 1fr;
        gap: 28px;
        margin-bottom: 42px;
    }

    .customizer-intro {
        padding-left: 22px;
    }

    .totem-preview-area {
        display: flex;
    }

    .preview-stage {
        min-height: 540px;
    }

    .totem-image-container {
        min-height: 390px;
    }

    .customization-panel {
        padding: 26px;
    }

    .preset-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .customizer-premium {
        padding: 68px 0;
    }

    .customizer-title {
        font-size: clamp(2rem, 9.5vw, 2.55rem);
    }

    .customizer-intro {
        padding: 0;
        border-left: 0;
    }

    .customizer-intro p {
        font-size: 0.95rem;
    }

    .preview-stage {
        min-height: 470px;
        padding: 18px;
        border-radius: 16px;
    }

    .preview-stage::before {
        inset: 70px 18px 74px;
    }

    .preview-stage-header {
        align-items: flex-start;
    }

    .preview-status {
        padding: 5px 7px;
        font-size: 0.54rem !important;
    }

    .totem-image-container {
        min-height: 330px;
        padding: 20px 10px 12px;
    }

    .totem-real-image {
        max-height: 350px;
    }

    .model-info,
    .customization-panel {
        padding: 22px;
    }

    .model-specs {
        gap: 7px;
    }

    .model-specs span {
        font-size: 0.65rem;
    }

    .preset-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .preset-card {
        min-height: 112px;
        padding: 11px;
    }

    .preset-info h5,
    .preset-info p {
        white-space: normal;
    }

    .summary-items {
        grid-template-columns: 1fr;
    }

    .summary-item {
        align-items: center;
        flex-direction: row;
        justify-content: space-between;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }

    .btn-reset,
    .btn-save,
    .btn-quote {
        grid-column: auto;
    }
}

/* ===== Final configurator interactions ===== */
.preview-stage {
    transition:
        border-color 0.35s ease,
        box-shadow 0.45s var(--motion-ease),
        transform 0.45s var(--motion-ease);
}

.preview-stage::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(120deg, transparent 28%, rgba(96, 165, 250, 0.055), transparent 64%);
    opacity: 0;
    transform: translateX(-35%);
    transition: opacity 0.35s ease, transform 0.8s var(--motion-ease);
    pointer-events: none;
}

.totem-image-container::after {
    content: '';
    position: absolute;
    right: 20%;
    bottom: 8%;
    left: 20%;
    height: 28px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.2);
    filter: blur(22px);
    opacity: 0.55;
    transform: scaleX(0.82);
    pointer-events: none;
}

.preset-card:active {
    transform: scale(0.97);
}

.preset-card.active {
    box-shadow:
        inset 0 0 0 1px rgba(96, 165, 250, 0.14),
        0 10px 26px rgba(37, 99, 235, 0.1);
}

.preset-card.active .preset-preview {
    box-shadow: 0 0 0 1px rgba(147, 197, 253, 0.16);
}

.preset-card.is-confirmed {
    animation: presetConfirm 0.42s var(--motion-spring);
}

.config-summary.is-updated {
    animation: summaryUpdate 0.48s var(--motion-ease);
}

.action-buttons button:active {
    transform: translateY(1px) scale(0.985);
}

.action-buttons button.is-success {
    border-color: rgba(52, 211, 153, 0.5);
    background: linear-gradient(135deg, #10b981, #047857);
    color: #fff;
    box-shadow: 0 10px 26px rgba(5, 150, 105, 0.2);
}

@keyframes presetConfirm {
    45% {
        transform: scale(0.97);
    }
}

@keyframes summaryUpdate {
    35% {
        border-color: rgba(96, 165, 250, 0.42);
        background: rgba(37, 99, 235, 0.09);
    }
}

@media (hover: hover) and (pointer: fine) {
    .preview-stage:hover {
        transform: translateY(-3px);
        border-color: rgba(96, 165, 250, 0.26);
        box-shadow: 0 30px 68px rgba(0, 0, 0, 0.3), 0 0 38px rgba(37, 99, 235, 0.08);
    }

    .preview-stage:hover::after {
        opacity: 1;
        transform: translateX(28%);
    }

    .preset-card:hover .preset-preview {
        transform: translateY(-1px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .preview-stage,
    .preview-stage::after,
    .preset-card.is-confirmed,
    .config-summary.is-updated {
        animation: none;
        transition: none;
    }
}
