/* === T-Shirt designer — light workspace (reference: soft gray canvas, dark icon rail) === */
.designer-root {
    --shirt-body: #3d4048;
    --shirt-neck: #2a2d34;
    --shirt-neck-deep: #181a1e;
    --shirt-body-light: #4a4f5a;
    --designer-product-banner-height: 88px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Catalog style has no back mockup: hide Back view UI (desktop rail + mobile overlay). */
.designer-root.designer-mockup-front-only #sideBack,
.designer-root.designer-mockup-front-only label[for="sideBack"] {
    display: none !important;
}

.designer-root.designer-mockup-front-only .mobile-view-option[data-side="back"] {
    display: none !important;
}

.designer-body {
    margin: 0;
    min-height: 100vh;
    background: #e8e9ec;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    padding-bottom: var(--designer-product-banner-height);
}

body.designer-body {
    margin-bottom: 0 !important;
    overscroll-behavior-y: contain;
}

.designer-header-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 1rem;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    color: #212529;
    font-size: 0.875rem;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

    .designer-header-mini a {
        color: #0d6efd;
        text-decoration: none;
        font-weight: 500;
    }

        .designer-header-mini a:hover {
            text-decoration: underline;
        }

.designer-shell {
    display: grid;
    grid-template-columns: 4.25rem minmax(15rem, 20rem) minmax(0, 1fr) 5rem;
    grid-template-rows: 1fr;
    min-height: calc(100vh - 38px);
    max-width: 100vw;
    overflow: hidden;
    background: #e8e9ec;
}

@media (max-width: 1199.98px) {
    .designer-shell {
        grid-template-columns: 4rem minmax(14rem, 1fr) 1fr;
        grid-template-rows: auto 1fr;
    }

    .designer-view-rail {
        grid-column: 1 / -1;
        grid-row: 2;
        flex-direction: row !important;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        padding: 0.5rem !important;
        border-left: none !important;
        border-top: 1px solid #dee2e6;
    }

        .designer-view-rail .btn-group-vertical {
            flex-direction: row !important;
        }

    .garment-color-inline,
    .garment-color-dropdown {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .designer-shell {
        display: flex;
        flex-direction: column;
        min-height: auto;
        overflow: visible;
        padding-bottom: 86px;
    }

    /* Mobile: remove redundant top toolbar (undo/redo + print size) */
    .stage-toolbar {
        display: none !important;
    }

    /* Mobile: saved action lives in the "Saved" tab */
    .designer-save-fab {
        display: none !important;
    }

    .stage-canvas-wrap {
        min-height: auto;
        overflow-x: hidden;
    }

    /* Mobile: top controls (color + key actions) live above the shirt */
    .mobile-top-controls {
        position: sticky;
        top: 0;
        z-index: 1041;
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
        background: rgba(255, 255, 255, 0.98);
        border-bottom: 1px solid #dee2e6;
        backdrop-filter: saturate(140%) blur(4px);
    }

    .mobile-top-controls .mobile-color-select-wrap {
        flex: 1 1 auto;
        min-width: 0;
    }

    .mobile-top-controls .mobile-color-trigger {
        width: 100%;
    }

    .mobile-top-controls .btn {
        white-space: nowrap;
        padding: 0.35rem 0.55rem;
        font-size: 0.85rem;
        border-radius: 10px;
    }

    /* Make these two a bit smaller than default */
    .mobile-top-controls #btnApplySizesLine {
        padding: 0.35rem 0.55rem;
        font-size: 0.85rem;
    }

    /* Mobile: "zoom in" on the mockup/canvas for readability */
    .mockup-zoom-wrap {
        padding-top: 0.75rem;
        transform: scale(1.12);
    }

    /* Allow shirt to bleed off-screen horizontally */
    .shirt-scene {
        width: 110vw;
        max-width: none;
    }

    /* Increase print/canvas scale slightly on mobile */
    .shirt-print-area {
        --print-scale: 0.23;
    }

    .designer-rail {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 8px;
        z-index: 1050;
        flex-direction: row !important;
        justify-content: space-between;
        align-items: stretch;
        border-right: none !important;
        border-bottom: none;
        border-radius: 14px;
        background: rgba(13, 13, 13, 0.92);
        backdrop-filter: blur(8px);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
        padding: 0.35rem 0.25rem;
        gap: 0.15rem;
    }

        .designer-rail .rail-btn {
            flex: 1;
            min-width: 0;
            border-radius: 10px;
            padding: 0.45rem 0.15rem;
            font-size: 0.58rem;
        }

            .designer-rail .rail-btn .rail-icon {
                font-size: 1.15rem;
            }

    .designer-context {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 80px;
        z-index: 1051;
        max-height: 55vh;
        overflow-y: auto;
        border-right: none !important;
        border: 1px solid #dee2e6;
        border-radius: 12px;
        max-width: none !important;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
        display: none;
    }

        .designer-context.mobile-open {
            display: block;
        }

    .designer-view-rail {
        display: none !important;
    }

    .mobile-overlay-controls {
        position: static;
    }

    .mobile-fab-btn {
        width: 44px;
        height: 44px;
        border: none;
        border-radius: 999px;
        background: rgba(60, 64, 72, 0.88);
        color: #fff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.15rem;
        position: fixed;
        top: 84px;
        z-index: 1035;
    }

    .mobile-fab-btn--right {
        right: 12px;
    }

    .mobile-fab-btn--left {
        left: 12px;
    }

    .mobile-fab-btn--left-top {
        top: 84px;
    }

    .mobile-fab-btn--left-bottom {
        top: 136px;
    }

    .mobile-overlay-panel {
        position: fixed;
        right: 12px;
        top: 136px;
        width: min(220px, 62vw);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
        z-index: 1045;
        overflow: hidden;
        border: 1px solid #e5e7eb;
    }

    .mobile-view-option {
        width: 100%;
        border: 0;
        border-bottom: 1px solid #eceff3;
        background: transparent;
        display: flex;
        align-items: center;
        gap: 10px;
        text-align: left;
        padding: 10px;
        color: #1f2937;
    }

        .mobile-view-option:last-child {
            border-bottom: 0;
        }

        .mobile-view-option img {
            width: 58px;
            height: 58px;
            border-radius: 6px;
            border: 1px solid #e5e7eb;
            object-fit: cover;
            background: #f3f4f6;
            flex: 0 0 auto;
        }

    .mobile-view-option__sleeve {
        padding-left: 68px;
    }

    .mobile-layer-option {
        justify-content: flex-start;
        font-weight: 500;
    }

    .mobile-view-option__sleeve {
        padding-left: 68px;
    }

    .mobile-layer-option i {
        width: 20px;
        text-align: center;
        font-size: 1rem;
    }
}

@media (min-width: 768px) {
    .mobile-overlay-controls,
    .mobile-overlay-panel {
        display: none !important;
    }
}

/* Icon rail — black strip */
.designer-rail {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    padding: 0.6rem 0.25rem;
    background: #0d0d0d;
    border-right: 1px solid #1a1a1a;
}

.rail-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 0.2rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #e8e8e8;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

    .rail-btn:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
    }

