/* ==========================================================================
   Base Styles, Fonts & Typography
   ========================================================================== */
@font-face {
    font-family: 'Dana';
    src: url('../fonts/DanaVF.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

.mps-kiosk-wrapper {
    font-family: 'Dana', Tahoma, sans-serif !important;
    direction: rtl;
    background-color: #fcfcfc;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 30px;
    max-width: 1000px;
    margin: 20px auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
}

.mps-kiosk-wrapper * {
    box-sizing: border-box;
    font-family: 'Dana', Tahoma, sans-serif !important;
}

/* Clearfix قوی برای پشتیبانی از Float ها در iOS قدیمی */
.mps-clearfix:before,
.mps-clearfix:after {
    content: " ";
    display: table;
}
.mps-clearfix:after {
    clear: both;
}

/* ==========================================================================
   Search Box (Step 1)
   ========================================================================== */
.mps-search-box {
    text-align: center;
    padding: 40px 20px;
}

.mps-search-box h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
    font-weight: bold;
}

.mps-search-box p {
    color: #777;
    margin-bottom: 30px;
    font-size: 15px;
}

.mps-input-group {
    text-align: center;
    margin-bottom: 40px;
    direction: ltr; 
}

/* استایل دراپ‌داون در صفحه اول */
.mps-main-search .mps-prefix-select {
    display: inline-block;
    vertical-align: middle;
    margin: 0 5px;
    padding: 0 10px 0 35px;
    height: 55px; 
    font-size: 20px;
    font-weight: bold;
    border: 1px solid #b4b4b4;
    border-radius: 8px;
    outline: none;
    direction: ltr;
    color: #333;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #fff;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 12px auto;
    cursor: pointer;
}

.mps-main-search .mps-prefix-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.mps-digits-container {
    display: inline-block;
    vertical-align: middle;
    margin: 0;
    direction: ltr;
}

.mps-main-search .mps-digit-input {
    display: inline-block;
    vertical-align: middle;
    margin: 0 4px;
    width: 45px;
    height: 55px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    border: 1px solid #b4b4b4;
    border-radius: 8px;
    outline: none;
    background: #fff;
}

.mps-main-search .mps-digit-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.mps-btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    font-family: 'Dana', Tahoma, sans-serif !important;
    text-align: center;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.mps-btn-primary {
    background-color: #2D6A4F;
    color: #fff;
    min-width: 200px;
    border: 2px solid #2D6A4F;
}

.mps-btn-primary:hover:not(:disabled) {
    background-color: #FFD166;
    color: #2D6A4F;
    border-color: #FFD166;
}

.mps-btn:disabled {
    background-color: #ccc;
    border-color: #ccc;
    color: #666;
    cursor: not-allowed;
}

.mps-btn-success {
    background-color: #2D6A4F !important;
    color: #FFD166 !important;
    border-color: #2D6A4F !important;
}

.mps-btn-error {
    background-color: #e74c3c !important;
    color: #fff !important;
    border-color: #e74c3c !important;
}

/* ==========================================================================
   Results & Layout (Step 2) - Float based for iOS 9
   ========================================================================== */
.mps-results-wrapper {
    display: block; 
    width: 100%;
}

.mps-filters-sidebar {
    float: right;
    width: 32%; /* عرض برای سایدبار روی آیپد */
    background: #fff;
    padding: 20px;
    border: 1px solid #eaeaea;
    border-radius: 10px;
}

.mps-results-main {
    float: left;
    width: 65%; /* عرض برای نتایج روی آیپد */
    position: relative; 
    min-height: 200px;
}

/* ==========================================================================
   Sidebar Custom UI (Safe for iOS 9 Safari)
   ========================================================================== */
.mps-sidebar-search {
    margin-bottom: 0;
    width: 100%;
    display: block;
}

/* دراپ داونِ سایدبار به صورت بلوک تمام‌عرض */
.mps-sidebar-search .mps-prefix-select {
    display: block;
    width: 100%;
    height: 45px;
    font-size: 16px;
    padding: 0 10px 0 25px;
    margin: 0 0 10px 0;
    border: 1px solid #b4b4b4;
    border-radius: 8px;
    background-color: #fff;
    background-position: left 10px center;
    background-size: 10px auto;
    -webkit-appearance: none;
    direction: ltr;
}

/* باکس‌های ۷ رقمی سایدبار */
.mps-sidebar-search .mps-digits-container {
    display: block;
    width: 100%;
    text-align: center;
}

.mps-sidebar-search .mps-digit-input {
    float: left;
    width: 12%; 
    margin: 0 1.1%;
    height: 40px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    padding: 0;
    border: 1px solid #b4b4b4;
    border-radius: 6px;
    background: #fff;
    box-sizing: border-box;
}

/* ==========================================================================
   Fix Checkboxes - RTL float Fix
   ========================================================================== */
.mps-filter-group h4 {
    margin-bottom: 15px;
    font-size: 15px;
    color: #000;
    font-weight: bold;
}

.mps-checkbox-label {
    display: block; /* نمایش به صورت بلوک مجزا در هر خط */
    margin-bottom: 15px;
    cursor: pointer;
    overflow: hidden; /* Clearfix برای فلوت‌های داخل چک‌باکس */
}

/* چک باکس سمت راست بچسبد */
.mps-checkbox-label input[type="checkbox"] {
    float: right;
    width: 20px;
    height: 20px;
    margin: 0 0 0 10px; /* فاصله از سمت چپ چک‌باکس برای جدا شدن از متن */
    padding: 0;
}

/* متن سمت راست بعد از چک باکس */
.mps-checkbox-text {
    float: right;
    font-size: 14px;
    color: #444;
    line-height: 20px; /* هم‌تراز با ارتفاع چک‌باکس */
}

/* ==========================================================================
   Price Slider UI & Inputs (Safe for iOS 9 Safari)
   ========================================================================== */
/* اسلایدر باید چپ‌چین رندر شود تا ریاضیات jQuery UI در RTL به هم نریزد */
.mps-slider-ui.ui-slider {
    position: relative;
    text-align: left;
    background: #e0e0e0;
    height: 4px;
    border-radius: 2px;
    margin: 20px 10px 15px 10px;
    border: none;
    direction: ltr; 
}
.mps-slider-ui .ui-slider-range {
    position: absolute;
    z-index: 1;
    display: block;
    border: 0;
    background: #3b82f6; 
    height: 100%;
    border-radius: 2px;
}
.mps-slider-ui .ui-slider-handle {
    position: absolute;
    z-index: 2;
    width: 22px;
    height: 22px;
    cursor: pointer;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #ddd;
    top: -9px;
    margin-left: -11px;
    outline: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* فیلدهای قیمت */
.mps-price-inputs-container {
    display: block;
    width: 100%;
    margin-top: 15px;
}

.mps-price-input-wrapper {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    border: 1px solid #b4b4b4;
    border-radius: 8px;
    padding: 8px 10px;
    background: #fff;
    box-sizing: border-box;
}

.mps-price-label {
    float: right;
    width: 15%;
    font-size: 13px;
    color: #555;
    line-height: 24px;
}

.mps-price-input-wrapper input {
    float: right;
    width: 65%;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    direction: ltr;
    line-height: 24px;
    background: transparent;
    padding: 0;
}

.mps-price-input-wrapper .mps-currency {
    float: left;
    width: 15%;
    font-size: 12px;
    color: #888;
    line-height: 24px;
    text-align: left;
}

/* ==========================================================================
   Loading & Notices
   ========================================================================== */
.mps-is-loading {
    opacity: 0.3;
    pointer-events: none;
}

.mps-results-main.mps-loading-active::after {
    content: "";
    position: absolute;
    top: 50px;
    left: 50%;
    margin-left: -25px;
    width: 50px;
    height: 50px;
    border: 5px solid #eaeaea;
    border-top: 5px solid #2D6A4F;
    border-radius: 50%;
    -webkit-animation: mps-spin 1s linear infinite;
    animation: mps-spin 1s linear infinite;
    z-index: 10;
}

@-webkit-keyframes mps-spin {
    0% { -webkit-transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); }
}
@keyframes mps-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mps-similar-notice {
    background-color: #e8f8f5;
    color: #2D6A4F;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: bold;
    text-align: center;
    border: 1px dashed #2D6A4F;
}

.mps-no-result {
    text-align: center;
    padding: 50px;
    color: #888;
    background: #fff;
    border-radius: 10px;
    border: 1px dashed #ccc;
    margin: 0;
}

/* ==========================================================================
   SIM Cards
   ========================================================================== */
.mps-sim-card {
    float: right; 
    width: 48%; 
    margin-bottom: 20px;
    margin-left: 4%; 
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.mps-sim-card:nth-child(2n) {
    margin-left: 0;
}

.mps-sim-card:hover {
    border-color: #2D6A4F;
}

.mps-sim-number {
    font-size: 22px;
    font-weight: bold;
    color: #222;
    margin-bottom: 15px;
    letter-spacing: 2px;
    direction: ltr;
}

.mps-sim-details {
    display: block;
    text-align: center;
    color: #777;
    font-size: 13px;
    margin-bottom: 15px;
}

.mps-sim-details span {
    display: inline-block;
    margin: 0 5px;
}

.mps-sim-price {
    font-size: 18px;
    font-weight: bold;
    color: #2D6A4F;
    margin-bottom: 20px;
}

.mps-btn-reserve {
    display: block;
    width: 100%;
    background-color: #fff;
    color: #2D6A4F;
    border: 2px solid #2D6A4F;
    padding: 10px;
}

/* ==========================================================================
   Popup / Modal
   ========================================================================== */
.mps-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: none; 
    text-align: center;
}

.mps-popup-overlay:before {
    content: '';
    display: inline-block;
    height: 100%;
    vertical-align: middle;
}

.mps-popup-content {
    display: inline-block;
    vertical-align: middle;
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.mps-popup-icon {
    width: 60px;
    height: 60px;
    background: #2D6A4F;
    color: #FFD166;
    font-size: 30px;
    line-height: 60px;
    border-radius: 50%;
    margin: 0 auto 20px auto;
}

.mps-popup-content h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.mps-popup-content p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* ==========================================================================
   Responsive adjustments (موبایل‌های کوچک)
   ========================================================================== */
@media (max-width: 768px) {
    .mps-filters-sidebar {
        float: none;
        width: 100%;
        margin-bottom: 20px;
    }
    
    .mps-results-main {
        float: none;
        width: 100%;
    }

    .mps-sim-card {
        width: 100%;
        margin-left: 0;
    }

    .mps-sidebar-search .mps-digit-input {
        width: 11%;
        margin: 0 1.5%;
    }
}