/* ========== استایل عمومی ========== */
* {
    box-sizing: border-box;
}

/* ========== پاپ‌آپ ========== */
.spf-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.spf-popup-overlay.active {
    display: flex;
}

.spf-popup-container {
    background: #f5f5dc;
    border-radius: 24px;
    max-width: 700px;
    width: 100%;
    padding: 40px 40px; /* افزایش padding برای فاصله بیشتر */
    position: relative;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.spf-popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #1a4d3a;
    line-height: 1;
}

.spf-popup-title {
    text-align: center;
    font-size: 32px;
    color: #1a4d3a;
    margin: 0 0 20px; /* افزایش فاصله */
    font-weight: bold;
    font-family: 'IRANSans_Fa' !important;
}

.spf-step {
    display: none;
}

.spf-step.spf-step-active {
    display: block;
}

.spf-step-desc {
    text-align: center;
    color: #555;
    font-size: 16px;
    margin: 0 0 35px; /* افزایش فاصله */
}

.spf-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px; /* افزایش فاصله */
    margin-bottom: 35px; /* افزایش فاصله */
}

.spf-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px; /* افزایش فاصله */
    margin-bottom: 35px; /* افزایش فاصله */
}

.spf-grid-6 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px; /* افزایش فاصله */
    margin-bottom: 35px; /* افزایش فاصله */
}

.spf-btn {
    background: #1a4d3a;
    color: #fff;
    padding: 25px 8px; /* افزایش padding */
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    position: relative;
    border: 3px solid transparent;
    font-size: 15px;
    font-weight: 400;
}

.spf-btn:hover {
    background: #2a6d5a;
    transform: translateY(-3px);
}

.spf-btn.active {
    border-color: #00ff88;
    background: #0f3d2a;
}

/* حذف کامل تیک سبز */
.spf-btn.active::after {
    display: none !important;
    content: none !important;
}

/* Grayscale برای موارد انتخاب نشده */
.spf-grid-2.has-selection .spf-btn:not(.active),
.spf-grid-4.has-selection .spf-btn:not(.active),
.spf-grid-6.has-selection .spf-btn:not(.active) {
    filter: grayscale(100%);
    opacity: 0.5;
}


.spf-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px; /* افزایش فاصله */
    display: block;
    filter: brightness(0) invert(1);
}

.spf-nav {
    display: revert;
    text-align: center;
    margin-top: 40px;
}

.spf-prev {
    background: #e77708;
    color: #fff;
    padding: 16px 35px; /* افزایش padding */
    border-radius: 8px;
    cursor: pointer;
    border: none;
    font-size: 16px;
    transition: 0.3s;
    min-width: 140px;
    margin-right: 10px;
    margin-left: 10px;
    order: 2; /* سمت چپ */
}

.spf-next {
    background: #e77708;
    color: #fff;
    padding: 16px 35px; /* افزایش padding */
    border-radius: 8px;
    cursor: pointer;
    border: none;
    font-size: 16px;
    transition: 0.3s;
    min-width: 140px;
    margin-right: 10px;
    margin-left: 10px;
    order: 1; /* سمت راست */
}

.spf-prev:hover,
.spf-next:hover {
    background: #f76701;
}

.spf-price-input {
    width: 100%;
    padding: 16px; /* افزایش padding */
    border: 2px solid #1a4d3a;
    border-radius: 12px;
    text-align: left;
    font-size: 16px;
    margin-top: 25px; /* افزایش فاصله */
    direction: ltr;
}

.spf-result-title {
    text-align: center;
    font-size: 22px;
    color: #1a4d3a;
    margin-bottom: 25px; /* افزایش فاصله */
}

.spf-result-box {
    background: #1a4d3a;
    color: #fff;
    padding: 35px; /* افزایش padding */
    border-radius: 20px;
    text-align: center;
    margin: 0 auto 30px; /* افزایش فاصله */
    max-width: 200px;
}

.spf-result-box span {
    font-size: 56px;
    font-weight: bold;
    display: block;
}

.spf-result-box p {
    margin: 10px 0 0;
    font-size: 16px;
}

.spf-show-btn {
    display: block;
    text-align: center;
    text-decoration: none;
    margin: 0 auto;
}

.spf-show-btn:hover {
    background: #e77708;
    color: #fff;
}

/* ========== ساید‌بار ========== */
.spf-sidebar-container {
    background: #fff;
    padding: 20px 12px; /* کاهش padding چپ و راست */
    border-radius: 12px;
    border: 1px solid #e0e0e0; /* حذف box-shadow و جایگزینی با border */
}

.spf-sidebar-title {
    font-size: 20px;
    color: #1a4d3a;
    margin: 0 0 20px;
    text-align: center;
    font-weight: bold;
}

.spf-sidebar-section {
    margin-bottom: 18px;
}

