.variant-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.variant-modal.is-open {
    display: flex;
}

.variant-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    animation: vmFadeIn 0.18s ease-out;
}

.variant-modal__dialog {
    position: relative;
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    animation: vmSlideUp 0.22s ease-out;
}

@keyframes vmFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes vmSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.variant-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #374151;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.2s ease;
}

.variant-modal__close:hover {
    background: #e5e7eb;
}

.variant-modal__header {
    display: flex;
    gap: 14px;
    padding: 18px 18px 12px;
    border-bottom: 1px solid #f1f5f9;
}

.variant-modal__image-link {
    flex: 0 0 84px;
    display: block;
    border-radius: 10px;
    overflow: hidden;
}

.variant-modal__image {
    width: 84px;
    height: 84px;
    object-fit: cover;
    display: block;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: opacity 0.2s ease;
}

.variant-modal__image-link:hover {
    cursor: pointer;
}

.variant-modal__title-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.variant-modal__title-link:hover {
    cursor: pointer;
}

.variant-modal__heading {
    flex: 1;
    min-width: 0;
}

.variant-modal__title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin: 0 28px 6px 0;
    line-height: 1.35;
    word-break: break-word;
}

.variant-modal__price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.variant-modal__sale-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: #f97316;
}

.variant-modal__regular-price {
    font-size: 0.9rem;
    color: #9ca3af;
    text-decoration: line-through;
}

.variant-modal__regular-price:empty {
    display: none;
}

.variant-modal__stock {
    margin-top: 6px;
    font-size: 0.82rem;
    font-weight: 600;
}

.variant-modal__stock--in {
    color: #e44d26;
}

.variant-modal__stock--out {
    color: #dc2626;
}

.variant-modal__body {
    padding: 14px 18px 4px;
}

.variant-modal__body-grid {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.variant-modal__attrs {
    flex: 1;
    min-width: 0;
}

.variant-modal__qty-wrap {
    flex: 0 0 auto;
}

.variant-modal__section {
    margin-bottom: 14px;
}

.variant-modal__section-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px;
}

.variant-modal__options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vm-color-option,
.vm-size-option,
.vm-weight-option {
    cursor: pointer;
    user-select: none;
    padding: 6px 12px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    background: #fff;
    color: #1f2937;
    font-size: 0.88rem;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    transition: all 0.2s ease;
}

.vm-color-option {
    padding-left: 30px;
    position: relative;
    min-width: 70px;
}

.vm-color-option .vm-color-dot {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
}

.vm-color-option:hover,
.vm-size-option:hover,
.vm-weight-option:hover {
    border-color: #f97316;
}

.vm-color-option.is-selected,
.vm-size-option.is-selected,
.vm-weight-option.is-selected {
    background: #f97316;
    border-color: #f97316;
    color: #fff;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.25);
}

.vm-color-option.is-disabled,
.vm-size-option.is-disabled,
.vm-weight-option.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

.variant-modal__qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.variant-modal__qty-btn {
    width: 36px;
    height: 36px;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
}

.variant-modal__qty-btn:hover {
    background: #e5e7eb;
}

.variant-modal__qty-input {
    width: 52px;
    height: 36px;
    border: none;
    text-align: center;
    font-weight: 600;
    color: #111827;
    background: #fff;
    -moz-appearance: textfield;
}

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

.variant-modal__footer {
    padding: 12px 18px 18px;
    border-top: 1px solid #f1f5f9;
    background: #fff;
    position: sticky;
    bottom: 0;
}

.variant-modal__add-btn {
    width: 100%;
    background: #e44d26;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 14px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease, transform 0.1s ease;
}

.variant-modal__add-btn:hover {
    background: #e44d26;
}

.variant-modal__add-btn:active {
    transform: translateY(1px);
}

.variant-modal__add-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

@media (max-width: 380px) {
    .variant-modal__dialog {
        border-radius: 12px;
    }

    .variant-modal__title {
        font-size: 0.95rem;
    }

    .variant-modal__image {
        width: 72px;
        height: 72px;
        flex-basis: 72px;
    }

    .variant-modal__body-grid {
        flex-direction: column;
        gap: 0;
    }
}
