/**
 * WCNVAS Frontend Styles
 * Non-Variation Attribute Selectors for WooCommerce
 */

/* =============================================
 * HIDE DEFAULT WOOCOMMERCE VARIATIONS
 * ============================================= */

/* Hide original variations container (table or div) */
form.variations_form .variations,
form.variations_form table.variations,
form.variations_form div.variations,
.variations_form > .variations,
.single-product .variations:not(.wcnvas-wrap) {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide reset link from original form */
form.variations_form > .reset_variations,
.variations_form .reset_variations:not(.wcnvas-reset) {
    display: none !important;
}

/* =============================================
 * MAIN WRAPPER
 * ============================================= */

.wcnvas-wrap {
    margin: 1.5em 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

/* Combined block (has both variations and non-variations) */
.wcnvas-wrap.wcnvas-combined {
    margin-bottom: 1em;
}

/* Section heading */
.wcnvas-heading {
    margin: 0 0 12px 0;
    padding: 0 0 8px 0;
    font-size: 1.1em;
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* =============================================
 * FIELD STYLES
 * ============================================= */

.wcnvas-field {
    margin: 14px 0;
}

.wcnvas-field:first-of-type {
    margin-top: 0;
}

.wcnvas-field:last-child {
    margin-bottom: 0;
}

/* Field labels */
.wcnvas-field > label {
    display: block;
    margin: 0 0 6px 0;
    font-weight: 600;
    font-size: 0.95em;
    color: inherit;
}

/* Required indicator */
.wcnvas-required {
    color: #c00;
    font-weight: bold;
}

/* Select dropdown */
.wcnvas-select {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    font-size: 1em;
    background-color: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wcnvas-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.15);
}

.wcnvas-select:hover {
    border-color: rgba(0, 0, 0, 0.25);
}

/* =============================================
 * VALIDATION STATES
 * ============================================= */

.wcnvas-field.wcnvas-error-state .wcnvas-select,
.wcnvas-field.wcnvas-error-state .wcnvas-radios {
    border-color: #c00;
}

.wcnvas-field.wcnvas-error-state .wcnvas-select:focus {
    box-shadow: 0 0 0 2px rgba(204, 0, 0, 0.15);
}

.wcnvas-error {
    display: block;
    margin-top: 4px;
    font-size: 0.85em;
    color: #c00;
}

.wcnvas-field.wcnvas-valid .wcnvas-select {
    border-color: #46b450;
}

/* =============================================
 * RADIO BUTTONS
 * ============================================= */

.wcnvas-radios {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0;
}

.wcnvas-radio-label {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    cursor: pointer;
    font-weight: 400;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.wcnvas-radio-label:hover {
    background-color: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.2);
}

.wcnvas-radio-label input[type="radio"] {
    margin: 0;
    width: 18px;
    height: 18px;
    accent-color: #0073aa;
}

.wcnvas-radio-label:has(input:checked) {
    background-color: rgba(0, 115, 170, 0.05);
    border-color: #0073aa;
}

.wcnvas-radio-text {
    flex: 1;
}

/* =============================================
 * RESPONSIVE
 * ============================================= */

@media (max-width: 480px) {
    .wcnvas-wrap {
        padding: 12px;
        margin: 1em 0;
    }

    .wcnvas-radio-label {
        padding: 10px;
    }
}
