/**
 * WC Vendors Manager — בונה אפשרויות מוצר
 * מחליף את ממשק הוריאציות המסורתי בחוויה פשוטה
 */

/* ═══════════════════════════════════════════
   בחירת סוג מוצר — כפתורים גדולים
═══════════════════════════════════════════ */
.wcvm-type-choice {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 8px;
}

@media (max-width: 600px) {
    .wcvm-type-choice { grid-template-columns: 1fr; }
}

.wcvm-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 22px 16px;
    border: 2px solid #e4e7eb;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.18s;
    text-align: center;
    font-family: inherit;
    position: relative;
}

.wcvm-type-btn:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.wcvm-type-btn.active {
    border-color: #2271b1;
    background: #f0f6fc;
    box-shadow: 0 0 0 3px rgba(34,113,177,0.15);
}

.wcvm-type-btn.active::after {
    content: '✓';
    position: absolute;
    top: 10px;
    left: 10px;
    width: 22px;
    height: 22px;
    background: #2271b1;
    color: #fff;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcvm-type-btn .wcvm-type-icon {
    font-size: 36px;
    line-height: 1;
}

.wcvm-type-btn .wcvm-type-title {
    font-size: 16px;
    font-weight: 700;
    color: #1d2327;
}

.wcvm-type-btn .wcvm-type-desc {
    font-size: 13px;
    color: #646970;
}

/* ═══════════════════════════════════════════
   שלב 1 — מה משתנה?
═══════════════════════════════════════════ */
.wcvm-builder-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e4e7eb;
    animation: wcvm-fade-in 0.2s ease;
}

@keyframes wcvm-fade-in {
    from { opacity:0; transform: translateY(6px); }
    to   { opacity:1; transform: translateY(0); }
}

.wcvm-builder-label {
    font-size: 15px;
    font-weight: 700;
    color: #1d2327;
    margin-bottom: 12px;
    display: block;
}

.wcvm-builder-sublabel {
    font-size: 13px;
    color: #646970;
    margin-top: -8px;
    margin-bottom: 12px;
    display: block;
}

.wcvm-diff-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

@media (max-width: 560px) {
    .wcvm-diff-grid { grid-template-columns: repeat(2, 1fr); }
}

.wcvm-diff-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 10px;
    border: 2px solid #e4e7eb;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.wcvm-diff-btn:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.wcvm-diff-btn.selected {
    border-color: #2271b1;
    background: #f0f6fc;
    box-shadow: 0 0 0 2px rgba(34,113,177,0.2);
}

.wcvm-diff-btn .wcvm-diff-icon { font-size: 26px; }
.wcvm-diff-btn .wcvm-diff-label { font-size: 13px; font-weight: 600; color: #1d2327; }

/* ═══════════════════════════════════════════
   שלב 2 — ערכי כל סוג (tag input)
═══════════════════════════════════════════ */
.wcvm-attr-inputs {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
}

.wcvm-attr-input-group {
    background: #f9fafb;
    border: 1px solid #e4e7eb;
    border-radius: 10px;
    padding: 16px;
    animation: wcvm-fade-in 0.2s ease;
}

.wcvm-attr-input-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.wcvm-attr-input-icon { font-size: 20px; }

.wcvm-attr-input-name {
    font-weight: 700;
    font-size: 15px;
    color: #1d2327;
    flex: 1;
}

/* שם מותאם אישית לסוג "אחר" */
.wcvm-attr-custom-name {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 12px;
    background: #fff;
}

.wcvm-attr-custom-name:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34,113,177,0.15);
}

/* Tags container */
.wcvm-tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    border: 1.5px dashed #c3c4c7;
    border-radius: 8px;
    background: #fff;
    min-height: 48px;
    align-items: center;
    cursor: text;
    transition: border-color 0.15s;
}

.wcvm-tags-wrap:focus-within {
    border-color: #2271b1;
    border-style: solid;
}

.wcvm-tag {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #2271b1;
    color: #fff;
    padding: 5px 10px 5px 8px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    animation: wcvm-tag-pop 0.15s ease;
    user-select: none;
}

@keyframes wcvm-tag-pop {
    from { transform: scale(0.8); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* צבע tag מיוחד */
.wcvm-tag.has-color {
    padding-right: 6px;
}

.wcvm-tag-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.5);
    flex-shrink: 0;
}

.wcvm-tag-remove {
    width: 16px;
    height: 16px;
    background: rgba(255,255,255,0.25);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.1s;
}

.wcvm-tag-remove:hover { background: rgba(255,255,255,0.45); }

.wcvm-tag-input {
    border: none;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    background: transparent;
    min-width: 120px;
    flex: 1;
    color: #1d2327;
}

