/* Footer link color: use primary color by default for stronger visual match */
.bg-footer .list-unstyled a {
  color: var(--primary-color);
  text-decoration: none;
  display: inline-block;
}
.bg-footer .list-unstyled a:hover {
  color: #7a1d1f !important;
  font-weight: 600 !important;
  transition: color 0.2s ease;
}

/* Make footer columns center on small screens to match the screenshot */
@media (max-width: 576px) {
  .bg-footer .col-lg-2,
  .bg-footer .col-lg-3 {
    text-align: center !important;
  }
  .bg-footer .col-lg-2 .list-unstyled,
  .bg-footer .col-lg-3 .list-unstyled {
    display: inline-block !important;
    text-align: right !important; /* keep items stacked left-to-right inside the small block */
  }
}
/* Custom CSS Variables */
:root {
  --primary-color: #942326;
  --secondary-color: #1b2953;
  --light-bg: #fafafa;
  --border-color: #e0e0e0;
  --text-muted: #6d6969;
}

/* Base Styles */
body {
  font-family: 'Cairo', sans-serif;
  line-height: 1.6;
  color: #333;
}

/* Header Styles */
.logo-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
}

.search-container {
  max-width: 560px;
}

.search-input {
  padding-right: 50px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background-color: rgba(79, 75, 80, 0.1);
}

.search-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.categories-bar {
  background-color: var(--primary-color) !important;
}

.category-link {
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.category-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white !important;
}

/* Active top category link */
.categories-bar .category-link.active {
  background-color: rgba(255,255,255,0.15);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Hero Section */
.hero-section {
  background-image: url('../img/rectangle-11.png');
  background-size: cover;
  background-position: center;
  min-height: 500px;
  display: flex;
  align-items: center;
  position: relative;
}



.hero-overlay {
  background-color: rgba(30, 30, 30, 0.5);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 900;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 1.8px;
  margin-bottom: 2rem;
}

/* Product Cards */
.product-card {
  background: var(--light-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.product-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(233, 226, 218, 0.9);
  color: var(--colorsbrown, #a2845e);
  padding: 5px 15px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(50px);
}

.product-info {
  padding: 1rem;
}

.rating {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  color: #e27c6d;
}

.product-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: #212225;
  margin: 0;
}

.product-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0.5rem 0;
}

.location {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.seller-info {
  margin-top: 1rem;
}

.seller-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
}

.seller-name {
  font-size: 0.9rem;
  color: #212225;
}

/* Section Headers */
.section-header h2 {
  font-size: 1.5rem;
  color: var(--primary-color);
  font-weight: 700;
}

/* Filters Sidebar */
.filters-sidebar {
  background-color: rgba(251, 251, 251, 0.4) !important;
  border: 1px solid var(--border-color);
  position: sticky;
  top: 20px;
}

.category-item {
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  cursor: pointer;
}

.category-item:hover {
  background-color: var(--primary-color) !important;
  color: white;
}

.category-icon {
  width: 30px;
  height: 30px;
  object-fit: cover;
}

.price-range .form-range {
  accent-color: var(--primary-color);
}

/* Custom styled range input to match the design */
.price-range {
  --range-fill: var(--primary-color);
  --range-track: #e9e9e9;
  --range-thumb: var(--primary-color);
}

.price-range input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 14px;
  background: linear-gradient(90deg, var(--range-fill) 0%, var(--range-fill) var(--range-percent, 25%), var(--range-track) var(--range-percent, 25%), var(--range-track) 100%);
  border-radius: 999px;
  outline: none;
  padding: 0;
}

.price-range input[type="range"]::-webkit-slider-runnable-track {
  height: 14px;
  background: transparent;
}

.price-range input[type="range"]::-moz-range-track {
  height: 14px;
  background: transparent;
}

.price-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--range-thumb);
  border: 4px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  margin-top: -7px; /* center the thumb vertically on the track */
}

.price-range input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--range-thumb);
  border: 4px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Firefox extra: remove the focus outline around the thumb */
.price-range input[type="range"]::-moz-focus-outer { border: 0; }

/* Small screens: slightly smaller thumb */
@media (max-width: 576px) {
  .price-range input[type="range"]::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -4px; }
  .price-range input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; }
}

.price-range .range-value {
  font-size: 0.9rem;
  color: #6b6b6b;
  direction: ltr; /* ensure digits are displayed left-to-right */
  unicode-bidi: isolate;
}

.social-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-logo {
  max-width: 145px;
  height: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.5rem;
  }

  .search-container {
    margin: 1rem 0;
  }

  .categories-bar .d-flex {
    justify-content: flex-start !important;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 10px;
  }

  .category-link {
    flex-shrink: 0;
  }

  .filters-sidebar {
    margin-top: 2rem;
    position: static;
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1.2rem;
  }

  .product-card {
    margin-bottom: 1rem;
  }

  .seller-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* Custom Bootstrap Overrides */
