:root {
  --primary-color: #ff6600;
  --secondary-color: #28a745;
  --text-color: #333;
  --bg-light: #f0f2f5;
  --card-bg: #fdfdfd;
  --border-color: #5d5d5d;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);

  --luxury-purple: #6f42c1;
  --luxury-grad: linear-gradient(135deg, #6610f2 0%, #d63384 100%);
}

body {
  font-family: "Cairo", sans-serif;
  background-color: var(--bg-light);
  color: var(--text-color);
  direction: rtl;
  text-align: right;
}

.text-purple {
  color: #6f42c1;
}

.top-bar {
  background: #fff;
  padding: 15px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  z-index: 1;
}

.offcanvas {
  font-family: "Cairo", sans-serif;
}

/* Store Card */
.store-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box; /* Fix for size diffs */
  padding: 6px;
}

.store-logo {
  width: 60px;
  height: 60px;
  object-fit: cover;
  background: #fff;
  transition: all 0.4s ease;
}

/* HOVER SHADOWS */
/* Normal */
.normal-store:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  border-color: #aaa;
}
/* Featured */
.featured-border {
  border: 2px solid #ffd700 !important;
}
.featured-store:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(255, 215, 0, 0.25); /* Golden Glow */
}
/* Luxury */
.luxury-card {
  border: 2px solid transparent !important;
  background-image: linear-gradient(var(--card-bg), var(--card-bg)),
    var(--luxury-grad);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 4px 15px rgba(111, 66, 193, 0.15);
  padding: 6px;
}
.luxury-card:hover {
  transform: scale(1.02);
  box-shadow: 0 15px 35px rgba(111, 66, 193, 0.4); /* Purple Glow Stronger */
}

/* Luxury Logo Animation */
.luxury-card .store-logo {
  border: 3px solid #d63384;
  border-radius: 50% !important;
  box-shadow: 0 0 10px rgba(214, 51, 132, 0.4);
  animation: pulse-purple 2s infinite alternate;
}

@keyframes pulse-purple {
  from {
    box-shadow: 0 0 5px rgba(214, 51, 132, 0.4);
    border-color: #6610f2;
  }
  to {
    box-shadow: 0 0 15px rgba(102, 16, 242, 0.6);
    border-color: #d63384;
  }
}

.luxury-badge-text {
  background: var(--luxury-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  font-size: 0.8rem;
  margin-right: 5px;
  border: 1px solid #d63384;
  padding: 2px 6px;
  border-radius: 12px;
}

/* Products */
.product-preview {
  position: relative;
  width: 31%;
  border-radius: 6px;
  overflow: hidden;
  background: #f8f9fa;
  transition: transform 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
  border: 1px solid #dee2e6;
}
.product-preview img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: block;
}
.price-tag {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 2px 0;
  text-align: center;
}

/* Hover Zoom */
.clickable-product:hover {
  transform: scale(1.1);
  z-index: 5;
}

/* Luxury Product Electric Border */
.luxury-card .product-preview {
  border: 2px solid transparent;
}
.luxury-card .clickable-product:hover {
  border: 2px solid #d63384;
  box-shadow: 0 0 10px #d63384, inset 0 0 5px #d63384;
  animation: electric-border 0.5s infinite alternate;
}

@keyframes electric-border {
  0% {
    border-color: #6610f2;
    box-shadow: 0 0 5px #6610f2;
  }
  100% {
    border-color: #d63384;
    box-shadow: 0 0 15px #d63384;
  }
}

/* Categories & Brands */
.categories-row {
  min-height: 25px;
}
.cat-pill {
  font-size: 0.7rem;
  background: #f1f3f5;
  color: #555;
  padding: 2px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #e9ecef;
}
.cat-pill:hover {
  background: #e2e6ea;
  color: #000;
}

.brands-separator {
  width: 1px;
  height: 16px;
  background: #ccc;
}
.brand-pill {
  font-size: 0.75rem;
  font-weight: 600;
}

