/* ===== CUSTOM UNIFORM CONFIGURATOR — dark theme ===== */
.custom-studio {
    --cs-void: #0a0a0a;
    --cs-panel: #111417;
    --cs-line: #262a2e;
    --cs-ink: #f5f5f5;
    --cs-muted: #9aa0a6;
    --cs-red: #d81f26;
    --cs-gold: #f0c14b;
    background: var(--cs-void);
    color: var(--cs-ink);
    padding: 100px 60px 120px;
    font-family: inherit;
}

.cs-head {
    max-width: 720px;
    margin: 0 0 44px;
}
.cs-kicker {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--cs-gold);
    margin-bottom: 16px;
}
.cs-head h2 {
    font-size: clamp(28px, 3.6vw, 46px);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 16px;
    color: #fff;
}
.cs-head h2 .text-red { color: var(--cs-red); }
.cs-head p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--cs-muted);
    max-width: 520px;
    margin: 0;
}

/* ===== STEP 0 — KIT TYPE SELECT ===== */
.cs-kit-select {
    max-width: 980px;
    margin: 0 0 60px;
    transition: opacity .35s ease, transform .35s ease;
}
.cs-kit-select--hidden {
    opacity: 0;
    transform: translateY(-12px);
    pointer-events: none;
}
.cs-kit-question {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 20px;
}
.cs-kit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}
.cs-kit-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 26px 14px;
    background: var(--cs-panel);
    border: 1px solid var(--cs-line);
    border-radius: 6px;
    color: var(--cs-ink);
    cursor: pointer;
    text-align: center;
    opacity: 0;
    transform: translateY(16px);
    animation: csKitIn .5s ease forwards;
    animation-delay: calc(var(--d) * 0.07s);
    transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
.cs-kit-card:hover {
    border-color: var(--cs-gold);
    transform: translateY(-3px);
    background: #14181c;
}
.cs-kit-card:active { transform: translateY(-1px); }
.cs-kit-icon {
    font-size: 30px;
    line-height: 1;
}
.cs-kit-name {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
}

@keyframes csKitIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .cs-kit-card { animation: none; opacity: 1; transform: none; }
}

.cs-head-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cs-change-kit {
    background: transparent;
    border: 1px solid var(--cs-line);
    color: var(--cs-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
}
.cs-change-kit:hover {
    border-color: var(--cs-gold);
    color: var(--cs-gold);
}

/* ===== GRID ===== */
.cs-configurator {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(340px, 0.9fr);
    gap: 0;
    border: 1px solid var(--cs-line);
    background: var(--cs-panel);
    border-radius: 4px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .4s ease, transform .4s ease;
}
.cs-configurator--visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== LEFT — PREVIEW ===== */
.cs-preview-area {
    padding: 26px;
    border-right: 1px solid var(--cs-line);
}
.cs-workspace-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
}
.cs-workspace-head h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 6px 0 0;
    color: #fff;
}
.cs-section-kicker {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--cs-gold);
}
.cs-live-pill {
    font-size: 10px;
    font-weight: 700;
    color: #7ee2a0;
    background: rgba(126, 226, 160, 0.12);
    padding: 7px 12px;
    border-radius: 20px;
    white-space: nowrap;
}
.cs-live-pill i {
    display: inline-block;
    width: 6px; height: 6px;
    background: #4fbf78;
    border-radius: 50%;
    margin-right: 5px;
}

.cs-preview-stage {
    position: relative;
    height: 520px;
    background: #050505;
    border: 1px solid var(--cs-line);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cs-preview-badge {
    position: absolute;
    z-index: 4;
    top: 12px; left: 12px;
    background: var(--cs-red);
    color: #fff;
    padding: 6px 10px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    border-radius: 2px;
}
.cs-uniform-wrap {
    position: relative;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
#uniformImage {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
}

.name-overlay, .number-overlay, .sponsor-overlay, .crest {
    position: absolute;
    pointer-events: none;
    z-index: 5;
}
.name-overlay, .number-overlay, .sponsor-overlay {
    pointer-events: auto;
    cursor: grab;
    touch-action: none;
}
.crest { pointer-events: auto; cursor: grab; touch-action: none; }
.name-overlay.dragging, .number-overlay.dragging, .sponsor-overlay.dragging, .crest.dragging { cursor: grabbing; }

.name-overlay {
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 1px;
    color: #fff;
    text-shadow: 0 1px 2px #000;
    transform: translate(-50%, -50%);
}
.number-overlay {
    font-family: "Arial Black", Arial, sans-serif;
    font-size: 24px;
    color: #fff;
    text-shadow: 0 1px 3px #000;
    transform: translate(-50%, -50%);
}
.sponsor-overlay {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .4px;
    color: #fff;
    text-shadow: 0 1px 2px #000;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}
.front-name  { left: 25%; top: 37%; }
.front-number{ left: 25%; top: 47%; }
.back-name   { left: 73%; top: 36%; }
.back-number { left: 73%; top: 46%; }
.front-sponsor{ left: 25%; top: 57%; }
.back-sponsor { left: 73%; top: 56%; }
.crest {
    left: 20.5%; top: 30%;
    width: 34px; height: 34px;
    object-fit: contain;
    display: none;
}

.cs-preview-note {
    font-size: 11px;
    color: var(--cs-muted);
    margin: 14px 0;
}
.cs-preview-note span { color: var(--cs-gold); }

.cs-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.cs-btn {
    border: 1px solid var(--cs-line);
    background: transparent;
    color: var(--cs-ink);
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all .2s ease;
}
.cs-btn.secondary:hover {
    border-color: rgba(255,255,255,0.4);
}
.cs-btn.primary {
    background: var(--cs-gold);
    color: #111;
    border-color: var(--cs-gold);
}
.cs-btn.primary:hover {
    background: #fff;
    border-color: #fff;
}

/* ===== RIGHT — CONTROLS ===== */
.cs-controls {
    padding: 26px;
    max-height: 900px;
    overflow-y: auto;
}
.cs-control-intro {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--cs-line);
}
.cs-control-intro h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 6px 0 0;
    color: #fff;
}
.cs-control-intro p {
    font-size: 12px;
    line-height: 1.6;
    color: var(--cs-muted);
    margin: 8px 0 0;
}

