/* Global Styles */
html,
body {
  height: 100%;
  overflow-x: hidden;
  width: 100%;
}
body {
  margin: 0;
  /* Use a consistent font stack, ensure it supports Arabic glyphs */
  font-family: Roboto, "Helvetica Neue", sans-serif;
  text-align: left; /* Default alignment for LTR */
}

/* ------------------------------------------------------------------- */
/* --- DEFAULT (LTR) STYLES --- */
/* ------------------------------------------------------------------- */

body[dir="ltr"] {
  text-align: left; /* Left alignment for LTR */
  direction: ltr;
}

/* General Styles */
a {
  text-decoration: none !important;
}

/* iPhone Models Carousel (Default/Mobile Layout Fixes) */
/* The base class for the carousel container */
.iphone-models-carousel {
  /* No need for display/visibility here unless hiding on mobile is intended */
  padding: 40px 20px;
  text-align: center;

  @media (max-width: 576px) {
    /* Reduce padding on very small screens to give content more space */
    padding: 20px 10px;
  }
}

/* Styling for each individual card within the carousel */
.iphone-model-card {
  /* ... existing LTR styles ... */

  @media (max-width: 576px) {
    padding: 10px; /* Reduce internal card padding */
    margin: 0 5px; /* Reduce space between cards */
  }
}

/* Styling the images */
.iphone-model-card img {
  /* ... existing LTR styles ... */

  @media (max-width: 576px) {
    padding: 10px 0; /* Reduce vertical padding around the image */
  }
}

/* Start BreadCrumb */
.nav_breadcrumb {
  /* ... existing LTR styles ... */
  .compare_div {
    span {
      padding-left: 6px;
      font-size: 13px;
    }
  }

  .breadcrumb-item + .breadcrumb-item::before {
    content: ">" !important;
  }
  /* ... rest of LTR breadcrumb styles ... */
}
/* End BreadCrumb */

/* Start Grid of Subcategories */
.section_grid {
  .row_div {
    border-top: 1px solid rgba(112, 112, 112, 0.5);
    border-left: 1px solid rgba(112, 112, 112, 0.5); /* Default LTR border position */
    overflow: hidden;
    margin-bottom: 80px;

    .col_app {
      border-right: 1px solid rgba(112, 112, 112, 0.5);
      border-bottom: 1px solid rgba(112, 112, 112, 0.5);
      padding: 16px;
      cursor: pointer;
    }
  }

  .custom_row {
    border-left: 0px !important;

    .custom_col {
      border-left: 1px solid rgba(112, 112, 112, 0.5);
      margin-right: -1px;
    }
  }
}
/* End Grid of Subcategories */

/* ... ALL OTHER LTR STYLES (Filter, Price Range, Mat-Checkbox, etc.) ... */

/* Start Col Styling */
.col-md-2-4 {
  padding-right: 15px;
  padding-left: 15px;
}
/* End Col Styling */

/* ------------------------------------------------------------------- */
/* --- RTL (ARABIC) OVERRIDES --- */
/* ------------------------------------------------------------------- */

body[dir="rtl"] {
  text-align: right; /* Right alignment for RTL */
  direction: rtl;
  font-family: "Tahoma", sans-serif; /* Add Arabic-friendly font back */
}

/* Force Carousel Visibility in AR */
.iphone-models-carousel,
.iphone-models-carousel owl-carousel-o {
  display: block !important;
  visibility: visible !important;
}

/* Force visibility for card images if hidden in AR */
.iphone-model-card img,
.iphone-model-card a {
  display: block !important;
  visibility: visible !important;
}

/* Breadcrumbs RTL Adjustments */
body[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
  content: "<" !important; /* Flip breadcrumb separator for RTL */
}

body[dir="rtl"] .nav_breadcrumb .compare_div span {
  padding-right: 6px; /* Adjust padding-inline-start for RTL */
  padding-left: 0;
}

/* Grid of Subcategories RTL Adjustments (Flipping borders) */
body[dir="rtl"] .section_grid .row_div {
  border-left: 0;
  border-right: 1px solid rgba(112, 112, 112, 0.5);
}

body[dir="rtl"] .section_grid .row_div .col_app {
  border-left: 1px solid rgba(112, 112, 112, 0.5); /* LTR border-right becomes border-left */
  border-right: 0;
}

body[dir="rtl"] .section_grid .custom_row {
  border-right: 0px !important; /* LTR border-left: 0 */
  border-left: 1px solid rgba(112, 112, 112, 0.5); /* LTR border-right becomes border-left */
}

body[dir="rtl"] .section_grid .custom_row .custom_col {
  border-right: 1px solid rgba(112, 112, 112, 0.5); /* LTR border-left becomes border-right */
  margin-left: -1px; /* LTR margin-right becomes margin-left */
}

/* Filter Brand RTL Adjustments */
body[dir="rtl"] .brand-item-select {
  text-align: right;
}

/* Price Range RTL Adjustments */
body[dir="rtl"] .ngx-slider .ngx-slider-bubble.ngx-slider-limit-ceil {
  left: auto;
  right: 270px !important;
}

/* Mat-Radiobutton RTL Adjustments */
body[dir="rtl"] .mat-radio-label {
  text-align: right;
}

/* Owl Slider RTL Adjustments */

/* Ensure inner cards align correctly within the RTL flow */
body[dir="rtl"] .iphone-model-card {
  /* Margin flip is usually handled by the slider, but setting explicitly ensures spacing */
  margin: 0 5px;

  /* If items are jumping, setting position relative can stabilize them */
  position: relative;
}

/* Fix for Col Styling (Use logical properties for clarity) */

@media (max-width: 576px) {
  /* Apply LTR mobile padding values to RTL layout */
  body[dir="rtl"] .iphone-models-carousel {
    padding: 20px 10px;
  }

  body[dir="rtl"] .iphone-model-card {
    padding: 10px; /* Same reduced internal padding */
    margin: 0 5px; /* Same reduced space between cards */
  }

  body[dir="rtl"] .iphone-model-card img {
    padding: 10px 0; /* Same reduced vertical padding */
  }
}
