/* T-Shirt Studio - Brand Edition */

:root {
    --tss-brand: #C62727;
    --tss-brand-dark: #a01f1f;
    --tss-brand-light: #fce8e8;
    --tss-text: #1f2937;
    --tss-text-light: #6b7280;
    --tss-border: #e5e7eb;
    --tss-bg: #f5f7fa;
}

.tss-studio,
.tss-studio * {
    box-sizing: border-box;
}

.tss-studio {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: var(--tss-text);
    background: var(--tss-bg);
    font-family: inherit;
}

/* Header */
.tss-header {
    background: #fff;
    border-bottom: 1px solid var(--tss-border);
    padding: 18px 28px;
}

.tss-header-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--tss-text);
}

/* Main */
.tss-main-content {
    display: grid;
    grid-template-columns: 1fr 380px;
    flex: 1;
}

/* Canvas */
.tss-canvas-wrap {
    position: relative;
    background: var(--tss-canvas-bg, #ffffff);
    overflow: hidden;
    min-height: 600px;
    transition: background 0.3s ease, bottom 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

#tss-canvas-container {
    width: 100%;
    height: 100%;
    min-height: 600px;
}

#tss-canvas-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.tss-canvas-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tss-loading {
    background: rgba(255, 255, 255, 0.96);
    padding: 18px 28px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
}

.tss-loading.hidden { display: none; }

.tss-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--tss-brand);
    border-radius: 50%;
    animation: tss-spin 0.8s linear infinite;
}

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

.tss-canvas-hint {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(31, 41, 55, 0.8);
    color: #fff;
    padding: 7px 14px;
    border-radius: 18px;
    font-size: 11px;
    pointer-events: none;
}

.tss-mobile-intro-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    pointer-events: none;
}

.tss-mobile-intro-text {
    background: rgba(198, 39, 39, 0.95);
    color: #fff;
    padding: 20px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    line-height: 1.6;
    max-width: 280px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.tss-decal-hint {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(198, 39, 39, 0.9);
    color: #fff;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 12px;
    pointer-events: none;
    font-weight: 600;
}

/* Sidebar */
.tss-sidebar {
    background: #fff;
    border-right: 1px solid var(--tss-border);
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}

.tss-sidebar::-webkit-scrollbar { width: 6px; }
.tss-sidebar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* Section */
.tss-section {
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid #f1f5f9;
}
.tss-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.tss-section h3 {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--tss-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tss-section h3::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--tss-brand);
    border-radius: 2px;
}

/* Upload */
.tss-upload-description {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid var(--tss-brand);
}

.tss-upload-btn {
    display: block;
    background: linear-gradient(135deg, var(--tss-brand) 0%, var(--tss-brand-dark) 100%);
    color: #fff;
    padding: 14px;
    text-align: center;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    border: none;
}

.tss-upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(198, 39, 39, 0.3);
}

.tss-place-hint {
    background: var(--tss-brand-light);
    color: var(--tss-brand-dark);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    margin-bottom: 12px;
    border-right: 3px solid var(--tss-brand);
    display: none;
}

.tss-place-hint.active { display: block; }

.tss-preview {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    padding: 10px;
}

.tss-preview img {
    max-width: 100%;
    max-height: 100px;
    border-radius: 6px;
}

.tss-preview-empty {
    color: #94a3b8;
    font-size: 12px;
}

/* Stepper controls */
.tss-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border-radius: 10px;
    padding: 6px;
    margin-bottom: 12px;
}

.tss-stepper-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    color: var(--tss-brand);
    transition: all 0.15s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tss-stepper-btn:hover {
    background: var(--tss-brand);
    color: #fff;
    transform: scale(1.05);
}

.tss-stepper-label {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--tss-text);
}

.tss-stepper-value {
    font-size: 11px;
    color: var(--tss-text-light);
    display: block;
    margin-top: 2px;
}

/* Remove design */
.tss-remove {
    background: #fee2e2;
    color: #b91c1c;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    width: 100%;
    transition: all 0.15s;
}

.tss-remove:hover { background: #fecaca; }

/* T-shirt Colors Circles */
.tss-color-circles {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.tss-color-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    position: relative;
    flex-shrink: 0;
}

.tss-color-circle:hover {
    transform: scale(1.08);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.tss-color-circle.active {
    border: 2px solid var(--tss-brand);
    box-shadow: none;
}

.tss-color-circle.active::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.tss-color-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--tss-brand-light);
    border: 2px solid var(--tss-brand);
    border-radius: 10px;
    color: var(--tss-brand-dark);
    font-weight: 600;
    font-size: 13px;
}

