/* --- Common Styles for Simcard Items --- */
.simcard-row-item {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 15px 20px; /* Base padding */
    transition: all 0.2s ease-in-out;
    display: flex; /* Use flexbox for desktop layout */
    align-items: center; /* Vertically align items in the row */
}

.product-price-display{
    font-size: 14px;
    color: #626262;
}

.simcard-cell {
    padding: 0 10px; /* Space between columns */
    /* Ensure no flex-shrink by default to maintain width */
    flex-shrink: 0;
}

/* --- Specific Cell/Column Styles (Desktop First) --- */

.simcard-number-cell {
    flex-basis: 180px; /* Fixed width for the number */
    min-width: 150px;
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    text-align: left; /* LTR number */
    border-left: 1px solid #f0f0f0; /* Separator for clarity */
    padding-left: 20px;
}

.simcard-actions-cell-desktop {
    padding-right: 0; /* No right padding */
    padding-left: 15px; /* Adjust for RTL */
    border-left: 1px solid #f0f0f0;
}
.btn-wishlist {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #ccc;
    transition: color 0.2s ease;
    padding: 5px;
    line-height: 1; /* For better vertical alignment of icon */
    display: flex; /* To center icon */
    align-items: center;
    justify-content: center;
}
.btn-wishlist:hover {
    color: #dc3545;
}

.simcard-details-cell {
    flex-grow: 1; /* Allows this cell to take up available space */
    padding-left: 15px;
    border-left: 1px solid #f0f0f0;
    font-size: 0.95em;
    color: #555;
    white-space: nowrap; /* Prevent wrapping for details */
    overflow: hidden; /* Hide overflow if text is too long */
    text-overflow: ellipsis; /* Add ellipsis for overflowed text */
}

.detail-separator {
    color: #aaa;
    margin: 0 5px;
}

.simcard-price-cell {
    flex-basis: 150px; /* Fixed width for price */
    min-width: 120px;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    border-left: 1px solid #f0f0f0;
}

.old-price-display {
    font-size: 0.85em;
    color: #999;
    text-decoration: line-through;
    display: block; /* New line for old price if needed */
}

.simcard-buttons-cell {
    flex-basis: 220px; /* Fixed width for buttons */
    min-width: 180px;
    display: flex;
    justify-content: flex-end; /* Align buttons to the right */
    gap: 10px;
    padding-right: 0; /* Remove right padding */
}

.simcard-buttons-cell .btn {
    padding: 8px 15px;
    font-size: 0.9em;
    border-radius: 5px;
    text-align: center;
    white-space: nowrap; /* Prevent button text from wrapping */
}

/* General button styles (adjust if you have global Bootstrap styles) */
.btn-secondary {
    background-color: #6c757d;
    color: #fff;
    border: 1px solid #6c757d;
}


.simcard-buttons-cell .btn i {
    margin-left: 5px;
}

/* Hide elements specific to desktop on mobile by default */
.desktop-only-btn {
    display: block; /* Show by default on desktop */
}