/* Ribbons & Buttons (Same as before) */
.ribbon {
  position: absolute;
  top: 10px;
  left: -8px;
  width: 80px;
  height: 80px;
  overflow: hidden;
  z-index: 10;
}
.ribbon span {
  position: absolute;
  display: block;
  width: 140px;
  padding: 5px 0;
  background-color: #ffd700;
  color: #000;
  font-weight: bold;
  font-size: 12px;
  text-align: center;
  transform: rotate(-45deg);
  top: 15px;
  left: -35px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.ribbon.ribbon-luxury span {
  background: var(--luxury-grad);
  color: #fff;
}

.btn-sm-custom {
  font-size: 0.8rem;
  border-radius: 6px;
  transition: all 0.2s;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-dark:hover {
  background: #000;
}
.btn-luxury-main {
  background: var(--luxury-grad);
  color: #fff;
  border: none;
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.btn-luxury-main:hover {
  color: #fff;
  opacity: 0.95;
}
.btn-featured-main:hover {
  background: #ffc107;
  color: #000;
}
.btn-normal-follow:hover {
  background: #eee;
}
.btn-luxury-follow:hover {
  background: #f8f0ff;
}
.btn-featured-follow:hover {
  background: #fff9db;
}
.btn-normal-chat:hover,
.btn-luxury-chat:hover,
.btn-featured-chat:hover {
  background: #28a745 !important;
  color: #fff !important;
  border-color: #28a745 !important;
}
.sm-share-btn:hover {
  background: #eee;
  color: #000;
}
.badges-row {
  height: 30px;
  overflow: hidden;
  align-items: center;
}
.badge-icon-item {
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
  cursor: help;
}
.badge-icon-item:hover {
  transform: scale(1.2);
}

.badge-level-pill {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: #343a40;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 6px;
  min-width: 14px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* WHATSAPP MODAL STYLES */
#whatsappModal .modal-content {
  border-radius: 20px;
  overflow: hidden;
}

#whatsappModal .bg-success {
  background: linear-gradient(135deg, #25d366, #128c7e) !important;
}

.animate-bounce {
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

#modal-phone-display {
  font-family: "Courier New", Courier, monospace; /* Monospace for numbers */
  letter-spacing: 3px;
}

#confirm-whatsapp-btn {
  transition: all 0.3s ease;
}
#confirm-whatsapp-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

/* --- TSL MODERN UI COMPONENTS --- */

/* 1. Custom Checkbox */
.tsl-checkbox-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  margin-bottom: 8px;
  border: 1px solid transparent;
  user-select: none;
}

.tsl-checkbox-wrapper:hover {
  background-color: #f1f3f5;
  border-color: #e9ecef;
}

.tsl-checkbox-input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.tsl-checkbox-box {
  height: 22px;
  width: 22px;
  background-color: #fff;
  border: 2px solid #adb5bd;
  border-radius: 6px;
  margin-left: 12px; /* RTL spacing */
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tsl-checkbox-input:checked ~ .tsl-checkbox-box {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  transform: scale(1.05);
  box-shadow: 0 2px 5px rgba(255, 102, 0, 0.3);
}

.tsl-checkbox-box::after {
  content: "";
  display: none;
  width: 6px;
  height: 11px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}

.tsl-checkbox-input:checked ~ .tsl-checkbox-box::after {
  display: block;
}

.tsl-checkbox-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #495057;
  flex-grow: 1;
}

/* 2. Custom Radio (Experience) */
.tsl-radio-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s;
  margin-bottom: 6px;
}
.tsl-radio-wrapper:hover {
  background-color: #f1f3f5;
}

.tsl-radio-input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.tsl-radio-circle {
  height: 20px;
  width: 20px;
  background-color: #fff;
  border: 2px solid #adb5bd;
  border-radius: 50%;
  margin-left: 12px;
  position: relative;
  transition: all 0.2s;
}

.tsl-radio-input:checked ~ .tsl-radio-circle {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
}

.tsl-radio-circle::after {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--primary-color);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.2s;
}

.tsl-radio-input:checked ~ .tsl-radio-circle::after {
  transform: translate(-50%, -50%) scale(1);
}

.tsl-radio-label {
  font-size: 0.9rem;
  color: #555;
  font-weight: 600;
}

/* Category Scroll Area */
.category-scroll-area {
  max-height: 250px;
  overflow-y: auto;
  display: block;
  border: 1px solid #e9ecef;
  padding: 12px;
  border-radius: 8px;
  background-color: #f8f9fa;
}
div#stores-grid {
  padding: 15px;
}
.top-bar.sticky-top.mb-4 {
  z-index: 1000;
}

/* Country Filter Pills */
.country-pill {
  font-size: 0.8rem;
  background: #fff;
  color: #555;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #dee2e6;
  display: inline-block;
  user-select: none;
}
.country-pill:hover {
  background: #f8f9fa;
  border-color: #ced4da;
  transform: translateY(-1px);
}
.country-pill.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 2px 5px rgba(255, 102, 0, 0.3);
}
.country-pill .count {
  background: rgba(255, 255, 255, 0.2);
  padding: 0 6px;
  border-radius: 10px;
  font-size: 0.7em;
  margin-right: 5px;
}

/* --- InstantSearch Adapters --- */

/* SearchBox */
#searchbox {
    position: relative;
    direction: ltr; /* Input might need LTR for icon position but text is RTL? No, container relative */
}
/* Force RTL direction for input placeholder */
#searchbox input {
    direction: rtl;
    padding-right: 40px !important;
    border-radius: 8px;
    border: 1px solid #ced4da;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
#searchbox::after {
    content: "\f002"; /* FontAwesome Search */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 50%;
    right: 15px; /* RTL position of icon */
    transform: translateY(-50%);
    color: #aaa;
    pointer-events: none;
    z-index: 5;
}
#searchbox input:focus {
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border-color: var(--primary-color);
}

/* Clear Refinements Wrapper */
#clear-refinements button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Pagination Adjustments */
#pagination .page-item {
    margin: 0 2px;
}
#pagination .page-link {
    border-radius: 6px;
    color: #495057;
    border: 1px solid #dee2e6;
}
#pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 2px 5px rgba(255,102,0,0.3);
}
#pagination .page-item.disabled .page-link {
    background-color: #f8f9fa;
    color: #adb5bd;
}

/* Facet Lists */
#filter-countries-list ul,
#filter-categories-list ul,
#filter-age-menu ul {
    padding-right: 0;
    margin-bottom: 0;
}

/* Grid hacks removed - relying on Bootstrap row/col */

/* Store Card Fixed Dimensions */
.store-card {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  height: 100%; /* Fill the flex column */
  min-height: 480px; /* Minimum height for consistency */
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 6px;
  margin: 0 auto;
}

/* Custom Scrollbar for Sidebar Wrapper */
#tsl-sidebar-scroll-wrapper {
    overflow-y: auto !important;
    height: 100%;
    scrollbar-width: thin;
    scrollbar-color: #adb5bd #f1f3f5;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f3f5;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: #adb5bd;
    border-radius: 10px;
    border: 2px solid #f1f3f5;
}

/* Ensure InstantSearch Lists look good */
.category-scroll-area ul {
    padding: 0;
    margin: 0;
    list-style: none;
}
.category-scroll-area li {
    margin-bottom: 8px;
}
.rms-offcanvas-body{
max-height: 95%;
overflow-y: scroll;
}