.wctc-builder {
    margin: 18px 0 24px;
}

.wctc-builder__bar {
    background: linear-gradient(135deg, #f7fafc 0%, #edf4ff 45%, #e6f0ff 100%);
    border: 1px solid #d8e4f6;
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.wctc-open-modal {
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 700;
}

.wctc-builder__summary {
    flex: 1 1 460px;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 8px;
    font-size: 14px;
    color: #1b2f48;
}

.wctc-summary-item {
    border: 1px solid #d7e4f8;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 10px;
    padding: 8px 10px;
    overflow-wrap: anywhere;
}

.wctc-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.wctc-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 16, 25, 0.78);
}

.wctc-modal__dialog {
    position: absolute;
    inset: 14px;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.wctc-modal__head {
    background: linear-gradient(115deg, #093358 0%, #0f4c7f 52%, #1d6ea0 100%);
    color: #fff;
    padding: 16px 18px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: flex-start;
}

.wctc-modal__head-main h3 {
    margin: 0;
    font-size: clamp(21px, 2.3vw, 30px);
    line-height: 1.1;
}

.wctc-modal__head-main p {
    margin: 7px 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.wctc-modal__close {
    border: 0;
    background: rgba(255, 255, 255, 0.14);
    width: 36px;
    height: 36px;
    border-radius: 999px;
    font-size: 30px;
    line-height: 1;
    color: #fff;
    cursor: pointer;
}

.wctc-modal__body {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
}

.wctc-modal__preview {
    min-height: 0;
    padding: 18px;
    background:
        radial-gradient(circle at 22% 20%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 48%),
        linear-gradient(180deg, #eff5fb 0%, #e5eef8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wctc-modal__preview-shell {
    width: 100%;
    max-width: 1000px;
    border: 1px solid #cfdceb;
    border-radius: 14px;
    background: linear-gradient(180deg, #f9fbff 0%, #eef3fa 100%);
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wctc-stage {
    position: relative;
    width: min(100%, 1000px);
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 10px;
}

.wctc-stage__shirt-bg {
    position: absolute;
    inset: 0;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    z-index: 1;
}

.wctc-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px dashed rgba(28, 103, 201, 0.45);
    border-radius: 10px;
    pointer-events: none;
    z-index: 3;
}

.wctc-stage__shirt,
.wctc-stage__sticker {
    position: absolute;
    object-fit: contain !important;
    max-width: none !important;
    max-height: none !important;
}

.wctc-stage__shirt {
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 0;
    opacity: 0;
    pointer-events: none;
}

.wctc-stage__sticker {
    left: 50%;
    top: 50%;
    width: var(--wctc-sticker-width, 30%) !important;
    height: auto !important;
    transform: translate(-50%, -50%) rotate(var(--wctc-sticker-rotate, 0deg)) !important;
    z-index: 2;
}

.wctc-modal__controls {
    min-height: 0;
    overflow: auto;
    padding: 18px;
    border-left: 1px solid #e1e8f2;
    background: #f8fbff;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wctc-options-group {
    border: 1px solid #dde7f5;
    background: #fff;
    border-radius: 12px;
    padding: 12px;
}

.wctc-options-group h4 {
    margin: 0 0 10px;
    font-size: clamp(16px, 1.6vw, 21px);
    line-height: 1.15;
    color: #132741;
    overflow-wrap: anywhere;
}

.wctc-options-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

.wctc-option-card {
    position: relative;
    border: 1px solid #b4c8e8;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
    cursor: pointer;
    padding: 10px;
    display: grid;
    grid-template-columns: 20px 34px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    text-align: left;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.wctc-option-card:hover {
    border-color: #5b8fd3;
    box-shadow: 0 8px 20px rgba(29, 79, 133, 0.14);
    transform: translateY(-1px);
}

.wctc-option-card.is-active {
    border-color: #1c67c9;
    box-shadow: 0 0 0 2px rgba(28, 103, 201, 0.25);
}

.wctc-option-card__check {
    width: 18px;
    height: 18px;
    border: 1px solid #94b3df;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: transparent;
    font-size: 12px;
    line-height: 1;
}

.wctc-option-card.is-active .wctc-option-card__check {
    background: #1c67c9;
    border-color: #1c67c9;
    color: #fff;
}

.wctc-option-card.is-active .wctc-option-card__check::before {
    content: '\2713';
}

.wctc-option-card__thumb {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    overflow: hidden;
    background: #eef3fb;
    justify-self: start;
}

.wctc-option-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.wctc-option-card__meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wctc-option-card__name {
    font-size: 15px;
    line-height: 1.2;
    color: #132741;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.wctc-option-card__price {
    font-size: 12px;
    color: #466382;
}

.wctc-modal__footer {
    margin-top: auto;
    border-top: 1px solid #dbe6f3;
    padding-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.wctc-modal-total {
    font-size: clamp(18px, 1.8vw, 24px);
    line-height: 1.2;
    color: #0e2239;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.wctc-apply-selection {
    min-width: 154px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid #1c67c9;
    background: linear-gradient(180deg, #2d80e0 0%, #1c67c9 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: none;
    box-shadow: 0 6px 16px rgba(28, 103, 201, 0.24);
}

.wctc-apply-selection:hover,
.wctc-apply-selection:focus {
    background: linear-gradient(180deg, #226fcb 0%, #1458b0 100%);
    color: #fff;
}

.wctc-apply-selection.is-loading {
    opacity: 0.72;
    cursor: wait;
}

body.wctc-modal-open {
    overflow: hidden;
}

@media (max-width: 1200px) {
    .wctc-modal__dialog {
        inset: 8px;
    }

    .wctc-modal__body {
        grid-template-columns: 1fr;
    }

    .wctc-modal__controls {
        border-left: 0;
        border-top: 1px solid #e1e8f2;
    }
}

@media (max-width: 782px) {
    .wctc-builder__bar {
        padding: 10px;
    }

    .wctc-builder__summary {
        grid-template-columns: 1fr;
    }

    .wctc-modal__head {
        padding: 12px;
    }

    .wctc-modal__head-main h3 {
        font-size: 22px;
    }

    .wctc-modal__head-main p {
        font-size: 12px;
    }

    .wctc-modal__preview,
    .wctc-modal__controls {
        padding: 12px;
    }

    .wctc-modal__preview-shell {
        padding: 10px;
    }

    .wctc-options-row {
        grid-template-columns: 1fr;
    }

    .wctc-modal__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .wctc-apply-selection {
        width: 100%;
    }
}