.tss-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

/* Background Color */
.tss-bg-list {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.tss-bg-item {
    aspect-ratio: 1;
    border-radius: 8px;
    border: 2px solid var(--tss-border);
    cursor: pointer;
    transition: all 0.15s;
}

.tss-bg-item:hover { transform: scale(1.08); }
.tss-bg-item.active { border-color: var(--tss-brand); box-shadow: 0 0 0 2px rgba(198, 39, 39, 0.2); }

/* Video Embed */
.tss-video-embed-container {
    margin-bottom: 12px;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tss-video-embed-container > * {
    width: 100%;
    height: 100%;
}

/* Size Selection */
.tss-size-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.tss-size-btn {
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: var(--tss-text);
    transition: all 0.18s;
    font-family: inherit;
}

.tss-size-btn:hover {
    border-color: var(--tss-brand);
    background: var(--tss-brand-light);
}

.tss-size-btn.active {
    background: var(--tss-brand);
    color: #fff;
    border-color: var(--tss-brand);
}

.tss-size-guide-btn {
    width: 100%;
    background: transparent;
    border: 2px solid var(--tss-brand);
    color: var(--tss-brand);
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s;
    font-family: inherit;
}

.tss-size-guide-btn:hover {
    background: var(--tss-brand);
    color: #fff;
}

/* Form */
.tss-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tss-form input,
.tss-form textarea {
    padding: 12px 14px;
    border: 1px solid var(--tss-border);
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    background: #f8fafc;
    transition: all 0.15s;
    color: var(--tss-text);
    text-align: right;
    direction: rtl;
}

.tss-form input:focus,
.tss-form textarea:focus {
    outline: none;
    border-color: var(--tss-brand);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(198, 39, 39, 0.1);
}

.tss-form input::placeholder,
.tss-form textarea::placeholder {
    color: #94a3b8;
}

.tss-summary {
    background: var(--tss-brand-light);
    border-radius: 10px;
    padding: 12px;
    font-size: 12px;
    color: var(--tss-brand-dark);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.tss-summary-label {
    font-weight: 500;
}

.tss-summary-value {
    font-weight: 700;
}

.tss-price {
    font-size: 14px;
    color: var(--tss-brand);
    padding-top: 8px;
    border-top: 1px dashed rgba(198, 39, 39, 0.3);
    margin-top: 4px;
}

.tss-submit {
    background: linear-gradient(135deg, var(--tss-brand) 0%, var(--tss-brand-dark) 100%);
    color: #fff;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    margin-top: 8px;
}

.tss-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(198, 39, 39, 0.4);
}

.tss-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.tss-msg {
    font-size: 13px;
    padding: 12px;
    border-radius: 8px;
    display: none;
    margin-top: 8px;
    line-height: 1.6;
}

.tss-msg.success {
    display: block;
    background: #d1fae5;
    color: #065f46;
    text-align: center;
}

.tss-msg.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
}

/* Modal */
.tss-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tss-modal.active { display: flex; }

.tss-modal-content {
    background: #fff;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.tss-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--tss-border);
}

.tss-modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.tss-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--tss-text-light);
    line-height: 1;
    padding: 4px 8px;
}

.tss-modal-body {
    padding: 20px;
    text-align: center;
}

.tss-modal-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Dimensions Group */
.tss-dimensions-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.tss-dimension-input {
    padding: 8px 10px !important;
    font-size: 12px !important;
}

/* Design Overlay */
.tss-design-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.tss-design-handles {
    position: absolute;
    display: none;
}

.tss-design-handles.active {
    display: block;
}

.tss-handle {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #00a8ff;
    border: 2px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 168, 255, 0.5);
    pointer-events: all;
    z-index: 1000;
}

.tss-handle:hover {
    width: 24px;
    height: 24px;
    box-shadow: 0 0 12px rgba(0, 168, 255, 0.8);
}

.tss-handle.corner {
    cursor: nwse-resize;
}

.tss-handle.edge {
    cursor: ns-resize;
}

.tss-handle.rotate {
    cursor: grab;
}