.rail-btn--active {
    background: #0d6efd;
    color: #fff;
}

    .rail-btn--active:hover {
        background: #0b5ed7;
        color: #fff;
    }

.rail-btn .rail-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.rail-label {
    line-height: 1.1;
    font-weight: 500;
}

/* Context — white card */
.designer-context {
    background: #fff;
    border-right: 1px solid #e0e2e6;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 1rem 1rem 1.25rem;
    max-width: 20rem;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.03);
}

    .designer-context .btn-sm {
        padding: 0.25rem 0.55rem;
        font-size: 0.8125rem;
        border-radius: 6px;
    }

.hub-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.75rem;
    line-height: 1.25;
}

.hub-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.hub-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.85rem 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    background: #fafbfc;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
    font-size: 0.75rem;
    font-weight: 600;
    color: #212529;
}

    .hub-tile:hover {
        border-color: #0d6efd;
        color: #0d6efd;
        box-shadow: 0 2px 8px rgba(13, 110, 253, 0.12);
    }

.hub-tile__icon {
    font-size: 1.75rem;
    color: #0d6efd;
    opacity: 0.95;
}

.hub-tile:hover .hub-tile__icon {
    color: #0d6efd;
}

.hub-tip {
    line-height: 1.45;
}

.context-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: #1a1a1a;
}