.wcvm-tag-input::placeholder { color: #a7aaad; }

/* Color input row */
.wcvm-color-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.wcvm-color-picker-input {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid #c3c4c7;
    padding: 2px;
    cursor: pointer;
    background: none;
}

.wcvm-color-name-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.wcvm-color-name-input:focus,
.wcvm-color-picker-input:focus {
    outline: none;
    border-color: #2271b1;
}

.wcvm-color-add-btn {
    padding: 8px 14px;
    border: 1px solid #2271b1;
    border-radius: 6px;
    background: #fff;
    color: #2271b1;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    white-space: nowrap;
}

.wcvm-color-add-btn:hover {
    background: #2271b1;
    color: #fff;
}

/* hint */
.wcvm-tag-hint {
    font-size: 12px;
    color: #a7aaad;
    margin-top: 6px;
}

/* ═══════════════════════════════════════════
   שלב 3 — כרטיסיות אפשרויות
═══════════════════════════════════════════ */
.wcvm-options-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: 20px 0 16px;
    padding-top: 16px;
    border-top: 1px solid #e4e7eb;
}

.wcvm-options-actions .wcvm-bulk-price-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
}

.wcvm-bulk-price-wrap input {
    width: 100px;
    padding: 8px 10px;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.wcvm-bulk-price-wrap .wcvm-btn-ghost {
    padding: 8px 14px;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    color: #3c434a;
    transition: all 0.15s;
}

.wcvm-btn-ghost:hover {
    border-color: #2271b1;
    color: #2271b1;
}

.wcvm-option-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wcvm-option-card {
    background: #fff;
    border: 1.5px solid #e4e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.15s;
    animation: wcvm-fade-in 0.2s ease;
}

.wcvm-option-card:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.07);
}

.wcvm-option-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e4e7eb;
    cursor: pointer;
    user-select: none;
}

.wcvm-option-card-swatches {
    display: flex;
    gap: 4px;
}

.wcvm-option-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #c3c4c7;
    flex-shrink: 0;
}

.wcvm-option-card-title {
    font-weight: 700;
    font-size: 14px;
    color: #1d2327;
    flex: 1;
}

.wcvm-option-card-summary {
    font-size: 13px;
    color: #646970;
}

.wcvm-option-card-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #646970;
    padding: 0 4px;
    line-height: 1;
    transition: transform 0.2s;
}

.wcvm-option-card.collapsed .wcvm-option-card-toggle {
    transform: rotate(-90deg);
}

.wcvm-option-card-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: #d63638;
    font-size: 20px;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.wcvm-option-card-delete:hover { opacity: 1; }

.wcvm-option-card-body {
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 14px;
    align-items: start;
}

@media (max-width: 600px) {
    .wcvm-option-card-body { grid-template-columns: 1fr 1fr; }
}

.wcvm-option-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #646970;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.wcvm-option-field input[type="number"],
.wcvm-option-field input[type="text"] {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
}

.wcvm-option-field input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34,113,177,0.12);
}

/* sale price crossed */
.wcvm-option-field.has-sale input.wcvm-opt-regular {
    text-decoration: line-through;
    color: #a7aaad;
}

/* stock toggle */
.wcvm-stock-toggle-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wcvm-stock-toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #646970;
    text-transform: uppercase;
    cursor: pointer;
}

.wcvm-toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.wcvm-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.wcvm-toggle-slider {
    position: absolute;
    inset: 0;
    background: #c3c4c7;
    border-radius: 20px;
    transition: background 0.15s;
    cursor: pointer;
}

.wcvm-toggle-slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    top: 3px;
    right: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.15s;
}

.wcvm-toggle-switch input:checked + .wcvm-toggle-slider {
    background: #2271b1;
}

.wcvm-toggle-switch input:checked + .wcvm-toggle-slider::before {
    transform: translateX(-16px);
}

/* image in option card */
.wcvm-option-img-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.wcvm-option-img-preview {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    border: 1.5px solid #e4e7eb;
    display: none;
}

.wcvm-option-img-btn {
    width: 60px;
    height: 60px;
    border: 2px dashed #c3c4c7;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    font-size: 22px;
    color: #a7aaad;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.wcvm-option-img-btn:hover {
    border-color: #2271b1;
    color: #2271b1;
    background: #f0f6fc;
}

/* advanced toggle */
.wcvm-option-advanced-toggle {
    grid-column: 1 / -1;
    background: none;
    border: none;
    cursor: pointer;
    color: #646970;
    font-size: 12px;
    padding: 0;
    text-align: right;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wcvm-option-advanced-toggle:hover { color: #2271b1; }

.wcvm-option-advanced {
    grid-column: 1 / -1;
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding-top: 10px;
    border-top: 1px dashed #e4e7eb;
    animation: wcvm-fade-in 0.15s ease;
}

.wcvm-option-advanced.open { display: grid; }

/* empty state */
.wcvm-options-empty {
    text-align: center;
    padding: 30px;
    color: #8c8f94;
    font-size: 14px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1.5px dashed #dcdcde;
}
