.embroidery-customiser { position: relative; }

.embroidery-preview-wrapper {
    position: relative;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eee;
    padding: 20px;
    text-align: center;
}

.embroidery-preview-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.embroidery-preview-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.embroidery-canvas-overlay {
    pointer-events: none;
    position: absolute;
    overflow: visible;
}


.embroidery-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.design-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.design-card {
    border: 2px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
    background: #fff;
}

.design-card:hover { transform: translateY(-2px); border-color: #ccc; }
.design-card.selected { border-color: var(--accent, #e17055); }

.design-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.design-card .design-label {
    padding: 8px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.design-card-blank {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    background: #f8f9fa;
    color: #999;
    font-size: 0.85rem;
}

.embroidery-fields { display: flex; flex-direction: column; gap: 12px; }

.colour-zone-picker { display: flex; flex-direction: column; gap: 8px; }

.colour-zone-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #636e72;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.colour-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.colour-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #eee;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}

.colour-swatch:hover { transform: scale(1.1); }
.colour-swatch.selected { border-color: #2d3436; border-width: 3px; }

.embroidery-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary, #2d3436);
}

.embroidery-surcharge {
    font-size: 0.85rem;
    color: var(--accent, #e17055);
    margin-left: 8px;
}

.embroidery-disclaimer {
    font-size: 0.8rem;
    color: #999;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

@media (min-width: 992px) {
    .embroidery-customiser {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 32px;
        align-items: start;
    }
    .embroidery-preview-wrapper { position: sticky; top: 20px; }
}

@media (max-width: 991px) {
    .embroidery-preview-wrapper {
        position: sticky;
        top: 0;
        z-index: 10;
        margin-bottom: 20px;
        max-height: 45vh;
        overflow: hidden;
    }
    .embroidery-preview-container img { max-height: 35vh; width: auto; }
}

/* ─── Zoom Preview ───────────────────────────────────── */

.embroidery-zoom-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(45, 52, 54, 0.8);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
    z-index: 5;
}
.embroidery-zoom-btn:hover {
    background: rgba(45, 52, 54, 1);
    transform: scale(1.1);
}

.embroidery-zoom-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.embroidery-zoom-modal.active {
    display: flex;
}

.embroidery-zoom-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.embroidery-zoom-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
    animation: zoomIn 0.25s ease-out;
}
@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.embroidery-zoom-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 24px;
    color: #636e72;
    cursor: pointer;
    line-height: 1;
    border-radius: 50%;
    transition: background 0.15s;
}
.embroidery-zoom-close:hover {
    background: #f0f0f0;
    color: #2d3436;
}

.embroidery-zoom-image-wrap {
    position: relative;
    margin: 16px auto;
    display: inline-block;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eee;
    max-width: 80vw;
    max-height: 70vh;
}
.embroidery-zoom-img {
    display: block;
    max-width: 80vw;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 12px;
}
.embroidery-zoom-svg-overlay {
    position: absolute;
    overflow: visible;
    pointer-events: none;
}

.embroidery-zoom-label {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.2rem;
    color: #2d3436;
    margin-bottom: 4px;
}

.embroidery-zoom-hint {
    font-size: 0.8rem;
    color: #999;
    margin-top: 8px;
}

@media (min-width: 768px) {
    .embroidery-zoom-image-wrap {
        max-width: 70vw;
        max-height: 75vh;
    }
    .embroidery-zoom-img {
        max-width: 70vw;
        max-height: 75vh;
    }
}

/* ─── Text Size Slider ───────────────────────────────── */

.embroidery-font-scale {
    margin-top: 12px;
}
.font-scale-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.font-scale-row input[type="range"] {
    flex: 1;
    cursor: pointer;
}
.font-scale-label {
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
}
.font-scale-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary, #2d3436);
    min-width: 40px;
    text-align: right;
}