.context-subtitle {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.context-lead {
    margin-bottom: 0.65rem;
    line-height: 1.45;
}

.context-panel {
    animation: contextFade 0.2s ease;
}

@keyframes contextFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.edit-upload-block {
    padding-top: 0.5rem;
    border-top: 1px dashed #ced4da;
}

.designer-inline-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

/* Stage — soft gray workspace */
.designer-stage {
    display: flex;
    flex-direction: column;
    background: #e4e5e8;
    overflow: auto;
    min-height: 0;
}

.stage-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.25rem 1rem;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    position: relative;
    z-index: 25;
}

.stage-undo-redo {
    display: flex;
    gap: 0.35rem;
}

.designer-icon-btn {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.garment-color-inline {
    padding-left: 0.75rem;
    border-left: 1px solid #e9ecef;
}

.shirt-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.shirt-swatch {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    padding: 0;
    transition: transform 0.1s;
}

    .shirt-swatch:hover {
        transform: scale(1.08);
    }

    .shirt-swatch.is-active {
        box-shadow: 0 0 0 2px #0d6efd;
    }

.shirt-color-input {
    width: 2rem !important;
    height: 2rem !important;
    padding: 0.1rem;
    cursor: pointer;
}

.stage-canvas-wrap {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    padding: 0;
    min-height: calc(100vh - 70px);
    border-radius: 0;
    transition: outline 0.15s ease;
}

.designer-save-fab {
    position: absolute;
    left: 1.25rem;
    top: 2.5rem;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(13, 110, 253, 0.25);
    background: #0d6efd;
    color: #ffffff;
    box-shadow: 0 12px 26px rgba(13, 110, 253, 0.24), 0 8px 16px rgba(0, 0, 0, 0.14);
    z-index: 200;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

    .designer-save-fab:hover {
        transform: translateY(-1px);
        box-shadow: 0 14px 30px rgba(13, 110, 253, 0.28), 0 10px 18px rgba(0, 0, 0, 0.18);
    }

    .designer-save-fab:active {
        transform: translateY(0);
        box-shadow: 0 10px 22px rgba(13, 110, 253, 0.22), 0 7px 14px rgba(0, 0, 0, 0.16);
    }

    .designer-save-fab:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        box-shadow: none;
        transform: none;
    }

.stage-canvas-wrap--drag {
    outline: 2px dashed #0d6efd;
    outline-offset: -6px;
    background: rgba(13, 110, 253, 0.04);
}

.mockup-zoom-wrap {
    transform-origin: top center;
    transition: transform 0.15s ease;
    padding-top: 2rem;
    margin-top: 0;
}

.shirt-scene {
    position: relative;
    width: clamp(400px, 70vw, 800px);
    max-width: 100%;
    margin: 0 auto;
}

.shirt-mockup-container {
    position: relative;
    width: 100%;
    display: block;
    border-radius: 8px;
    overflow: hidden;
    filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.12));
    background-color: var(--shirt-body, #3d4048);
}

.shirt-mockup-bg {
    display: none;
}

.shirt-mockup-img {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    z-index: 2;
    mix-blend-mode: normal;
}

.shirt-color-overlay {
    display: none;
}

.shirt-scene__svg {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.12));
}

/* Left chest guide removed */

/* Left chest guide - 5" × 5" area on right side (left when worn) */
.left-chest-guide {
    position: absolute;
    top: 24px;
    right: 96px;
    width: 480px;
    height: 480px;
    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 4px;
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.print-stack:hover .left-chest-guide {
    opacity: 1;
}

.left-chest-guide__label {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 1.5rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 700;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95), 0 0 12px rgba(0, 0, 0, 0.8), 0 0 3px rgba(0, 0, 0, 1);
    line-height: 1;
}

.shirt-print-area {
    --print-scale: 0.19;
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    max-width: 600px;
    aspect-ratio: 16 / 24;
    z-index: 5;
    border: 1px dashed rgba(0, 0, 0, 0.15);
    border-radius: 3px;
    overflow: hidden;
    background: transparent;
    transition: border-color 0.2s, background 0.2s;
}

    .shirt-print-area:hover {
        border-color: rgba(13, 110, 253, 0.3);
        background: rgba(255, 255, 255, 0.05);
    }

    .shirt-print-area::before {
        content: attr(data-print-label);
        position: absolute;
        top: -1.5rem;
        left: 0;
        font-size: 0.7rem;
        color: #ffffff;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        font-weight: 700;
        z-index: 2;
        pointer-events: none;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 10px rgba(0, 0, 0, 0.7), 0 0 2px rgba(0, 0, 0, 1);
        line-height: 1;
    }