/* --- Responsive Layout (Mobile/Tablet - Card View) --- */
@media (max-width: 992px) { /* Adjust breakpoint as needed for tablet/mobile */
    .simcard-row-item {
        flex-direction: column; /* Stack items vertically to create a card */
        align-items: stretch; /* Stretch items to fill card width */
        padding: 15px;
    }

    .simcard-cell {
        padding: 0; /* Remove horizontal padding within cells for card view */
        width: 100%; /* Each cell takes full width */
        flex-basis: auto; /* Reset flex basis for column layout */
        min-width: auto; /* Reset min-width */
        border-left: none; /* Remove vertical separators */
        padding-bottom: 10px; /* Add space between stacked sections */
    }

    /* Adjust specific cells for card view */
    .simcard-header { /* A new class if you want to group number and wishlist in card header */
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #f0f0f0;
        padding-bottom: 10px;
        margin-bottom: 10px;
    }

    .simcard-number-cell {
        font-size: 1.4rem;
        text-align: right; /* Align number to right for RTL */
        flex-grow: 1; /* Allows number to take space */
        padding-left: 0;
        padding-right: 0;
        border-left: none; /* No vertical border in card view */
        padding-bottom: 0; /* No extra padding below number if header groups it */
    }

    .simcard-actions-cell-desktop { /* Repurpose this for wishlist button in card header */
        padding-right: 0;
        padding-left: 0;
        border-left: none;
        padding-bottom: 0;
        text-align: left; /* Align wishlist button to the left in RTL card header */
    }

    .simcard-details-cell {
        font-size: 0.9em;
        padding-left: 0;
        border-bottom: 1px dashed #e9ecef; /* Dashed separator for details */
        padding-bottom: 10px;
        margin-bottom: 10px;
        white-space: normal; /* Allow text to wrap in card view */
        overflow: visible; /* Show full text */
        text-overflow: clip; /* No ellipsis */
        display: flex; /* Use flex for detail rows */
        flex-direction: column; /* Stack detail rows */
        gap: 5px;
    }

    .simcard-details-cell .detail-row { /* Style individual detail rows in card view */
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .simcard-details-cell .detail-label {
        font-weight: 500;
        color: #495057;
        margin-left: 10px; /* Space after label */
    }
    .simcard-details-cell .detail-text {
        text-align: left; /* Align value to left */
    }
    .detail-separator {
        display: none; /* Hide separators in card view */
    }


    .simcard-price-cell {
        font-size: 1.2rem;
        text-align: left; /* Align price to left in card */
        border-bottom: 1px dashed #e9ecef;
        padding-bottom: 10px;
        margin-bottom: 10px;
    }

    .simcard-buttons-cell {
        flex-direction: column; /* Stack buttons vertically */
        gap: 8px; /* Space between buttons */
        padding-right: 0;
        padding-top: 5px; /* Space above buttons */
    }

    .simcard-buttons-cell .btn {
        width: 100%; /* Full width buttons in card */
        font-size: 1em;
        justify-content: center; /* Center text and icon */
        display: flex;
        align-items: center;
    }

    .desktop-only-btn {
        display: none; /* Hide this button on mobile */
    }
}






















/* --- Base Styles for Filters (Desktop First) --- */
.sidebar-widget {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: block; /* Default to block for desktop sidebar */
}

.section-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    text-align: right;
}

.form-label, .fw-900 {
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
    color: #444;
}

.simcard-number-inputs {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    direction: ltr;
    justify-content: flex-end;
}

.square-input {
    width: 100%; /* Make width relative to parent */
    max-width: 40px; /* Maximum width */
    height: 100%; /* Make height relative to parent */
    max-height: 40px; /* Maximum height */
    min-width: 25px; /* Minimum width to maintain usability */
    min-height: 25px; /* Minimum height to maintain usability */
    text-align: center;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 1.1rem;
    padding: 5px;
    flex-shrink: 1; /* Allow shrinking */
}

.square-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.list-group-item {
    border: none;
    padding: 0;
}
.list-group-item:last-child {
    margin-bottom: 0;
}

.custome-checkbox .form-check-input {
    margin-left: 8px;
}

.custome-checkbox label {
    cursor: pointer;
    font-weight: normal;
    color: #555;
}

.custome-checkbox span {
    display: inline-block;
    vertical-align: middle;
}

/* Price slider styles (assuming jQuery UI or similar) */
#slider-range {
    height: 8px;
    border-radius: 5px;
    background: #e0e0e0;
    position: relative;
}
.ui-slider-handle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    position: absolute;
    top: -6px;
    margin-left: -10px;
}
.ui-slider-range {
    background: #007bff;
    border-radius: 5px;
    position: absolute;
    height: 100%;
}

.caption {
    font-size: 0.9em;
    color: #666;
}
.text-brand {
    color: #007bff;
    font-weight: bold;
}

/* Filter button for Desktop */
.desktop-filter-btn {
    background-color: #681fa2;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    display: flex; /* Ensure it's a flex container for icon and text */
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background-color 0.2s ease;
    width: 100%; /* Make it wide on desktop sidebar */
}
.desktop-filter-btn:hover {
    background-color: #218838;
    color: #fff;
}
.desktop-filter-btn i {
    margin-left: 8px;
}

/* Mobile specific elements (hidden by default on desktop) */
.mobile-filter-trigger-wrapper {
    position: fixed;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%; /* Adjust width for padding */
    max-width: 400px;
    z-index: 1050;
    display: none; /* Hidden on desktop */
    background: #ffffff;
    padding: 10px;
}

/* Fixed action buttons at the bottom of the filter modal for mobile */
.filter-actions-mobile-fixed {
    position: fixed; /* Keep it fixed at the bottom */
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex; /* Arrange buttons side-by-side */
    justify-content: space-around; /* Distribute space evenly */
    gap: 10px; /* Space between buttons */
    padding: 15px 20px;
    background-color: #fff;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    z-index: 1070; /* Above the filter modal */
    transform: translateY(100%); /* Start hidden below screen */
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    visibility: hidden;
}

