/**
 * Variation Selector Widget Styles
 */

/* Wrapper */
.csb-vs-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Section (attribute group) */
.csb-vs-section {
    margin-bottom: 24px;
}

.csb-vs-section:last-child {
    margin-bottom: 0;
}

.csb-vs-section-label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Option item (radio & checkbox) */
.csb-vs-option {
    display: block;
    position: relative;
    cursor: pointer;
    padding: 16px 20px;
    border-bottom: 2px solid #d4c9a8;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.csb-vs-option:last-child {
    border-bottom: none;
}

.csb-vs-option--selected,
.csb-vs-option--selected:last-child {
    border: 2px solid #8a9a3a;
    border-radius: 8px;
}

/* Inner layout */
.csb-vs-option-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.csb-vs-option-left {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
}

.csb-vs-option-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.csb-vs-option-right {
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Radio & checkbox inputs */
.csb-vs-radio,
.csb-vs-checkbox {
    margin: 3px 0 0 0;
    cursor: pointer;
    accent-color: #8a9a3a;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Label text */
.csb-vs-label {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

/* Amount (price) */
.csb-vs-amount {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

/* After amount (e.g. "+ Tax") */
.csb-vs-after-amount {
    font-size: 13px;
    color: #888;
    white-space: nowrap;
}

/* Hint text below price */
.csb-vs-hint {
    font-size: 11px;
    color: #999;
    width: 100%;
    text-align: right;
}

/* Discount pill */
.csb-vs-discount {
    display: inline-block;
    background-color: #d4c9a8;
    color: #333;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 4px;
    line-height: 1.4;
    width: fit-content;
}

/* Most Popular badge */
.csb-vs-most-popular {
    display: block;
    background-color: #e88b8b;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 20px;
    margin-top: 10px;
    border-radius: 4px;
    text-align: center;
    width: fit-content;
    margin-left: auto;
}

/* Dropdown */
.csb-vs-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #d4c9a8;
    border-radius: 8px;
    background-color: #fff;
    cursor: pointer;
    appearance: auto;
}

.csb-vs-select:focus {
    outline: none;
    border-color: #8a9a3a;
}

/* Checkbox option variant */
.csb-vs-checkbox-option {
    border-bottom: none;
    border: 2px solid transparent;
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 14px 20px;
    background-color: #f9f9f9;
}

.csb-vs-checkbox-option.csb-vs-option--selected {
    border-color: #8a9a3a;
    background-color: #fff;
}

/* Student form section */
.csb-vs-student-section {
    margin-top: 24px;
}

.csb-vs-students-list .csb-child-entry {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.csb-vs-student-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.csb-vs-student-title {
    font-size: 14px;
    color: #333;
}

.csb-vs-remove-student {
    background: none;
    border: 1px solid #e88b8b;
    color: #a00;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.csb-vs-remove-student:hover {
    background: #ffebeb;
}

.csb-vs-add-student-wrapper {
    text-align: center;
    margin-top: 12px;
}

.csb-vs-add-student {
    background-color: #f6f7f7;
    border: 1px dashed #8a9a3a;
    color: #8a9a3a;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.csb-vs-add-student:hover:not(:disabled) {
    background-color: #fff;
    border-style: solid;
}

.csb-vs-add-student:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.csb-vs-student-count-note {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 6px;
}

/* Optional options (e.g. Teacher Requested) */
.csb-vs-optional-section {
    margin-top: 24px;
}

.csb-vs-optional-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: border-color 0.2s ease;
}

.csb-vs-optional-item--checked {
    border-color: #8a9a3a;
}

.csb-vs-optional-checkbox {
    margin: 0;
    cursor: pointer;
    accent-color: #8a9a3a;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.csb-vs-optional-label {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

/* Error message */
.csb-vs-error {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 12px;
}

/* Price display */
.csb-vs-price-display {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
    text-align: right;
}

.csb-vs-price-note {
    font-size: 13px;
    font-weight: 400;
    color: #888;
}

.csb-vs-price-tax-note {
    font-size: 12px;
    color: #999;
    text-align: right;
    margin-bottom: 12px;
}

/* Add to Cart button */
.csb-vs-cart-wrapper {
    margin-top: 24px;
}

.csb-vs-add-to-cart {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background-color: #8a9a3a;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease;
    width: 100%;
}

.csb-vs-add-to-cart:hover:not(:disabled) {
    background-color: #748232;
}

.csb-vs-add-to-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cart form reset */
.csb-vs-cart-form {
    margin: 0;
    padding: 0;
}

/* Responsive */
@media (max-width: 480px) {
    .csb-vs-option-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .csb-vs-option-right {
        padding-left: 28px;
    }
}