.print-stack-clip {
    position: absolute;
    top: 0;
    left: 50%;
    margin-left: -672px;
    width: 1344px;
    height: 2304px;
    transform-origin: top center;
    transform: scale(var(--print-scale));
}

.print-stack {
    position: relative;
    width: 1344px;
    height: 2304px;
}

    .print-stack .canvas-container {
        position: relative;
        z-index: 1;
    }

.inch-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0.08) 1px, transparent 1px), linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 1px, transparent 1px);
    background-size: 96px 96px;
    background-position: -1px -1px;
}

.clipart-results {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
}

.clipart-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
}

    .clipart-thumb:hover {
        border-color: #0d6efd;
    }

    .clipart-thumb.is-busy {
        opacity: 0.5;
        pointer-events: none;
    }

.recent-uploads-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
}

.recent-upload-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    background: #f8f9fa;
    transition: border-color 0.15s, transform 0.15s;
}

    .recent-upload-thumb:hover {
        border-color: #0d6efd;
        transform: scale(1.02);
    }

    .recent-upload-thumb.is-busy {
        opacity: 0.5;
        pointer-events: none;
    }

/* View rail — light */
.designer-view-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0.5rem;
    background: #f4f5f7;
    border-left: 1px solid #dee2e6;
    color: #212529;
}

.view-rail-label {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 0.35rem;
    width: 100%;
    text-align: center;
}

.designer-zoom-btns .btn {
    min-width: 2.5rem;
}

.view-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem;
    margin-bottom: 0.35rem;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    background: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    color: #495057;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.view-thumb__shirt {
    display: block;
    width: 56px;
    height: 72px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: linear-gradient(165deg, var(--shirt-body-light), var(--shirt-body));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: background 0.3s ease;
    position: relative;
    overflow: hidden;
}

.view-thumb:hover {
    border-color: #adb5bd;
}

.btn-check:checked + .view-thumb {
    border-color: #0d6efd;
    box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.25);
    color: #0d6efd;
}

kbd {
    font-size: 0.75em;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: #e9ecef;
}

/* Text Editing Section */
#textEditSection {
    padding-top: 0.75rem;
    border-top: 1px solid #e0e2e6;
    margin-top: 0.75rem;
}

    #textEditSection .form-label {
        margin-bottom: 0.35rem;
    }

    #textEditSection .btn-group {
        border-radius: 6px;
        overflow: hidden;
    }

    #textEditSection .btn-outline-secondary {
        border-color: #dee2e6;
    }

    #textEditSection .btn-check:checked + .btn-outline-secondary {
        background-color: #0d6efd;
        border-color: #0d6efd;
        color: #fff;
    }

.form-control-color {
    width: 3rem;
    height: 2.25rem;
    padding: 0.25rem;
    border-radius: 6px;
}

/* Saved Designs */
.saved-design-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #f8f9fa;
}

/* Background removal preview (simple shirt-color backdrop) */
.bgremove-preview-wrap {
    position: relative;
    overflow: hidden;
    background: #3d4048;
}

.saved-design-info {
    flex: 1;
    min-width: 0;
}

.saved-design-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-design-date {
    font-size: 0.75rem;
    color: #6c757d;
}

.saved-design-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

    .saved-design-actions .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    .saved-design-actions .btn-primary {
        min-width: 50px;
    }

/* Prevent mobile pull-to-refresh/scroll interference while dragging on design canvas */
.canvas-container,
.canvas-container canvas,
.upper-canvas,
.lower-canvas {
    touch-action: manipulation;
    overscroll-behavior: contain;
}

.stage-canvas-wrap {
    touch-action: pan-y;
    overscroll-behavior: contain;
}

/* Mobile color select dropdown (shown in banner on small screens) */
.mobile-color-select-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
}

.mobile-color-select-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #4b5563;
    white-space: nowrap;
    margin: 0;
}