.tss-handle.rotate:active {
    cursor: grabbing;
}

.tss-design-box {
    position: absolute;
    border: 2px solid #00a8ff;
    pointer-events: all;
    cursor: move;
}

.tss-design-box:hover {
    border-width: 3px;
}

/* Exit Button */
.tss-exit-btn {
    background: #fee2e2;
    color: #b91c1c;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s;
    margin-top: 8px;
    width: 100%;
}

.tss-exit-btn:hover {
    background: #fecaca;
}

/* Click Hint (after upload) */
.tss-click-hint {
    margin-top: 12px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #fcd34d;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    color: #78350f;
    line-height: 1.6;
    animation: tss-pulse-hint 2s ease-in-out infinite;
}

.tss-click-hint-icon {
    font-size: 20px;
    flex-shrink: 0;
    animation: tss-bounce-icon 1.2s ease-in-out infinite;
}

@keyframes tss-pulse-hint {
    0%, 100% { box-shadow: 0 2px 6px rgba(252, 211, 77, 0.2); }
    50%      { box-shadow: 0 4px 16px rgba(252, 211, 77, 0.5); }
}

@keyframes tss-bounce-icon {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-3px); }
}

/* Design Controls — minimal & modern */
.tss-design-controls-section {
    background: #fafafa;
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 16px !important;
}

.tss-controls-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.tss-controls-header h3 {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.tss-icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    padding: 5px 10px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 600;
    transition: all 0.18s;
    font-family: inherit;
}

.tss-icon-btn:hover {
    color: #C62727;
    border-color: #C62727;
    background: #fff5f5;
}

.tss-icon-btn svg {
    transition: transform 0.4s;
}

.tss-icon-btn:hover svg {
    transform: rotate(-180deg);
}

/* Sliders Group */
.tss-sliders-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 14px;
}

.tss-slider-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tss-slider-item label {
    font-size: 13px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: 0;
    order: -2;
}

.tss-slider-item .tss-slider {
    order: -1;
}

.tss-slider-row {
    display: flex;
    align-items: center;
    justify-content: center;
    order: 0;
}

.tss-slider-value {
    font-size: 11.5px;
    font-weight: 700;
    color: #1f2937;
    background: #fff;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    min-width: 42px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.tss-slider {
    width: 100%;
    height: 4px;
    border-radius: 999px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: background 0.2s;
}

.tss-slider:hover {
    background: #d1d5db;
}

.tss-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #C62727;
    cursor: grab;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.tss-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(198, 39, 39, 0.35);
}

.tss-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.25);
}

.tss-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #C62727;
    cursor: grab;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.tss-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
}

/* Remove design button */
.tss-remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    background: transparent;
    color: #b91c1c;
    border: 1px solid #fecaca;
    padding: 9px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.18s;
    font-family: inherit;
}

.tss-remove-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

/* Select */
.tss-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    color: #1f2937;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.tss-select:focus {
    outline: none;
    border-color: #C62727;
    background: white;
}

/* Input */
.tss-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 13px;
    text-align: right;
    direction: rtl;
}

.tss-input:focus {
    outline: none;
    border-color: #C62727;
    background: white;
}

/* Textarea */
.tss-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    text-align: right;
    direction: rtl;
}

.tss-textarea:focus {
    outline: none;
    border-color: #C62727;
    background: white;
}

/* Dimensions Side-by-Side */
.tss-dimensions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.tss-dimension-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tss-dimension-item label {
    font-size: 11.5px;
    font-weight: 600;
    color: #6b7280;
    padding-right: 2px;
}

.tss-dimensions-hint {
    margin-top: 10px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 11.5px;
    color: #4b5563;
    line-height: 1.75;
    text-align: justify;
}

.tss-dimensions-hint svg {
    flex-shrink: 0;
    color: #6b7280;
    margin-top: 2px;
}

.tss-dimensions-hint strong {
    color: #1f2937;
    font-weight: 700;
}

/* Price Card — red bg + white + yellow blinking badge */
.tss-price-card {
    background: linear-gradient(135deg, var(--tss-brand) 0%, var(--tss-brand-dark) 100%);
    border-radius: 16px;
    padding: 18px 18px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(198, 39, 39, 0.25);
}

.tss-price-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.08) 50%, transparent 60%);
    pointer-events: none;
}

.tss-price-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.tss-price-label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.3px;
}