.cs-product-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 12px;
}
.cs-product-tools > span {
    font-size: 10px;
    color: var(--cs-muted);
    white-space: nowrap;
}
.cs-search-field {
    position: relative;
    flex: 1;
}
.cs-search-field span {
    position: absolute;
    left: 10px; top: 8px;
    font-size: 16px;
    color: var(--cs-muted);
}
.cs-search-field input {
    width: 100%;
    height: 36px;
    padding: 0 10px 0 30px;
    background: #0d0f11;
    border: 1px solid var(--cs-line);
    color: var(--cs-ink);
    border-radius: 4px;
    font-size: 12px;
    outline: none;
}
.cs-search-field input:focus { border-color: var(--cs-gold); }

.cs-product-swatches {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    padding: 2px 2px 8px;
}
.cs-product-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: #0d0f11;
    border: 1px solid var(--cs-line);
    padding: 4px;
    border-radius: 3px;
    cursor: pointer;
    transition: all .15s ease;
}
.cs-product-thumb img {
    width: 100%;
    height: 44px;
    object-fit: cover;
    display: block;
    border-radius: 2px;
}
.cs-product-thumb span {
    font-size: 8px;
    font-weight: 700;
    color: var(--cs-muted);
    text-align: center;
}
.cs-product-thumb:hover { border-color: rgba(240,193,75,0.5); transform: translateY(-1px); }
.cs-product-thumb.active { border-color: var(--cs-gold); outline: 1px solid var(--cs-gold); }
.cs-empty-products { font-size: 12px; color: var(--cs-muted); padding: 12px 0; }

.cs-control-section {
    border-top: 1px solid var(--cs-line);
    margin-top: 20px;
    padding-top: 20px;
}
.cs-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.cs-hint { font-size: 10px; color: var(--cs-muted); }

.cs-zone { margin-bottom: 18px; }
.cs-zone-title {
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--cs-muted);
    margin: 0 0 8px;
}
.cs-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-swatch {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--swatch);
    border: 2px solid transparent;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
    cursor: pointer;
    transition: transform .15s ease;
}
.cs-swatch:hover { transform: translateY(-2px); }
.cs-swatch.active { border-color: var(--cs-gold); box-shadow: 0 0 0 3px rgba(240,193,75,0.25); }

.cs-color-picker-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 11px;
    color: var(--cs-muted);
}
.cs-color-picker { width: 40px; height: 26px; padding: 2px; cursor: pointer; border: 1px solid var(--cs-line); border-radius: 3px; background: transparent; }

.cs-details-section label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--cs-ink);
    margin: 16px 0 6px;
}
.cs-details-section input[type="text"],
.cs-details-section input[type="file"] {
    width: 100%;
    height: 38px;
    margin-top: 6px;
    background: #0d0f11;
    border: 1px solid var(--cs-line);
    color: var(--cs-ink);
    padding: 0 12px;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
}
.cs-details-section input[type="text"]:focus { border-color: var(--cs-gold); }
.cs-details-section input[type="file"] { padding: 8px; height: auto; font-size: 11px; }

.cs-type-control {
    padding: 12px;
    margin: 12px 0;
    background: #0d0f11;
    border: 1px solid var(--cs-line);
    border-radius: 4px;
}
.cs-type-control-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cs-type-control label { margin: 0; font-size: 11px; }
.cs-type-control output { font-size: 10px; color: var(--cs-gold); font-weight: 800; }
.cs-type-control select {
    width: 100%;
    margin-top: 8px;
    height: 34px;
    background: #111417;
    border: 1px solid var(--cs-line);
    color: var(--cs-ink);
    border-radius: 3px;
    font-size: 12px;
    padding: 0 8px;
}
.cs-size-range {
    width: 100%;
    height: 20px;
    margin: 8px 0 0;
    accent-color: var(--cs-gold);
    background: transparent;
}

.cs-small-help {
    font-size: 10px;
    line-height: 1.5;
    color: var(--cs-muted);
    margin-top: 6px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .custom-studio { padding: 70px 24px; }
    .cs-configurator { grid-template-columns: 1fr; }
    .cs-preview-area { border-right: 0; border-bottom: 1px solid var(--cs-line); }
    .cs-controls { max-height: none; }
}
@media (max-width: 600px) {
    .cs-preview-stage { height: 380px; }
    .cs-product-swatches { grid-template-columns: repeat(3, 1fr); }
    .cs-actions { flex-wrap: wrap; }
    .cs-btn { flex: 1; min-width: 140px; }
}