/* =============================================
   Premium Attractive Variant Selection Box
   Theme: #5c3e98
   No border radius
   ============================================= */

/* ── Theme Variables ── */
:root {
    --primary: #5c3e98;
    --primary-dark: #4b327d;
    --primary-light: #f5f1fc;
    --primary-soft: rgba(92, 62, 152, 0.08);
    --text-dark: #2f2a33;
    --text-muted: #777;
    --border: #ddd3f0;
    --border-light: #ebe3f8;
    --white: #fff;
    --success-bg: #eef7ea;
    --success-text: #4f7c35;
    --shadow-sm: 0 3px 10px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 20px rgba(92, 62, 152, 0.10);
    --transition: all 0.25s ease;
}

/* ── Wrapper ── */
.variant-wrapper {
    margin-bottom: 1.8rem;
}

/* ── Label ── */
.variant-label {
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* ── Grid ── */
.variant-container {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

/* ── Variant Card ── */
.variant-card {
    position: relative;
    text-align: center;
    padding: 14px 12px;
    border: 1px solid var(--border);
    border-radius: 0;
    cursor: pointer;
    min-width: 125px;
    max-width: 150px;
    background: linear-gradient(to bottom, #ffffff, #faf8fd);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* subtle top highlight */
.variant-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    transition: var(--transition);
}

/* hover */
.variant-card:hover {
    border-color: var(--primary);
    background: #f7f3fc;
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.variant-card:hover::before {
    background: var(--primary);
}

/* selected */
.variant-card.selected {
    border: 2px solid var(--primary);
    background: linear-gradient(to bottom, #fcfbfe, #f5f1fc);
    box-shadow: 0 0 0 1px rgba(92, 62, 152, 0.06), 0 8px 22px rgba(92, 62, 152, 0.14);
    transform: translateY(-2px);
}

.variant-card.selected::before {
    background: var(--primary);
}

/* ── Optional Selected Check ── */
.variant-card.selected::after {
    content: "✓";
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    box-shadow: 0 3px 10px rgba(92, 62, 152, 0.25);
}

/* ── Image ── */
.variant-img {
    display: block;
    width: 62px;
    height: 62px;
    object-fit: contain;
    border-radius: 0;
    margin: 0 auto 10px;
    border: 1px solid var(--border-light);
    background: #fff;
    padding: 4px;
    transition: var(--transition);
}

.variant-card:hover .variant-img,
.variant-card.selected .variant-img {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(92, 62, 152, 0.10);
}

/* ── Placeholder ── */
.variant-img-placeholder {
    width: 62px;
    height: 62px;
    background-color: #f5f1fc;
    border: 1px solid var(--border);
    border-radius: 0;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 22px;
}

/* ── Name ── */
.variant-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
    line-height: 1.3;
    min-height: 34px;
}

.variant-card.selected .variant-name {
    color: var(--primary-dark);
}

/* ── SKU ── */
.variant-sku {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.2px;
}

.variant-card.selected .variant-sku {
    color: var(--primary);
}

/* ── Price Row ── */
.variant-price-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 6px;
}

/* Sale price */
.variant-price-sale {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: 0.2px;
}

.variant-card.selected .variant-price-sale {
    color: var(--primary-dark);
}

/* Original price */
.variant-price-original {
    font-size: 12px;
    color: #9b9b9b;
    text-decoration: line-through;
}

/* ── Discount Badge ── */
.variant-badge-discount {
    display: inline-block;
    background: #eee7fb;
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 0;
    margin-top: 4px;
    letter-spacing: 0.2px;
}

/* ── Summary Box ── */
.variant-summary {
    display: none;
    margin-top: 14px;
    padding: 12px 14px;
    background: linear-gradient(to right, #fcfbfe, #f7f3fc);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: 0;
    font-size: 14px;
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
}

.variant-summary .summary-name {
    font-weight: 700;
    color: var(--text-dark);
}

.variant-summary .summary-price {
    color: var(--primary-dark);
    font-weight: 700;
}

.variant-summary .summary-discount {
    color: var(--primary);
    font-weight: 700;
}

/* ── Responsive ── */
@media (max-width: 576px) {
    .variant-container {
        gap: 10px;
    }

    .variant-card {
        min-width: 100px;
        max-width: 118px;
        padding: 10px 8px;
    }

    .variant-img,
    .variant-img-placeholder {
        width: 48px;
        height: 48px;
    }

    .variant-name {
        font-size: 13px;
        min-height: 30px;
    }

    .variant-price-sale {
        font-size: 14px;
    }

    .variant-badge-discount {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* Additional Price Styling */
.variant-price-sale {
    font-size: 17px;
    font-weight: 700;
    color: #4b327d;
}

.variant-price-original {
    position: relative;
    font-size: 12px;
    color: #999;
    font-weight: 500;
    opacity: 0.95;
}

/* Vertical Name Ribbon */
.variant-name-vertical {
    position: absolute;
    font-weight: 600;
    font-size: 13px;
    color: #ffffff;
    margin: 0 auto;
    text-align: center;
    line-height: 2.2;
    background: #4b327d;
    top: 0;
    left: 0;
    right: 0;
}