.filter-actions-mobile-fixed.show {
    transform: translateY(0); /* Slide up into view */
    opacity: 1;
    visibility: visible;
}

.filter-actions-mobile-fixed .btn {
    flex-grow: 1; /* Allow buttons to grow and fill space */
    padding: 12px 15px;
    font-size: 1.1rem;
    border-radius: 8px;
}

/* --- Responsive Adjustments --- */
@media (max-width: 991.98px) {

    /* Filter sidebar becomes a full-screen modal */
    #filterSidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: #fff;
        z-index: 1060;
        overflow-y: auto; /* Enable scrolling for filter content */
        padding: 20px; /* Adjust padding for mobile view */
        padding-bottom: 90px; /* Make space for fixed action buttons */
        transform: translateY(100%);
        transition: transform 0.3s ease-out, opacity 0.3s ease-out;
        opacity: 0;
        display: block; /* Ensure it's block for transformation */
        visibility: hidden;
    }

    #filterSidebar.show {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    /* Show the mobile filter trigger button */
    .mobile-filter-trigger-wrapper {
        display: block;
    }

    /* Hide the desktop filter button on mobile */
    .desktop-filter-btn {
        display: none;
    }

    /* Show the fixed mobile action buttons when filter modal is open */
    #filterSidebar.show + .filter-actions-mobile-fixed { /* This selector won't work as they are not siblings */
        /* This rule is incorrect. Will be handled by JS adding 'show' to #mobileFilterActions directly */
    }

    /* Adjust padding and separators for filter content in mobile view */
    #filterSidebar .section-title {
        margin-bottom: 25px;
        text-align: center;
    }
    #filterSidebar .list-group-item,
    #filterSidebar .price-filter {
        padding: 10px 0;
        border-bottom: 1px solid #eee;
        margin-bottom: 15px;
    }
    #filterSidebar .list-group-item:last-of-type,
    #filterSidebar .price-filter:last-of-type {
        border-bottom: none;
        margin-bottom: 0;
    }

    .simcard-number-inputs {
        justify-content: center;
    }
}


.modal-content-container .card{
    border: 1px solid #e0e0e0;
}

/* --- Simcard Detail Modal Styling --- */
.simcard-detail-modal .modal-dialog {
    max-width: 900px; /* Increased max-width for two-column layout */
    margin: 1.75rem auto; /* Default Bootstrap margin */
}

.simcard-detail-modal .modal-content {
    border-radius: 0.75rem; /* Rounded corners for the modal */
    overflow: hidden; /* Ensure content respects border-radius */
}

.simcard-detail-modal .btn-close {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10; /* Ensure it's above other content */
    opacity: 1; /* Make it always visible */
    background-color: rgba(255, 255, 255, 0.8); /* Optional: semi-transparent background */
    border-radius: 50%;
    padding: 0.5rem;
}

.simcard-detail-modal .modal-header {
    border-bottom: none; /* No border for header if using custom styling */
}

.simcard-detail-modal .modal-body {
    padding: 1.5rem; /* Adjust padding as needed */
}

/* --- Loader Container Styling --- */
.loader-container {
    padding: 50px 0; /* Centering loader */
}

/* --- Card Header Styling --- */
.simcard-detail-modal .card-header {
    border-bottom: 1px solid #e9ecef; /* Light border at the bottom of card header */
}

.simcard-detail-modal .card-title i {
    font-size: 1.25rem; /* Icon size in card title */
}

/* --- Style for Phone Number Buttons (Bordered, Rounded, Hollow) --- */
.simcard-detail-modal .btn-outline-primary-custom {
    color: #0d6efd; /* Bootstrap primary color for text */
    border: 1px solid #0d6efd; /* Primary color for border */
    background-color: transparent; /* Hollow */
    border-radius: 14px; /* Curved border as requested */
    padding: 0.5rem 1rem; /* Adjust padding for desired size */
    font-size: 0.9rem; /* Adjust font size if needed */
    transition: all 0.2s ease-in-out; /* Smooth transition for hover */
}

.simcard-detail-modal .btn-outline-primary-custom:hover,
.simcard-detail-modal .btn-outline-primary-custom:focus {
    color: #fff; /* White text on hover */
    background-color: #0d6efd; /* Solid primary color on hover */
    border-color: #0d6efd; /* Keep border primary on hover */
}

.simcard-detail-modal .btn-outline-primary-custom i {
    font-size: 0.85rem; /* Icon size slightly smaller than text */
    vertical-align: middle; /* Align icon nicely with text */
}