.tss-price-badge {
    background: #fde047;
    color: #78350f;
    font-size: 10.5px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: 0.4px;
    box-shadow: 0 0 0 0 rgba(253, 224, 71, 0.6);
    animation: tss-blink-badge 1.8s ease-in-out infinite;
}

@keyframes tss-blink-badge {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(253, 224, 71, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(253, 224, 71, 0);
        transform: scale(1.05);
    }
}

.tss-price-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tss-price-divider {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 500;
}

.tss-price-currency {
    margin-top: 6px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Side Toggle (Front/Back) */
.tss-side-toggle {
    display: flex;
    gap: 0;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 4px;
    border: 1px solid #e5e7eb;
}

.tss-side-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    color: #6b7280;
    border: none;
    border-radius: 7px;
    padding: 9px 10px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 12.5px;
    transition: all 0.2s;
}

.tss-side-btn:hover { color: #1f2937; }

.tss-side-btn.active {
    background: #fff;
    color: var(--tss-brand);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.tss-side-btn.active svg {
    color: var(--tss-brand);
}

.tss-side-hint {
    margin-top: 10px;
    font-size: 11.5px;
    color: #6b7280;
    line-height: 1.6;
}

.tss-section-meta {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 999px;
    margin-right: 6px;
    vertical-align: middle;
}

/* Designs List */
.tss-designs-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.tss-designs-list:empty { display: none; }

.tss-design-card {
    position: relative;
    aspect-ratio: 1;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.18s;
}

.tss-design-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.tss-design-card:hover {
    border-color: #C62727;
    transform: translateY(-1px);
}

.tss-design-card.active {
    border-color: var(--tss-brand);
    box-shadow: 0 0 0 1px var(--tss-brand);
}

.tss-design-card-side {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(31, 41, 55, 0.8);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}

.tss-design-card.unplaced {
    background: repeating-linear-gradient(45deg, #fafafa, #fafafa 4px, #f3f4f6 4px, #f3f4f6 8px);
    border-style: dashed;
    border-color: #cbd5e1;
}

.tss-design-card.unplaced::after {
    content: '👆';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.55);
}

.tss-design-card-remove {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.9);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.18s;
}

.tss-design-card:hover .tss-design-card-remove {
    opacity: 1;
}

/* Editable Slider Number Input */
.tss-slider-input-wrap {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0 6px 0 0;
    min-width: 56px;
    transition: border-color 0.15s;
}

.tss-slider-input-wrap:focus-within {
    border-color: var(--tss-brand);
}

.tss-slider-input {
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 3px 6px;
    font-size: 11.5px;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    min-width: 50px;
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    transition: border-color 0.15s;
    -moz-appearance: textfield;
}

.tss-slider-input::-webkit-outer-spin-button,
.tss-slider-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.tss-slider-input:focus {
    outline: none;
    border-color: var(--tss-brand);
}

.tss-slider-input-wrap .tss-slider-input {
    border: none;
    padding: 3px 4px;
    min-width: 40px;
}

.tss-slider-input-wrap .tss-slider-input:focus {
    border: none;
}

.tss-slider-input-suffix {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    padding-left: 2px;
}

/* Actions: Submit + Exit */
.tss-actions {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.tss-actions .tss-submit {
    flex: 1.4;
    margin-bottom: 0;
}

.tss-exit-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: transparent;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.18s;
    font-family: inherit;
}

.tss-exit-btn:hover {
    color: #1f2937;
    border-color: #d1d5db;
    background: #f9fafb;
}

/* FAQ — Accordion */
.tss-faq {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tss-faq-item {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tss-faq-item:hover {
    border-color: #e5e7eb;
}

.tss-faq-item.open {
    border-color: #fecaca;
    box-shadow: 0 2px 8px rgba(198, 39, 39, 0.05);
}

.tss-faq-q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: none;
    padding: 13px 14px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
    text-align: right;
    transition: color 0.2s;
}

.tss-faq-q:hover {
    color: #C62727;
}

.tss-faq-q-text {
    flex: 1;
    line-height: 1.5;
}

.tss-faq-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s;
    margin-right: 8px;
}

.tss-faq-item.open .tss-faq-arrow {
    transform: rotate(180deg);
    color: #C62727;
}

.tss-faq-a-wrap {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.tss-faq-item.open .tss-faq-a-wrap {
    max-height: 400px;
}

.tss-faq-a {
    padding: 0 14px 14px;
    font-size: 12.5px;
    color: #6b7280;
    line-height: 1.8;
}

/* Price note below price card */
.tss-price-note {
    margin: 12px 0 0;
    font-size: 11.5px;
    color: #6b7280;
    line-height: 1.75;
    text-align: justify;
    padding: 0 2px;
}

/* Price label — bigger */
.tss-price-label {
    font-size: 14px !important;
    font-weight: 700 !important;
}

/* Stepper control (+/- around number input) */
.tss-stepper-ctrl {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
}

.tss-step-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 400;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.14s;
    user-select: none;
    -webkit-user-select: none;
}

.tss-step-btn:hover {
    background: var(--tss-brand);
    color: #fff;
    border-color: var(--tss-brand);
}

.tss-step-btn:active {
    transform: scale(0.9);
}

/* Customer info form groups */
.tss-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 12px;
}

