/*
 * SRZ Warranty Options v1.0.9
 * IMPORTANT: every selector is scoped under .srz-wo-warranty-wrapper
 * or .srz-wo-popup-overlay. No generic WooCommerce/button selectors are
 * styled here, so the plugin cannot change Add to Cart / Buy Now / Quantity.
 */

.srz-wo-warranty-wrapper {
    display: block !important;
    width: 100%;
    max-width: 100%;
    margin: 0 0 20px;
    padding: 18px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fafafa;
    direction: rtl;
    text-align: right;
    box-sizing: border-box;
    clear: both;
    position: relative;
}

.srz-wo-warranty-wrapper,
.srz-wo-warranty-wrapper * {
    box-sizing: border-box;
}

.srz-wo-warranty-wrapper .srz-wo-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 14px;
    padding: 0;
    font-size: 1.15rem;
    line-height: 1.6;
    font-weight: 700;
    color: var(--srz-accent, #1d3557);
}

.srz-wo-warranty-wrapper .srz-wo-title-text {
    display: inline-block;
}

.srz-wo-warranty-wrapper .srz-wo-required-badge {
    display: inline-block;
    color: var(--srz-primary, #e63946);
    font-size: 1.2em;
    line-height: 1;
}

.srz-wo-warranty-wrapper .srz-wo-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 0;
}

.srz-wo-warranty-wrapper .srz-wo-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
    line-height: 1.5;
    text-align: right;
}

.srz-wo-warranty-wrapper .srz-wo-option:hover,
.srz-wo-warranty-wrapper .srz-wo-option.srz-selected {
    border-color: var(--srz-primary, #e63946);
}

.srz-wo-warranty-wrapper .srz-wo-option.srz-selected {
    background: #fff7f7;
    box-shadow: 0 0 0 1px var(--srz-primary, #e63946);
}

.srz-wo-warranty-wrapper .srz-wo-radio {
    width: 18px;
    min-width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    accent-color: var(--srz-primary, #e63946);
    flex: 0 0 18px;
}

.srz-wo-warranty-wrapper .srz-wo-option-label {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.srz-wo-warranty-wrapper .srz-wo-option-name {
    display: inline-block;
    margin: 0;
    padding: 0;
    font-weight: 600;
    color: #111827;
}

.srz-wo-warranty-wrapper .srz-wo-option-price {
    display: inline-block;
    margin: 0;
    padding: 0;
    font-size: .9em;
    font-weight: 500;
    color: var(--srz-primary, #e63946);
}

.srz-wo-warranty-wrapper .srz-wo-required-note {
    margin: 12px 0 0;
    padding: 0;
    font-size: .85rem;
    line-height: 1.7;
    color: var(--srz-primary, #e63946);
    font-weight: 500;
}

/* Classic style */
.srz-wo-warranty-wrapper.srz-wo-style-classic .srz-wo-option {
    padding: 8px 0;
    border-width: 0 0 1px;
    border-style: dashed;
    border-color: #e5e7eb;
    border-radius: 0;
    background: transparent;
}

.srz-wo-warranty-wrapper.srz-wo-style-classic .srz-wo-option:last-child {
    border-bottom: 0;
}

/* Card style */
.srz-wo-warranty-wrapper.srz-wo-style-card .srz-wo-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.srz-wo-warranty-wrapper.srz-wo-style-card .srz-wo-option {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
}

.srz-wo-warranty-wrapper.srz-wo-style-card .srz-wo-option-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
}

/* Scoped popup */
.srz-wo-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, .5);
    direction: rtl;
}

.srz-wo-popup-overlay .srz-wo-popup {
    width: 100%;
    max-width: 400px;
    padding: 28px 32px;
    border-radius: 14px;
    background: #fff;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .2);
}

.srz-wo-popup-overlay .srz-wo-popup p {
    margin: 0 0 20px;
    padding: 0;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #1f2937;
}

.srz-wo-popup-overlay .srz-wo-popup-btn {
    display: inline-block;
    margin: 0;
    padding: 10px 28px;
    border: 0;
    border-radius: 8px;
    background: var(--srz-primary, #e63946);
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
}

.srz-wo-popup-overlay .srz-wo-popup-btn:hover {
    opacity: .9;
}

.srz-wo-error {
    color: #b91c1c;
    padding: 10px;
    background: #fef2f2;
    border-radius: 8px;
    direction: rtl;
}

@media screen and (max-width: 768px) {
    .srz-wo-warranty-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        margin: 12px 0 18px !important;
        padding: 14px 16px !important;
        position: relative !important;
        left: auto !important;
        right: auto !important;
        height: auto !important;
        overflow: visible !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .srz-wo-warranty-wrapper .srz-wo-options {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    .srz-wo-warranty-wrapper .srz-wo-option {
        padding: 12px 14px !important;
    }
}