/* --- Specific styles for the "Simcard Specs List" (List items height reduced) --- */
.simcard-detail-modal .simcard-specs-list .list-group-item {
    border-color: #f8f9fa; /* Very light border to mimic separation without strong lines */
    background-color: #fff; /* Default white background */
    transition: background-color 0.2s ease-in-out; /* Smooth transition for hover effect */
    /* *** اینجا ارتفاع ردیف‌ها را با !important برای اطمینان بیشتر کاهش می‌دهیم *** */
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
}

/* Zebra striping effect for list items (طوسی متناوب) */
.simcard-detail-modal .simcard-specs-list .list-group-item:nth-child(odd) {
    background-color: #f8f8f8; /* Light gray for odd rows */
}

.simcard-detail-modal .simcard-specs-list .list-group-item:hover {
    background-color: #f1f1f1; /* Slightly darker gray on hover */
}

/* Style for icons within the list group items */
.simcard-detail-modal .simcard-specs-list .list-group-item .text-muted i {
    font-size: 0.9rem; /* Slightly smaller icon size for a more compact look */
    vertical-align: middle; /* Ensure vertical alignment with text */
    color: #6c757d; /* Bootstrap muted color for the icons */
}

/* For the description item, adjust padding as it's flex-column */
.simcard-detail-modal .simcard-specs-list .list-group-item.flex-column {
    padding-top: 0.75rem !important; /* Slightly more padding for description */
    padding-bottom: 0.75rem !important;
}
.simcard-detail-modal .simcard-specs-list .list-group-item.flex-column .text-muted.small {
    margin-bottom: 0.25rem !important; /* Reduce space below description title */
}


/* --- General text and color utilities --- */
.text-dark {
    color: #212529 !important;
}

.text-muted {
    color: #6c757d !important;
}

.text-primary {
    color: #0d6efd !important;
}

.text-primary-light {
    color: #6daffb !important; /* A lighter shade of primary for icons/accents */
}

/* --- RESPONSIVE ADJUSTMENTS for Mobile, Tablet, and Desktop --- */

/* For Small Devices (Phones: max-width 575.98px) */
@media (max-width: 575.98px) {
    .simcard-detail-modal .modal-dialog {
        /* Full width and height on small screens */
        max-width: 100%;
        margin: 0; /* Remove side margins */
        min-height: 100vh; /* Make modal take full height */
        display: flex; /* Flexbox for vertical centering if content is small */
        align-items: center; /* Center vertically */
    }

    .simcard-detail-modal .modal-content {
        height: 100%; /* Take full height within dialog */
        border-radius: 0; /* No rounded corners on full-screen mobile modal */
        overflow-y: auto; /* Allow scrolling if content is taller than screen */
    }

    .simcard-detail-modal .modal-body {
        padding: 1rem; /* Smaller padding on mobile */
    }

    .simcard-detail-modal .btn-close {
        top: 10px;
        right: 10px;
        padding: 0.4rem; /* Smaller close button */
    }

    /* Adjust button font size for phone numbers if they look too big on mobile */
    .simcard-detail-modal .btn-outline-primary-custom {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    /* Adjust general text size in modal if needed for mobile readability */
    .simcard-detail-modal .card-body p,
    .simcard-detail-modal .simcard-specs-list .list-group-item span {
        font-size: 0.875rem; /* Smaller text for better fit */
    }

    .simcard-detail-modal .card-title {
        font-size: 1.1rem; /* Slightly smaller card titles */
    }

    /* Add spacing between stacked cards on mobile */
    .simcard-detail-modal .modal-content-container .row > div {
        margin-bottom: 1rem;
    }
    .simcard-detail-modal .modal-content-container .row > div:last-child {
        margin-bottom: 0; /* No margin after the last stacked card */
    }
}

/* For Medium Devices (Tablets: 576px to 991.98px) */
@media (min-width: 576px) and (max-width: 991.98px) {
    .simcard-detail-modal .modal-dialog {
        max-width: 650px; /* Adjust max-width for tablets to look good */
        margin: 1rem auto;
    }

    .simcard-detail-modal .modal-body {
        padding: 1.25rem; /* Slightly smaller padding */
    }

    /* Add spacing between stacked cards on tablet */
    .simcard-detail-modal .modal-content-container .row > div {
        margin-bottom: 1rem;
    }
    .simcard-detail-modal .modal-content-container .row > div:last-child {
        margin-bottom: 0;
    }
}

/* For Large Devices (Desktops: 992px and up) */
@media (min-width: 992px) {
    .simcard-detail-modal .modal-content-container .row > div.mb-lg-0 {
        margin-bottom: 0 !important;
    }
}