.tss-form-group:last-child {
    margin-bottom: 0;
}

.tss-field-label {
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
}

/* Phone input LTR */
.tss-input-ltr {
    direction: ltr;
    text-align: left;
}

/* Adjust tab empty state */
.tss-adjust-empty {
    text-align: center;
    padding: 20px 10px;
    color: #9ca3af;
    font-size: 12.5px;
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.tss-adjust-empty strong {
    color: #6b7280;
    font-weight: 700;
}

/* Mobile Tab Bar */
.tss-mobile-tabs {
    display: none;
}

@media (max-width: 1100px) {
    .tss-main-content { grid-template-columns: 1fr 340px; }
}

@media (max-width: 900px) {
    .tss-main-content { grid-template-columns: 1fr; }
    .tss-sidebar {
        border-right: none;
        border-top: 1px solid var(--tss-border);
        max-height: none;
    }
    .tss-canvas-wrap { min-height: 400px; }
    #tss-canvas-container { min-height: 400px; }
}

/* ===== Mobile drawer chrome (default = hidden; shown only inside the mobile media query) ===== */
.tss-drawer-handle,
.tss-drawer-title,
.tss-drawer-close {
    display: none;
}

/* ===== Mobile UX (≤768px): big shirt always + bottom-sheet drawer ===== */
@media (max-width: 768px) {
    /* Lock studio to viewport; only the drawer scrolls. Tab bar overlays it. */
    .tss-studio {
        display: block;
        position: relative;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
        padding-bottom: 0;
    }

    .tss-header {
        position: relative;
        z-index: 5;
    }

    .tss-main-content {
        display: block !important;
        position: relative;
        height: calc(100vh - 50px - 62px);
        height: calc(100dvh - 50px - 62px);
        overflow: hidden;
        flex: none;
    }

    /* Canvas fills the area between header and tab bar; shrinks when the drawer opens */
    .tss-canvas-wrap {
        position: absolute !important;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0;
        transition: none;
    }

    .tss-studio[data-drawer-open="true"] .tss-canvas-wrap {
        bottom: 55%;
    }

    #tss-canvas-container {
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    /* While the size transitions, let the canvas DOM scale with its wrap (avoids clipping).
       After the transition JS calls onResize to update the WebGL render buffer at full quality. */
    #tss-canvas-container > canvas {
        display: block;
        width: 100% !important;
        height: 100% !important;
    }

    /* Sidebar → bottom-sheet drawer */
    .tss-sidebar {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        height: 55%;
        max-height: 60%;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(24px) saturate(180%);
        -webkit-backdrop-filter: blur(24px) saturate(180%);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
        border-radius: 24px 24px 0 0;
        border: none;
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
        z-index: 200;
        padding: 54px 16px 24px;
        overflow-y: auto;
        overflow-x: hidden;
        flex: none;
    }

    .tss-studio[data-drawer-open="true"] .tss-sidebar {
        transform: translateY(0);
    }

    /* Drawer handle (grab indicator) */
    .tss-drawer-handle {
        display: block;
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 44px;
        height: 4px;
        background: #d1d5db;
        border-radius: 2px;
    }

    /* Drawer title (hidden in v1.9.3) */
    .tss-drawer-title {
        display: none !important;
    }

    /* Drawer close button (left side because dir=rtl) */
    .tss-drawer-close {
        display: flex;
        position: absolute;
        top: 14px;
        left: 14px;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: #f3f4f6;
        border: none;
        color: #4b5563;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        transition: all 0.18s;
        font-family: inherit;
        z-index: 2;
        -webkit-tap-highlight-color: transparent;
    }

    .tss-drawer-close:hover,
    .tss-drawer-close:active {
        background: var(--tss-brand);
        color: #fff;
    }

    /* Tighter spacing inside the drawer */
    .tss-sidebar .tss-section {
        padding: 14px 0;
    }

    .tss-sidebar .tss-section:first-of-type {
        padding-top: 0;
    }

    /* Mobile adjust controls styling */
    .tss-controls-header {
        flex-direction: column-reverse;
        gap: 12px;
        margin-bottom: 18px;
    }

    .tss-controls-header h3 {
        margin-bottom: 0 !important;
    }

    .tss-icon-btn {
        width: 100%;
        background: var(--tss-brand) !important;
        color: #fff !important;
        border-color: var(--tss-brand) !important;
        padding: 10px 12px !important;
        font-size: 12px !important;
    }

    .tss-icon-btn:hover {
        background: var(--tss-brand-dark) !important;
        border-color: var(--tss-brand-dark) !important;
    }

    /* Mobile slider controls spacing */
    .tss-sliders-group {
        gap: 18px !important;
        margin-bottom: 18px !important;
    }

    .tss-slider-item {
        gap: 8px !important;
    }

    .tss-slider-input-wrap {
        flex: 0 1 auto;
    }

    /* Hide the orbit-hint overlay while the drawer is open (cleaner shirt view) */
    .tss-studio[data-drawer-open="true"] .tss-canvas-hint {
        opacity: 0;
        pointer-events: none;
    }

    /* Mobile intro overlay — shown by default until first design upload */
    .tss-mobile-intro-overlay {
        display: flex;
    }

    /* Glassmorphism fixed bottom tab bar */
    .tss-mobile-tabs {
        display: flex;
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        z-index: 9999;
        background: rgba(255, 255, 255, 0.88);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-top: 1px solid rgba(229, 231, 235, 0.6);
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.10);
        height: 62px;
        padding: 0 2px;
    }

    .tss-mobile-tab {
        flex: 1;
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        background: transparent;
        border: none;
        cursor: pointer;
        color: #9ca3af;
        font-size: 9.5px;
        font-weight: 600;
        font-family: inherit;
        padding: 6px 2px 4px;
        transition: color 0.18s;
        -webkit-tap-highlight-color: transparent;
    }

    .tss-mobile-tab svg {
        width: 20px;
        height: 20px;
        stroke: #9ca3af;
        transition: stroke 0.18s;
        flex-shrink: 0;
    }

    .tss-mobile-tab.active {
        color: var(--tss-brand);
    }

    .tss-mobile-tab.active svg {
        stroke: var(--tss-brand);
    }

    /* Active indicator pill at top of tab */
    .tss-mobile-tab.active::before {
        content: '';
        position: absolute;
        top: 0;
        width: 28px;
        height: 3px;
        background: var(--tss-brand);
        border-radius: 0 0 4px 4px;
    }

    /* Section visibility inside the drawer — only the active tab's section is rendered */
    .tss-section[data-mobile-tab] {
        display: none !important;
    }

    .tss-studio[data-active-tab="design"]   .tss-section[data-mobile-tab="design"]   { display: block !important; }
    .tss-studio[data-active-tab="adjust"]   .tss-section[data-mobile-tab="adjust"]   { display: block !important; }
    .tss-studio[data-active-tab="color"]    .tss-section[data-mobile-tab="color"]    { display: block !important; }
    .tss-studio[data-active-tab="details"]  .tss-section[data-mobile-tab="details"]  { display: block !important; }
    .tss-studio[data-active-tab="submit"]   .tss-section[data-mobile-tab="submit"]   { display: block !important; }
    .tss-studio[data-active-tab="tutorial"] .tss-section[data-mobile-tab="tutorial"] { display: block !important; }
}

@media (max-width: 640px) {
    .tss-header { padding: 12px 16px; }
    .tss-header-title { font-size: 17px; }
    .tss-sidebar { padding: 14px; }
    .tss-bg-list { grid-template-columns: repeat(4, 1fr); }
    .tss-color-circle { width: 36px; height: 36px; }
}