.btn-danger {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-danger:hover {
  background-color: #7a1d1f;
  border-color: #7a1d1f;
}

.btn-outline-danger {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-danger:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.text-danger {
  color: var(--primary-color) !important;
}

.text-primary {
  color: var(--secondary-color) !important;
}

/* Form Controls */
.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(148, 35, 38, 0.25);
}

.form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Dropdown Customization */
.dropdown-toggle::after {
  margin-right: 0.5rem;
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Product card animations */
.product-card {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.3s ease;
}

.product-card.fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* Search results notification */
.search-results-notification {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Active filter states */
.category-item.active {
  background-color: var(--primary-color) !important;
  color: white !important;
  transform: scale(1.05);
}

/* Loading states */
.btn.loading {
  position: relative;
  color: transparent !important;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Modal customizations */
.modal-content {
  border-radius: 15px;
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
  background-color: var(--light-bg);
}

/* Toast notifications */
.toast-container {
  z-index: 1060;
}

.toast {
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Price display */
.product-price {
  font-size: 1.1rem;
  font-weight: 700;
}

/* Hover effects for interactive elements */
.category-link:hover,
.dropdown-item:hover,
.nav-link:hover {
  transform: translateX(-2px);
  transition: transform 0.2s ease;
}

/* Mobile search styles */
.mobile-search {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

/* Custom select (JS-driven) */
.custom-select-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  font-size: 0.95rem;
}

.custom-select-button {
  background: #fff;
  border: 1px solid var(--primary-color);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  text-align: right; /* RTL */
  gap: 0.5rem;
}

.custom-select-button:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(148,35,38,0.15);
}

.custom-select-caret { color: var(--primary-color); }

.custom-select-list {
  position: absolute;
  right: 0; /* align to right for RTL */
  left: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--border-color);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  border-radius: 8px;
  max-height: 260px;
  overflow: auto;
  z-index: 1050;
  display: none;
}

.custom-select-wrapper.open .custom-select-list { display: block; }

.custom-select-item {
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}

.custom-select-item:hover { background: var(--primary-color); color: #fff; }
.custom-select-item.active { background: var(--primary-color); color: #fff; }
.custom-select-item.disabled { opacity: 0.6; cursor: not-allowed; }

/* Ensure native select remains accessible but visually hidden when replaced */
.custom-select-wrapper > select.form-select { position: absolute; inset: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Skeleton loading for products */
.product-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Improved focus states for accessibility */
.btn:focus-visible,
.form-control:focus-visible,
.dropdown-toggle:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
  box-shadow: 0 0 0 0.2rem rgba(148, 35, 38, 0.25);
}

/* Smooth transitions for all interactive elements */
* {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #7a1d1f;
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Accessibility Improvements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus States */
.btn:focus,
.form-control:focus,
.dropdown-toggle:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .navbar,
  .hero-section,
  .filters-sidebar,
  footer {
    display: none !important;
  }

  .product-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
.whatsapp-image {
  /* Decorative footer cover: constrain to footer height so it doesn't add extra page space */
  position: absolute;
  left: 50%;
  bottom: 0; /* anchor to footer bottom */
  top: auto;
  transform: translateX(-50%);
  height: 100%;        /* match footer height */
  max-height: 100%;
  width: auto;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0; /* behind footer content */
  object-fit: contain;
}

/* Ensure footer content sits above the decorative image and clip overflow */
footer { position: relative; z-index: 1; overflow: hidden; }

@media (max-width: 992px) {
  .whatsapp-image { opacity: 0.10; }
}

@media (max-width: 576px) {
  .whatsapp-image { opacity: 0.08; }
}

.bg-footer{
  --bs-bg-opacity: 1;
  background-color: #fdfbf6 !important;
}
.form-select:focus{
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 0.2rem rgba(148, 35, 38, 0.25) !important;
}

/* Make all selects use primary color for borders, focus and selected option */
.form-select {
  border-color: var(--primary-color);
  color: #222;
  background-image: linear-gradient(45deg, transparent 50%, var(--primary-color) 50%), linear-gradient(135deg, var(--primary-color) 50%, transparent 50%);
  background-position: calc(100% - 1.25rem) calc(1rem + 2px), calc(100% - .75rem) calc(1rem + 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(148,35,38,0.15);
}

/* Selected option background - not all browsers allow styling option, but we'll try */
select.form-select option:checked,
select.form-select option[selected] {
  background-color: var(--primary-color);
  color: #fff;
}

/* For non-native custom selects (Bootstrap), style the dropdown menu items when active */
.dropdown-menu .active,
.dropdown-menu a.active,
.dropdown-menu a:active {
  background-color: var(--primary-color);
  color: #fff;
}

/* Adjust caret placement for RTL so it appears on the left visually while keeping logical position */
.form-select {
  background-position-x: 1.25rem; /* caret on the left for RTL layouts */
}
