/* Senheng Trade In Widget Styles - WooCommerce Variation Style */
.sh-trade-in-wrapper {
    margin-bottom: var(--wd-var-table-mb, 20px);
    font-family: inherit;
    position: relative;
}

/* Table structure similar to WooCommerce variations - Updated for vertical layout */
.sh-trade-in-table {
    width: 100%;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.sh-trade-in-table .sh-cell {
    text-align: var(--text-align, left);
    padding: 0;
    border: none;
    width: 100%;
}

.sh-trade-in-wrapper .sh-trade-in-table .sh-label {
    font-family: inherit;
    color: inherit;
    font-family: var(--wd-title-font);
    white-space: nowrap;
    margin-bottom: 4px;
    font-size: 14px;
}

.sh-trade-in-wrapper .sh-trade-in-table .sh-label label{
    font-weight: 700;
}

.sh-trade-in-table .sh-value {
    width: 100%;
}fv

/* Legacy support for old label structure */
.sh-trade-in-wrapper .sh-trade-in-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.sh-trade-in-label .required {
    color: #e74c3c;
    font-weight: bold;
}

/* Trade-in and Payment Text Swatches - WoodMart Style */
.sh-trade-in-wrapper .wd-swatches-product {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-left: 15px;
}

.sh-trade-in-wrapper .wd-swatch {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px 8px 12px;
    margin-right: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--wd-swatch-brd-color);
    border-radius: 2px;
    background-color: #fff;
    color: #333;
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
    cursor: pointer;
    user-select: none;
    box-sizing: border-box;
    font-family: var(--wd-title-font);
}

.sh-trade-in-wrapper .wd-swatch:hover {
    --wd-swatch-brd-color: var(--color-gray-500);
}

.sh-trade-in-wrapper .wd-swatch.selected {
    border-color: #000;
    border-width: 2px;
    color: #000;
    font-weight: 600;
}

.sh-trade-in-wrapper .wd-swatch.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Override WooCommerce price color to match text color */
.sh-trade-in-wrapper .woocommerce-Price-amount,
.sh-trade-in-wrapper .woocommerce-Price-amount.amount,
.sh-trade-in-wrapper .woocommerce-Price-amount bdi {
    color: inherit !important;
    font-weight: 500;
}

.sh-trade-in-wrapper .wd-swatch-text {
    font-weight: 500;
    white-space: nowrap;
}

/* Hide the original select elements */
.sh-trade-in-wrapper .sh-trade-in-select,
.sh-trade-in-wrapper .sh-payment-select {
    display: none !important;
}

/* Notice styles */
.sh-trade-in-notice {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
}

