/**
 * ASE Condition Table Styles
 * Minimal, clean, accessible condition selection table.
 *
 * @package ASE_Custom_Code
 */

/* -----------------------------------------
   Table Wrapper
   ----------------------------------------- */

.ase-condition-table-wrap {
    margin-bottom: 20px;
    max-width: 100%;
}

/* -----------------------------------------
   Table
   ----------------------------------------- */

.ase-condition-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    line-height: 1.5;
}

.ase-condition-table thead th {
    text-align: left;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 14px;
    color: #555;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
}

.ase-condition-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

/* -----------------------------------------
   Row States
   ----------------------------------------- */

.ase-ct-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.ase-ct-row:hover:not(.ase-ct-disabled):not(.ase-ct-selected) {
    background-color: #f5f5f5;
}

.ase-ct-row.ase-ct-selected {
    background-color: #e8f4fd;
}

.ase-ct-row.ase-ct-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* -----------------------------------------
   Radio + Label
   ----------------------------------------- */

.ase-ct-radio {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    vertical-align: middle;
    accent-color: #c0392b;
    position: relative;
}

.ase-ct-radio:checked {
    accent-color: #c0392b;
}

.ase-ct-radio:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #c0392b;
    pointer-events: none;
}

.ase-ct-radio:disabled {
    cursor: not-allowed;
}

.ase-ct-radio:disabled:checked::after {
    background: #999;
}

.ase-ct-label {
    cursor: pointer;
    font-weight: 500;
    vertical-align: middle;
    user-select: none;
}

.ase-ct-disabled .ase-ct-radio:checked::after {
    background: #999;
}

.ase-ct-disabled .ase-ct-label {
    cursor: not-allowed;
    color: #999;
}

/* -----------------------------------------
   Columns
   ----------------------------------------- */

.ase-ct-col-condition {
    width: 50%;
}

.ase-ct-col-price {
    width: 25%;
    font-weight: 600;
    white-space: nowrap;
}

.ase-ct-call-price {
    font-style: italic;
    color: #c0392b;
    white-space: normal;
}

.ase-ct-col-stock {
    width: 25%;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.ase-ct-oos {
    color: #999;
    font-style: italic;
}

/* -----------------------------------------
   Loading / Empty States
   ----------------------------------------- */

.ase-ct-loading-text,
.ase-ct-empty {
    text-align: center;
    padding: 16px 14px;
    color: #888;
    font-style: italic;
}

/* -----------------------------------------
   Surcharge
   ----------------------------------------- */

.ase-surcharge {
    margin-top: 14px;
    padding: 12px 14px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ase-surcharge-label {
    font-weight: 500;
    color: #555;
}

.ase-surcharge-value {
    font-weight: 600;
    color: #333;
}

/* -----------------------------------------
   Disabled Add to Cart Button
   ----------------------------------------- */

.ase-ct-disabled-btn {
    opacity: 0.5;
    pointer-events: none;
}

/* -----------------------------------------
   Hide WC Single Variation Wrap
   ----------------------------------------- */

.woocommerce div.product .single_variation_wrap {
    display: none !important;
}

/* -----------------------------------------
   Custom Add to Basket Button
   ----------------------------------------- */

.ase-add-to-cart-wrap {
    margin-top: 16px;
}

.ase-add-to-cart-btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.ase-add-to-cart-btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* -----------------------------------------
   Call for Price (main price element)
   ----------------------------------------- */

.ase-call-price {
    font-style: italic;
    color: #c0392b;
    font-weight: 600;
}

/* -----------------------------------------
   Mobile Responsive
   ----------------------------------------- */

@media (max-width: 600px) {
    .ase-condition-table {
        font-size: 14px;
    }

    .ase-condition-table thead th,
    .ase-condition-table tbody td {
        padding: 10px 10px;
    }

    .ase-ct-col-condition {
        width: 45%;
    }

    .ase-ct-col-price {
        width: 30%;
    }

    .ase-ct-col-stock {
        width: 25%;
    }

    .ase-surcharge {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* -----------------------------------------
   High Contrast / Reduced Motion
   ----------------------------------------- */

@media ( prefers-reduced-motion: reduce ) {
    .ase-ct-row {
        transition: none;
    }
}

/* -----------------------------------------
   Focus visible for keyboard navigation
   ----------------------------------------- */

.ase-ct-radio:focus-visible {
    outline: 2px solid #1e73be;
    outline-offset: 2px;
}

.ase-ct-label:focus-visible {
    outline: 2px solid #1e73be;
    outline-offset: 2px;
}