/* Custom dropdown trigger button */
.mobile-color-trigger {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.55rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    color: #212529;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
}

    .mobile-color-trigger:focus {
        outline: none;
        border-color: #0d6efd;
        box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
    }

    .mobile-color-trigger .color-swatch-dot {
        flex-shrink: 0;
        width: 16px;
        height: 16px;
        border-radius: 3px;
        border: 1px solid rgba(0,0,0,0.15);
        display: inline-block;
        background-size: cover;
        background-position: center;
    }

    .mobile-color-trigger .color-trigger-name {
        flex: 1 1 auto;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-color-trigger .color-trigger-caret {
        flex-shrink: 0;
        font-size: 0.65rem;
        color: #6c757d;
        margin-left: 0.2rem;
    }

/* Dropdown list */
.mobile-color-dropdown-list {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
    z-index: 1100;
    display: none;
    flex-direction: column;
    min-width: 0;
    max-height: 280px;
}

    .mobile-color-dropdown-list.is-open {
        display: flex;
    }

.mobile-color-search-wrap {
    flex-shrink: 0;
    padding: 0.45rem 0.5rem 0.35rem;
    border-bottom: 1px solid #e9ecef;
}

.mobile-color-search-wrap .shirt-color-filter-input {
    font-size: 0.8rem;
}

.mobile-color-options-inner {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 220px;
    overflow-y: auto;
}

/* Desktop toolbar: searchable color dropdown next to swatches */
.stage-toolbar-color-select {
    flex: 0 1 min(260px, 32vw);
    min-width: 180px;
}

.stage-toolbar-color-select .mobile-color-dropdown-list {
    bottom: auto;
    top: calc(100% + 6px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    max-height: min(320px, 70vh);
}

.stage-toolbar-color-select .mobile-color-options-inner {
    max-height: min(240px, 55vh);
}

/* When the mobile color control is in the top bar, open the dropdown downward */
@media (max-width: 767.98px) {
    .mobile-top-controls .mobile-color-dropdown-list {
        bottom: auto;
        top: calc(100% + 6px);
        box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    }
}

.sizes-add-color-wrap {
    flex: 0 0 auto;
}

.sizes-add-color-wrap .mobile-color-trigger {
    flex: 0 0 auto;
    height: 34px;
    padding: 0.35rem 0.6rem;
}

.sizes-add-color-wrap .mobile-color-dropdown-list {
    left: auto;
    right: 0;
    width: min(320px, 70vw);
    max-height: 260px;
    overflow-y: auto;
}

/* In the Quantity panel (desktop), open dropdown downward */
@media (min-width: 992px) {
    .sizes-add-color-wrap .mobile-color-dropdown-list {
        bottom: auto;
        top: calc(100% + 6px);
        box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    }
}

.mobile-color-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.88rem;
    color: #212529;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

    .mobile-color-option:hover,
    .mobile-color-option.is-highlighted {
        background: #f1f3f5;
    }

    .mobile-color-option.is-active {
        background: #e8f0fe;
        font-weight: 600;
    }

    .mobile-color-option .color-swatch-dot {
        flex-shrink: 0;
        width: 18px;
        height: 18px;
        border-radius: 3px;
        border: 1px solid rgba(0,0,0,0.15);
        display: inline-block;
        background-size: cover;
        background-position: center;
    }

/* Bottom product banner */
.designer-product-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1042;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.08);
    backdrop-filter: saturate(140%) blur(4px);
}

.designer-product-banner__add {
    white-space: nowrap;
}

.designer-product-banner__thumbs {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding-right: 0.75rem;
    border-right: 1px solid #e5e7eb;
}

.designer-product-banner__thumb {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #f8f9fa;
    opacity: 0.75;
}

    .designer-product-banner__thumb.is-active {
        opacity: 1;
        border-color: #0d6efd;
    }

.designer-product-banner__info {
    min-width: 0;
}

.designer-product-banner__name {
    font-weight: 600;
    color: #1f2937;
    line-height: 1.2;
}

.designer-product-banner__meta {
    margin-top: 0.2rem;
    font-size: 0.92rem;
    color: #4b5563;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

@media (max-width: 767.98px) {
    .designer-product-banner {
        flex-wrap: wrap;
        gap: 0.65rem;
        padding: 0.65rem 0.75rem;
        padding-bottom: 84px;
    }

    .designer-product-banner__name {
        font-size: 0.95rem;
    }

    .designer-product-banner__meta {
        font-size: 0.85rem;
    }
}

/* Add products picker modal */
.designer-picker-modal-dialog {
    max-width: min(1460px, 96vw);
}

.designer-picker-modal {
    min-height: 72vh;
}

.designer-picker-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
}