.sh-trade-in-no-deposit {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* Elementor editor notice */
.elementor-editor-active .sh-trade-in-notice {
    background-color: #e3f2fd;
    border: 1px solid #90caf9;
    color: #1565c0;
    font-style: italic;
}

/* Responsive styles */
@media (max-width: 768px) {
    .sh-trade-in-wrapper {
        margin-bottom: 16px;
    }
    
    .sh-trade-in-select {
        padding: 10px 14px;
        padding-right: 36px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Integration with WooCommerce forms */
.woocommerce .sh-trade-in-wrapper {
    margin-bottom: 1em;
}

.woocommerce .sh-trade-in-label {
    font-weight: 600;
}

/* Button Styles for Trade-In Options - WooCommerce Variation Style */
.sh-trade-in-buttons {
    display: flex;
    gap: 10px;
    margin-top: 0;
    flex-wrap: wrap;
}

.sh-trade-in-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    background-color: #fff;
    color: #333;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.sh-trade-in-btn:hover {
    border-color: #007cba;
    background-color: #f8f9fa;
    text-decoration: none;
}

.sh-trade-in-btn.active {
    border-color: #007cba;
    background-color: #007cba;
    color: #fff;
}

.sh-trade-in-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* Payment Section Styles - WooCommerce Variation Style */
.sh-payment-section {
    margin-top: 0;
}

.sh-payment-section .sh-trade-in-table {
    margin-top: 20px;
}

.sh-payment-title {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.sh-payment-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sh-payment-btn {
    flex: 1;
    min-width: 140px;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    background-color: #fff;
    color: #333;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.sh-payment-btn:hover {
    border-color: #007cba;
    background-color: #f8f9fa;
    text-decoration: none;
}

.sh-payment-btn.active {
    border-color: #007cba;
    background-color: #007cba;
    color: #fff;
}

.sh-payment-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* Responsive styles for buttons */
@media (max-width: 768px) {
    .sh-trade-in-buttons,
    .sh-payment-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .sh-trade-in-btn,
    .sh-payment-btn {
        min-width: 100%;
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .sh-payment-title {
        font-size: 15px;
    }
}
.sh-trade-in-wrapper {
    opacity: 1;
}

/* Loading state - REMOVED */
/* 
.sh-trade-in-wrapper.loading .sh-trade-in-select {
    opacity: 0.6;
    pointer-events: none;
}

.sh-trade-in-wrapper.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 40px;
    width: 16px;
    height: 16px;
    border: 2px solid #e1e5e9;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    transform: translateY(-50%);
}
*/

/* AWCDP Deposits Section Styles */
.sh-trade-in-wrapper .awcdp-deposits-wrapper {
    margin-top: 20px;
    margin-bottom: 0;
}

.sh-trade-in-wrapper .awcdp-deposits-wrapper .awcdp-deposits-option {
    background: #fff;
    border-radius: 8px;
    border: 2px solid #e1e5e9;
    margin-bottom: 0;
    overflow: hidden;
}

.sh-trade-in-wrapper .awcdp-deposits-wrapper .awcdp-deposits-option:hover {
    border-color: #c3c4c7;
}

.sh-trade-in-wrapper .awcdp-deposits-wrapper .awcdp-deposits-option .awcdp-radio {
    padding: 16px;
    border-bottom: 1px solid #f0f0f1;
    position: relative;
}

.sh-trade-in-wrapper .awcdp-deposits-wrapper .awcdp-deposits-option .awcdp-radio:last-child {
    border-bottom: none;
}

.sh-trade-in-wrapper .awcdp-deposits-wrapper .awcdp-deposits-option .awcdp-radio input[type=radio] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.sh-trade-in-wrapper .awcdp-deposits-wrapper .awcdp-deposits-option .awcdp-radio input[type=radio] + .awcdp-radio-label {
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    padding-left: 32px;
    position: relative;
    display: block;
}

.sh-trade-in-wrapper .awcdp-deposits-wrapper .awcdp-deposits-option .awcdp-radio input[type=radio] + .awcdp-radio-label:before {
    content: "";
    background: #fff;
    border-radius: 50%;
    border: 2px solid #c3c4c7;
    display: inline-block;
    width: 20px;
    height: 20px;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    text-align: center;
}

.sh-trade-in-wrapper .awcdp-deposits-wrapper .awcdp-deposits-option .awcdp-radio input[type=radio]:checked + .awcdp-radio-label:before {
    background-color: #007cba;
    border-color: #007cba;
    box-shadow: inset 0 0 0 4px #fff;
}

.sh-trade-in-wrapper .awcdp-deposits-wrapper .awcdp-deposits-option .awcdp-radio input[type=radio]:focus + .awcdp-radio-label:before {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.sh-trade-in-wrapper .awcdp-deposits-wrapper .awcdp-deposits-option .awcdp-radio input[type=radio]:disabled + .awcdp-radio-label:before {
    box-shadow: inset 0 0 0 4px #fff;
    border-color: #c3c4c7;
    background: #f6f7f7;
}

.sh-trade-in-wrapper .awcdp-deposits-wrapper .awcdp-deposits-option .awcdp-radio .awcdp-deposits-description {
    margin-left: 32px;
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.4;
    color: #e67e22;
    font-weight: 400;
    padding: 8px 12px;
    background-color: #fef9e7;
    border-radius: 4px;
    border-left: 3px solid #e67e22;
}

.sh-trade-in-wrapper .awcdp-deposits-wrapper .awcdp-deposits-option .awcdp-radio .awcdp-deposits-description #awcdp-deposit-amount {
    font-weight: 600;
    color: #d35400;
}

.sh-trade-in-wrapper .awcdp-deposits-wrapper .awcdp-deposits-option .pay-deposit.awcdp-radio {
    background: rgba(0, 124, 186, 0.02);
}

/* Responsive styles for deposits */
@media (max-width: 768px) {
    .sh-trade-in-wrapper .awcdp-deposits-wrapper {
        margin-top: 16px;
    }
    
    .sh-trade-in-wrapper .awcdp-deposits-wrapper .awcdp-deposits-option .awcdp-radio {
        padding: 14px;
    }
    
    .sh-trade-in-wrapper .awcdp-deposits-wrapper .awcdp-deposits-option .awcdp-radio input[type=radio] + .awcdp-radio-label {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .sh-trade-in-wrapper .awcdp-deposits-wrapper .awcdp-deposits-option .awcdp-radio .awcdp-deposits-description {
        margin-left: 28px;
        font-size: 14px;
    }
}

.sh-validation-error {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    padding: 8px;
    background: #ffeaea;
    border: 1px solid #e74c3c;
    border-radius: 4px;
}

/* Error states for variation swatches */
.variations .wd-swatches-product.error .wd-swatch {
    border-color: #dc3232 !important;
    background-color: #ffeaea !important;
}

.variations .wd-swatches-product.error .wd-swatch.selected {
    border-color: #dc3232 !important;
    background-color: #dc3232 !important;
    color: #fff !important;
}

/* Error states for variation select dropdowns */
.variations select.error {
    border-color: #dc3232 !important;
    box-shadow: 0 0 0 1px #dc3232 !important;
}

/* Error states - no animation */
.sh-trade-in-wrapper .wd-swatches-product.error,
.variations .wd-swatches-product.error,
.variations select.error {
    /* Error styling without animation */
}