/* ================================================
   WC Simple Add-Ons – Frontend Styles v2.1
   ================================================ */

.wcsa-addons-wrapper {
    margin: 1.5em 0;
    direction: rtl;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    clear: both;
}

/* ── جعبه اصلی ── */
.wcsa-addons-box {
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 6px;
    padding: 1.25em;
    background: transparent;
}

/* ── عنوان ── */
.wcsa-title {
    font-size: 1.05em !important;
    font-weight: 700 !important;
    margin: 0 0 1em 0 !important;
    padding: 0 0 .6em 0 !important;
    border: 0 !important;
    border-bottom: 2px solid currentColor !important;
    opacity: .85;
}

/* ── هر گروه ── */
.wcsa-addon-group {
    margin-bottom: 1.2em;
}

.wcsa-addon-group:last-of-type {
    margin-bottom: 0;
}

/* ── لیبل ── */
.wcsa-addon-label {
    font-size: .95em !important;
    font-weight: 600 !important;
    margin: 0 0 .4em 0 !important;
    display: flex !important;
    align-items: center;
    gap: .3em;
    padding: 0 !important;
}

.wcsa-addon-label .required {
    color: #e00 !important;
    border: 0 !important;
    text-decoration: none !important;
}

/* ── توضیح ── */
.wcsa-addon-desc {
    font-size: .85em !important;
    margin: 0 0 .4em 0 !important;
    opacity: .7;
}

/* ── select ── */
.wcsa-select {
    display: block !important;
    width: 100% !important;
    font-family: inherit !important;
    font-size: inherit !important;
    color: inherit !important;
    background-color: transparent !important;
    border: 1px solid rgba(0, 0, 0, .2) !important;
    border-radius: 4px !important;
    padding: .55em .8em !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: auto;
    appearance: auto;
    max-width: 100% !important;
    height: auto !important;
    line-height: normal !important;
}

.wcsa-select:focus {
    outline: none !important;
    border-color: currentColor !important;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, .1) !important;
}

/* ── حالت خطا ── */
.wcsa-select.wcsa-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, .2) !important;
}

.wcsa-error-msg {
    display: block;
    color: #dc3545;
    font-size: .82em;
    margin-top: .3em;
    font-weight: 500;
}

/* ════════════════════════════════════════
   جدول خلاصه قیمت
════════════════════════════════════════ */

.wcsa-summary {
    margin-top: 1.4em;
    border-top: 1px dashed rgba(0, 0, 0, .15);
    padding-top: 1.2em;
    /* مخفی در ابتدا - با JS نمایش داده می‌شود */
    display: none;
}

.wcsa-summary-title {
    font-size: .95em !important;
    font-weight: 700 !important;
    margin: 0 0 .7em 0 !important;
    padding: 0 !important;
    color: inherit;
}

/* ── جدول ── */
.wcsa-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9em;
    background: transparent !important;
}

/* ── سلول‌ها ── */
.wcsa-summary-table th,
.wcsa-summary-table td {
    padding: .45em .5em !important;
    text-align: right !important;
    border: 0 !important;
    background: transparent !important;
    vertical-align: middle;
    box-shadow: none !important;
}

/* ── ردیف‌های بدنه ── */
.wcsa-summary-table tbody tr {
    border-bottom: 1px solid rgba(0, 0, 0, .06) !important;
    background: transparent !important;
}

.wcsa-summary-table tbody tr:last-child {
    border-bottom: 0 !important;
}

.wcsa-summary-table tbody th {
    font-weight: 400;
    opacity: .8;
    width: 65%;
}

.wcsa-summary-table tbody td {
    font-weight: 600;
    white-space: nowrap;
    text-align: left !important;
}

/* ── ردیف قیمت پایه ── */
.wcsa-row-base th {
    opacity: .65 !important;
}

/* ── ردیف جمع کل ── */
tfoot.wcsa-summary-tfoot,
.wcsa-summary-table tfoot {
    border-top: 2px solid rgba(0, 0, 0, .15) !important;
}

.wcsa-summary-total th,
.wcsa-summary-total td {
    font-weight: 700 !important;
    font-size: 1.05em !important;
    padding-top: .65em !important;
    padding-bottom: .65em !important;
    border-top: 2px solid rgba(0, 0, 0, .15) !important;
}

.wcsa-summary-total td {
    text-align: left !important;
}

.wcsa-total-price {
    font-size: 1.1em !important;
}

/* ── نمایش در سبد خرید ── */
.wcsa-cart-addons {
    list-style: none !important;
    margin: .4em 0 0 0 !important;
    padding: 0 !important;
    font-size: .85em;
    opacity: .8;
}

.wcsa-cart-addons li {
    margin: .2em 0 !important;
    padding: 0 !important;
    display: flex;
    flex-wrap: wrap;
    gap: .25em;
    align-items: center;
}

.wcsa-cart-addons li::before {
    content: '›';
    opacity: .5;
}

/* ── ریسپانسیو ── */
@media (max-width: 480px) {
    .wcsa-addons-box {
        padding: 1em;
    }

    .wcsa-summary-table tbody th {
        width: 55%;
    }
}