.designer-picker-title-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.designer-picker-heading {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
}

.designer-picker-search-wrap {
    width: min(420px, 100%);
}

.designer-picker-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1rem;
}

.designer-picker-sidebar {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.designer-picker-cats-toggle {
    border-radius: 10px;
}

.designer-picker-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    z-index: 1055; /* within modal */
}

.designer-picker-sidebar-backdrop.is-open {
    display: block !important;
}

.designer-picker-sidebar.is-open {
    transform: translateX(0);
}

.designer-picker-category-list {
    max-height: 62vh;
    overflow-y: auto;
}

.designer-picker-category-btn {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding: 0.72rem 0.85rem;
    color: #374151;
}

    .designer-picker-category-btn:hover,
    .designer-picker-category-btn.is-active {
        background: #eef6ff;
        color: #0d6efd;
    }

.designer-picker-results {
    min-width: 0;
}

.designer-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 0.85rem;
}

.designer-picker-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    padding: 0.65rem;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

    .designer-picker-card:hover,
    .designer-picker-card.is-active {
        border-color: #7fb9f8;
        box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.12);
    }

    .designer-picker-card img {
        width: 100%;
        height: 132px;
        object-fit: contain;
        background: #f8fafc;
        border: 1px solid #eef2f6;
        border-radius: 6px;
        margin-bottom: 0.45rem;
    }

.designer-picker-card__style {
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

.designer-picker-card__brand {
    color: #6b7280;
    font-size: 0.88rem;
}

.designer-picker-card__starting {
    margin-top: 0.35rem;
    color: #111827;
}

.designer-picker-card__starting-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
    line-height: 1.1;
    margin-bottom: 1px;
}

.designer-picker-card__starting-price {
    font-size: 0.92rem;
    font-weight: 400;
    color: #111827;
    line-height: 1.2;
}

.designer-picker-card__swatches {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.45rem;
    flex-wrap: wrap;
}

.designer-picker-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background-color: #fff;
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.designer-picker-swatch-more {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 600;
    margin-left: 0.1rem;
}

@media (max-width: 991.98px) {
    .designer-picker-layout {
        grid-template-columns: 1fr;
    }

    .designer-picker-category-list {
        max-height: 30vh;
    }

    .designer-picker-heading {
        font-size: 1.45rem;
    }

    /* already stacked; keep for clarity */
    .designer-picker-header { }
}

/* Mobile: categories become a hamburger drawer so results can use full width */
@media (max-width: 767.98px) {
    .designer-picker-search-wrap {
        width: 100%;
    }

    .designer-picker-layout {
        position: relative;
        grid-template-columns: 1fr;
    }

    .designer-picker-sidebar {
        position: fixed;
        top: 74px; /* approx modal header height; keeps close button visible */
        left: 12px;
        bottom: 12px;
        width: min(320px, 86vw);
        max-height: none;
        z-index: 1060;
        box-shadow: 0 16px 40px rgba(0,0,0,0.22);
        transform: translateX(calc(-100% - 20px));
        transition: transform 0.18s ease;
    }

    .designer-picker-category-list {
        max-height: 100%;
    }
}

/* Product chips inside bottom banner */
.designer-product-banner__list {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 2px;
}

.designer-product-chip {
    border: 1px solid #dbe3eb;
    border-radius: 10px;
    background: #fff;
    padding: 0.25rem 0.35rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    white-space: nowrap;
    flex: 0 0 auto;
}

    .designer-product-chip.is-active {
        border-color: #0d6efd;
        box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.12);
    }

.designer-product-chip__img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #eef2f6;
}

.designer-product-chip__label {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.84rem;
    color: #374151;
}

.designer-product-chip__remove {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9aa3af;
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1;
    transition: background-color .12s ease, color .12s ease;
}

    .designer-product-chip__remove:hover {
        background: #fee2e2;
        color: #b91c1c;
    }

#pickerPreviewImage {
    min-height: 220px;
    object-fit: contain;
    width: 100%;
}