.spf-sidebar-label {
    font-size: 15px;
    color: #1a4d3a;
    margin: 0 0 10px;
    font-weight: bold;
    display: block;
}

/* چیدمان 2 ستونی */
.spf-sidebar-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* Sidebar Radio Buttons - بدون دکمه رادیویی فیزیکی */
.spf-sidebar-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.spf-sidebar-radio:hover {
    border-color: #1a4d3a;
    background: #f9f9f9;
}

.spf-sidebar-radio.selected {
    background: #1a4d3a;
    border-color: #1a4d3a;
}

.spf-sidebar-radio.selected span {
    color: #fff;
    font-weight: 600;
}

.spf-sidebar-radio input[type="radio"] {
    display: none;
}

.spf-sidebar-radio img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.spf-sidebar-radio.selected img {
    filter: brightness(0) invert(1);
}

.spf-sidebar-radio span {
    font-size: 14px;
    color: #333;
    transition: color 0.3s ease;
}


.spf-sidebar-select,
.spf-sidebar-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #1a4d3a;
    border-radius: 8px;
    font-size: 14px;
    direction: rtl;
}

.spf-sidebar-btn {
    width: 100%;
    background: #1a4d3a;
    color: #fff;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
    transition: 0.3s;
}


.spf-sidebar-container {
    background: #fff;
    padding: 20px 0px;
    border-radius: 12px;
    border: none !important;
}


.spf-sidebar-btn:hover {
    background: #2a6d5a;
}


input#sidebar-price-custom {
    text-align: center !important;
    margin-top: 20px !important;
    border-radius: 5px !important;
}

input.spf-price-input {
    text-align: center;
    font-size: 15px !important;
    direction: rtl !important;
}


.spf-sidebar-select {
    /* حذف ظاهر پیش‌فرض */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* تنظیمات آیکون در سمت چپ */
    background-image: url("https://gallery-hosseini.com/wp-content/plugins/Lookaweb-Filter/assets/icons/arrow-down2.svg");
    background-repeat: no-repeat;
    background-position: left 10px center; /* ۱۰ پیکسل فاصله از سمت چپ */
    background-size: 25px 25px;

    /* ایجاد فضای خالی برای متن تا با آیکون همپوشانی نداشته باشد */
    padding-left: 35px; 
    padding-right: 15px; /* کمی پدینگ هم برای سمت راست که متن به لبه نچسبد */
}


.spf-popup-overlay.active {
    background: rgba(0, 0, 0, 0.20) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
}

@media (max-width: 768px) {
    .spf-popup-overlay.active {
        background: rgba(0, 0, 0, 0.18) !important;
        backdrop-filter: blur(4px) !important;
        -webkit-backdrop-filter: blur(4px) !important;
    }
}


/* Toast Notification */
.spf-toast {
    position: fixed;
    background: #e74c3c;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 999999;
    animation: toastFadeIn 0.3s ease;
    white-space: nowrap;
}


@keyframes toastFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== ریسپانسیو ========== */
/* ========== ریسپانسیو ========== */
@media (max-width: 768px) {

    /* عنوان فیلتر هوشمند کوچک‌تر */
    .spf-popup-title {
        font-size: 22px;
        margin: 0 0 12px;
    }

    /* توضیحات کوچک‌تر */
    .spf-step-desc {
        font-size: 13px;
        margin: 0 0 18px;
    }

    .spf-popup-container {
        padding: 40px 16px 24px;
        margin-bottom: 100px;
    }

    /* باکس‌های جنسیت و سبک: مربع، یک سطر، جمع‌تر */
    .spf-grid-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 20px;
    }

    .spf-grid-2 .spf-btn {
        padding: 0;
        aspect-ratio: 1 / 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 13px;
    }

    .spf-grid-2 .spf-icon {
        width: 38px;
        height: 38px;
        margin: 0;
    }

    /* دکمه‌های قیمت و محصولات: 3 تا در سطر، فونت و پدینگ کمتر */
    .spf-grid-4 {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-bottom: 16px;
    }

    .spf-grid-4 .spf-btn {
        font-size: 10px;
        padding: 10px 3px;
    }
    
    .spf-grid-6 {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 16px;
    }

    .spf-grid-6 .spf-btn {
        font-size: 12px;
        padding: 10px 4px;
    }

    /* دکمه‌های ناوبری: کنار هم در یک سطر */
    .spf-nav {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 10px;
        margin-top: 20px;
    }

    .spf-prev,
    .spf-next {
        width: auto;
        flex: 1;
        min-width: 0;
        padding: 12px 10px;
        font-size: 14px;
        margin: 0;
        order: unset;
    }

    .spf-sidebar-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    /* override کردن تنظیم قبلی که grid-2 رو تک‌ستونه می‌کرد */
    .spf-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .spf-nav {
        flex-direction: row;
    }

    .spf-prev,
    .spf-next {
        width: auto;
        flex: 1;
        order: unset;
    }
}


