/* ================================================================
   Embroidery Builder Modal
   ================================================================ */

.inno-emb-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.inno-emb-modal-overlay.is-visible {
    opacity: 1;
}

.inno-emb-modal {
    position: relative;
    width: 92vw;
    max-width: 720px;
    max-height: 88vh;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s ease;
}
.inno-emb-modal-overlay.is-visible .inno-emb-modal {
    transform: translateY(0) scale(1);
}

/* Close button */
.inno-emb-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    z-index: 2;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 50%;
    transition: background 0.15s;
}
.inno-emb-close:hover {
    background: #f3f3f3;
    color: #333;
}

/* Header */
.inno-emb-header {
    padding: 24px 28px 16px;
    border-bottom: 1px solid #eee;
}
.inno-emb-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 16px;
    color: #1f1c19;
}

/* Step indicator */
.inno-emb-steps {
    display: flex;
    align-items: center;
    gap: 0;
}
.inno-emb-step-dot {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #aaa;
}
.inno-emb-step-dot .dot-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #eee;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.2s;
}
.inno-emb-step-dot.active .dot-num {
    background: var(--inno-accent, #0e7c5f);
    color: #fff;
}
.inno-emb-step-dot.completed .dot-num {
    background: var(--inno-accent, #0e7c5f);
    color: #fff;
}
.inno-emb-step-dot.active .dot-label {
    color: var(--inno-accent, #0e7c5f);
    font-weight: 600;
}
.inno-emb-step-dot.completed .dot-label {
    color: #666;
}
.inno-emb-step-line {
    flex: 1;
    height: 2px;
    background: #eee;
    margin: 0 8px;
}

/* Body */
.inno-emb-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
}

/* Footer */
.inno-emb-footer {
    display: flex;
    align-items: center;
    padding: 16px 28px;
    border-top: 1px solid #eee;
    background: #fafafa;
    border-radius: 0 0 20px 20px;
}

/* Buttons */
.inno-emb-btn {
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}
.inno-emb-btn-primary {
    background: var(--inno-accent, #0e7c5f);
    color: #fff;
}
.inno-emb-btn-primary:hover:not(:disabled) {
    filter: brightness(1.1);
}
.inno-emb-btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.inno-emb-btn-secondary {
    background: #f0f0f0;
    color: #333;
}
.inno-emb-btn-secondary:hover {
    background: #e4e4e4;
}

/* Subtitle */
.inno-emb-subtitle {
    font-size: 14px;
    color: #777;
    margin: 0 0 20px;
}

/* Labels */
.inno-emb-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 8px;
}
.inno-emb-label small {
    font-weight: 400;
    color: #999;
}

/* ================================================================
   Step 1 — Source Cards
   ================================================================ */

.inno-emb-source-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
.inno-emb-source-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 12px;
    border: 2px solid #eee;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
}
.inno-emb-source-card:hover {
    border-color: #ccc;
    background: #fafafa;
}
.inno-emb-source-card.selected {
    border-color: var(--inno-accent, #0e7c5f);
    background: var(--inno-accent-soft, #e8f5f0);
}
.inno-emb-source-card .card-icon {
    font-size: 28px;
}
.inno-emb-source-card .card-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}
.inno-emb-source-card .card-desc {
    font-size: 11px;
    color: #999;
    text-align: center;
}

/* Upload zone */
.inno-emb-upload-zone {
    border: 2px dashed #ddd;
    border-radius: 14px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.inno-emb-upload-zone:hover,
.inno-emb-upload-zone.drag-over {
    border-color: var(--inno-accent, #0e7c5f);
    background: var(--inno-accent-soft, #e8f5f0);
}
.inno-emb-file-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}
.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #888;
    font-size: 14px;
}
.upload-placeholder .upload-icon {
    font-size: 32px;
    margin-bottom: 4px;
}
.upload-placeholder small {
    color: #bbb;
}
.upload-preview {
    position: relative;
}
.upload-preview img {
    max-width: 200px;
    max-height: 140px;
    border-radius: 8px;
    object-fit: contain;
}
.upload-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e74c6f;
    color: #fff;
    border: none;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Stock designs */
.inno-emb-stock-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.inno-emb-cat-btn {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.12s;
    color: #666;
}
.inno-emb-cat-btn.active {
    background: var(--inno-accent, #0e7c5f);
    color: #fff;
    border-color: var(--inno-accent, #0e7c5f);
}
.inno-emb-stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}
.inno-emb-stock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px;
    border: 2px solid #eee;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.12s;
}
.inno-emb-stock-item:hover {
    border-color: #ccc;
}
.inno-emb-stock-item.selected {
    border-color: var(--inno-accent, #0e7c5f);
    background: var(--inno-accent-soft, #e8f5f0);
}
.inno-emb-stock-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}
.inno-emb-stock-item .stock-name {
    font-size: 10px;
    color: #666;
    text-align: center;
    line-height: 1.2;
}

/* Text config */
.inno-emb-text-config {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.inno-emb-text-input {
    padding: 10px 14px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.15s;
}
.inno-emb-text-input:focus {
    border-color: var(--inno-accent, #0e7c5f);
}
.inno-emb-font-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.inno-emb-font-btn {
    width: 44px;
    height: 44px;
    border: 2px solid #eee;
    border-radius: 10px;
    background: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.12s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.inno-emb-font-btn:hover {
    border-color: #ccc;
}
.inno-emb-font-btn.selected {
    border-color: var(--inno-accent, #0e7c5f);
    background: var(--inno-accent-soft, #e8f5f0);
}
.inno-emb-text-preview {
    padding: 16px;
    background: #f8f8f8;
    border-radius: 12px;
    font-size: 24px;
    text-align: center;
    color: #333;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ================================================================
   Inline Placement Section (below source content)
   ================================================================ */

.inno-emb-placement-inline {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.inno-emb-placement-heading {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 14px;
}

/* Direction toggle */
.inno-emb-direction-toggle {
    display: inline-flex;
    gap: 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    margin-bottom: 16px;
}

.inno-emb-direction-toggle .direction-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.inno-emb-direction-toggle .direction-btn:first-child {
    border-right: 1px solid #ddd;
}

.inno-emb-direction-toggle .direction-btn.active {
    background: #fff;
    color: #222;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.inno-emb-direction-toggle .direction-btn svg {
    flex-shrink: 0;
}

/* Canvas row: towel centered (presets are above) */
.inno-emb-canvas-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

/* Towel canvas — larger for usability */
.inno-emb-towel-canvas {
    position: relative;
    width: 200px;
    min-width: 200px;
    aspect-ratio: 3 / 5;
    background: linear-gradient(135deg, #f0ede8 0%, #e8e4de 100%);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #d8d4ce;
    cursor: default;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.06);
}
.inno-emb-towel-canvas.landscape {
    width: 260px;
    min-width: 260px;
    aspect-ratio: 5 / 3;
}

.inno-emb-towel-canvas .towel-border-zone {
    position: absolute;
    inset: 8%;
    border-radius: 6px;
    border: 1.5px dashed rgba(0, 0, 0, 0.18);
}

/* Draggable design element */
.design-drag-element {
    position: absolute;
    width: 45%;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--inno-accent, #0e7c5f);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.88);
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
    transition: box-shadow 0.15s, border-color 0.15s;
    overflow: hidden;
    z-index: 2;
    transform: translate(-50%, -50%);
    padding: 0;
    box-sizing: border-box;
}
.design-drag-element.dragging {
    cursor: grabbing;
    border-style: solid;
    border-color: var(--inno-accent, #0e7c5f);
    box-shadow: 0 4px 16px rgba(14, 124, 95, 0.25);
    background: rgba(255, 255, 255, 0.95);
}
.design-drag-element img {
    max-width: 100%;
    max-height: 48px;
    object-fit: contain;
    pointer-events: none;
}
.design-drag-element .drag-text-preview {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    pointer-events: none;
    color: #333;
}
.design-drag-element .drag-placeholder {
    font-size: 12px;
    color: #999;
    pointer-events: none;
}

/* Preset position buttons — horizontal wrap above canvas */
.inno-emb-preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-content: flex-start;
    margin-bottom: 14px;
}
.placement-preset-btn {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.12s;
    color: #666;
    white-space: nowrap;
}
.placement-preset-btn:hover {
    border-color: #bbb;
    background: #f8f8f8;
}
.placement-preset-btn.active {
    background: var(--inno-accent, #0e7c5f);
    color: #fff;
    border-color: var(--inno-accent, #0e7c5f);
}

/* Upload note */
.inno-emb-upload-note {
    margin-top: 12px;
    font-size: 12px;
    color: #888;
    font-style: italic;
}
.inno-emb-upload-note strong {
    color: #555;
    font-style: normal;
}

/* ================================================================
   Step 3 — Review (kept for reference)
   ================================================================ */

.inno-emb-review-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.review-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 14px;
    border: 1px solid #eee;
}
.review-thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid #eee;
}
.review-thumb img {
    max-width: 56px;
    max-height: 56px;
    object-fit: contain;
}
.review-text-preview {
    font-size: 16px;
    font-weight: 600;
}
.review-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: #555;
}
.review-details strong {
    color: #333;
    font-size: 12px;
}
.review-colors {
    display: flex;
    gap: 4px;
    margin-top: 2px;
}
.review-color-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-block;
}

/* ================================================================
   External summary (below the builder button)
   ================================================================ */

.inno-emb-config-summary {
    margin-top: 10px;
    padding: 12px 16px;
    background: var(--inno-accent-soft, #e8f5f0);
    border-radius: 12px;
    border: 1px solid var(--inno-accent, #0e7c5f);
    font-size: 13px;
}
.config-summary-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.config-summary-row:last-child {
    margin-bottom: 0;
}
.config-summary-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}
.config-summary-thumb img {
    max-width: 80px;
    max-height: 80px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--inno-accent, #0e7c5f);
    background: #fff;
}
.config-summary-text-preview {
    font-size: 16px;
    font-weight: 700;
    color: var(--inno-accent-ink, #0a5c46);
}

/* Builder open button */
.inno-emb-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--inno-accent, #0e7c5f);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 12px;
}
.inno-emb-open-btn:hover {
    filter: brightness(1.1);
}
.inno-emb-open-btn.has-config {
    background: var(--inno-accent-soft, #e8f5f0);
    color: var(--inno-accent-ink, #0a5c46);
    border: 2px solid var(--inno-accent, #0e7c5f);
}

/* Embroidery button row: Edit Design + Generate Mockup side by side */
.inno-emb-btn-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.inno-emb-btn-row .inno-emb-open-btn {
    margin-top: 0;
    flex: 1 1 0;
    justify-content: center;
}
.inno-emb-btn-row .inno-emb-mockup-btn {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    border: none;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    transition: all 0.15s;
}
.inno-emb-btn-row .inno-emb-mockup-btn:hover:not(:disabled) {
    filter: brightness(1.1);
}
.inno-emb-btn-row .inno-emb-mockup-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ================================================================
   Responsive: Mobile
   ================================================================ */

@media (max-width: 768px) {
    .inno-emb-modal {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    .inno-emb-source-cards {
        grid-template-columns: 1fr;
    }
    .inno-emb-header {
        padding: 16px 20px 12px;
    }
    .inno-emb-body {
        padding: 16px 20px;
    }
    .inno-emb-footer {
        padding: 12px 20px;
    }
    .inno-emb-canvas-row {
        flex-direction: column;
        align-items: center;
    }
    .inno-emb-preset-buttons {
        max-width: 100%;
        justify-content: center;
    }
}