@media (max-width: 767.98px) {
    .designer-product-banner__list {
        order: 3;
        width: 100%;
    }

    .designer-product-chip__label {
        max-width: 120px;
    }
}

/* Apply Sizes / Quantity Slide-out Panel */
.designer-sizes-panel {
    width: 640px;
    background: #fff;
    border-left: 1px solid #e0e2e6;
    box-shadow: -4px 0 24px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    max-width: 100vw;
    max-height: calc(100vh - 38px);
}

.sizes-panel-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
}

.sizes-panel-body {
    flex: 1;
    overflow-y: auto;
}

.sizes-panel-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
}

/* Site.css caps all textareas at 280px — allow full width in the quantity panel (desktop). */
.designer-sizes-panel #quoteClientNotes {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* CTA button (inside Sizes panel footer) */
.designer-floating-cta {
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    font-weight: 600;
}

.quote-password-rules .text-success {
    font-weight: 600;
}

/* Ensure quote auth modal overlays the full-screen sizes panel on mobile */
.modal.modal-quote-auth {
    z-index: 2000;
}

.modal-backdrop.modal-backdrop-quote-auth {
    z-index: 1990;
}

/* When the full-screen Sizes panel is open on mobile, ensure any confirmation modals sit on top. */
body.sizes-open .modal {
    z-index: 2000;
}

body.sizes-open .modal-backdrop {
    z-index: 1990;
}

@media (max-width: 767.98px) {
    .designer-sizes-panel {
        max-height: 100vh;
    }
}

.sizes-product-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sizes-product-card-header {
    display: flex;
    gap: 0.75rem;
}

.sizes-remove-color-line {
    flex-shrink: 0;
    line-height: 1;
    text-decoration: none;
    opacity: 0.85;
}

.sizes-remove-color-line:hover {
    opacity: 1;
    text-decoration: none;
}

.sizes-product-thumb {
    width: 64px;
    height: 64px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    background: #f8f9fa;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.sizes-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.size-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 42px;
}

.size-input-label {
    font-size: 0.75rem;
    color: #495057;
    margin-bottom: 0.2rem;
}

.size-input-control {
    width: 100%;
    text-align: center;
    padding: 0.25rem;
    font-size: 0.875rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    appearance: textfield;
    -moz-appearance: textfield; /* Firefox */
}

/* Prevent iOS Safari auto-zoom on focus (font-size must be >= 16px) */
@media (max-width: 767.98px) {
    input,
    select,
    textarea,
    .form-control,
    .size-input-control,
    .form-select {
        font-size: 16px !important;
    }
}

/* Chrome, Safari, Edge, Opera */
.size-input-control::-webkit-outer-spin-button,
.size-input-control::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.size-input-control:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

/* Designer Shell overrides for open Sizes Panel */
body.sizes-open {
    padding-bottom: 0 !important;
}

body.sizes-open .designer-product-banner {
    display: none !important;
}

body.sizes-open .designer-rail,
body.sizes-open .designer-context,
body.sizes-open .designer-view-rail,
body.sizes-open .stage-toolbar,
body.sizes-open .mobile-overlay-controls {
    display: none !important;
}

/* Packaging overlay shown during mockup capture/zip save */
.packaging-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.72);
    z-index: 2147483000 !important; /* above Bootstrap modal/backdrop; JS also sets inline z-index */
    pointer-events: auto;
}

/* When busy, block page scroll behind full-screen overlay */
body.is-packaging {
    overflow: hidden !important;
    touch-action: none;
}

.packaging-overlay__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    text-align: center;
    max-width: 92vw;
}

.packaging-overlay__text {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
}

.packaging-overlay__subtext {
    font-size: 0.9rem;
    opacity: 0.9;
}

@media (min-width: 1200px) {
    .designer-shell.designer-shell--sizes-open {
        grid-template-columns: minmax(0, 1fr) 640px !important;
    }
}
@media (max-width: 1199.98px) {
    .designer-shell.designer-shell--sizes-open {
        grid-template-columns: minmax(0, 1fr) 640px !important;
    }
}
@media (max-width: 767.98px) {
    .designer-shell.designer-shell--sizes-open .designer-sizes-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100% !important;
        max-width: none;
        z-index: 1060;
    }
}
