* {
  text-decoration: none !important;
}

:root {
  --primary: #0d9488;
  --accent: #ff5333;
  --success: #66b766;
  --ink: #0c0f14;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #fff;
  --bg-muted: #f6f7f9;
  --shadow-1: 0 8px 24px rgba(2, 6, 23, 0.06);
  --shadow-2: 0 12px 32px rgba(2, 6, 23, 0.08);
  --radius: 16px;
}
.shops-page {
  direction: rtl;
  background: radial-gradient(
      1200px 400px at 100% -100px,
      #e7fbff 0%,
      transparent 60%
    ),
    var(--bg-muted);
}
.container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 16px;
}

/* === Hero / Controls (more visual) === */
.shops-hero {
  position: relative;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.shops-hero::before {
  content: "";
  position: absolute;
  inset: auto -40px -60px auto;
  width: 380px;
  height: 380px;
  background: radial-gradient(
    closest-side,
    rgba(13, 148, 136, 0.18),
    transparent 70%
  );
  filter: blur(6px);
  pointer-events: none;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
}
@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
}
.title {
  margin: 0;
  padding: 22px 0 8px;
  font-size: 28px;
  font-weight: 900;
  color: #0c0f14;
}
.subtitle {
  margin: 0 0 18px;
  color: #4b5563;
}
.controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 0 18px;
}
.ctrl {
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 0 12px;
  box-shadow: var(--shadow-1);
}
.search {
  flex: 1;
  min-width: 220px;
}
.sort {
  width: 220px;
}
.view {
  display: flex;
  gap: 8px;
}
.toggle {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
}

/* === Grid (auto-fit) === */
.section {
  padding: 24px 0;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

/* === Card (visual boost) === */
.shop-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  border: 1px solid transparent;
  box-shadow: var(--shadow-1);
  background: linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, rgba(13, 148, 136, 0.45), rgba(255, 83, 51, 0.4))
      border-box;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.shop-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
}
.shop-banner {
  position: relative;
  aspect-ratio: 16/6;
  background: #cfe9ee;
}
.shop-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s ease;
}
.shop-card:hover .shop-banner img {
  transform: scale(1.06);
}
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(45deg, var(--primary), #14b8a6);
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: var(--shadow-2);
}

.shop-meta {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.shop-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #0c0f14;
  background: linear-gradient(135deg, #f7fafc, #eef2f7);
  border: 1px solid var(--border);
}
.shop-title {
  font-weight: 900;
}
.slug {
  color: #6b7280;
  font-size: 12px;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.thumbs img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background-image: linear-gradient(
    90deg,
    #f0f3f6 0%,
    #fafcff 50%,
    #f0f3f6 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  border-radius: 12px;
  padding: 0 12px;
  font-weight: 800;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-outline {
  background: #fff;
  border: 1px solid var(--border);
  color: #111;
}

/* Equal-size, themed action buttons inside cards */
.shop-card .card-actions .btn {
  flex: 1;
  height: 44px; /* match control height */
  padding: 0 14px;
  border: 1px solid transparent;
  box-shadow: var(--shadow-1);
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease,
    transform 0.2s ease;
}
.shop-card .card-actions .btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
}
.shop-card .card-actions .btn:active {
  transform: translateY(0) scale(0.99);
  box-shadow: var(--shadow-1);
}
.shop-card .card-actions .btn:focus-visible {
  outline: 2px solid rgba(13, 148, 136, 0.22);
  outline-offset: 2px;
}
.shop-card .card-actions .btn-primary {
  background: linear-gradient(135deg, var(--primary), #0b7f75);
  color: #fff;
  border: 1px solid var(--primary);
}
.shop-card .card-actions .btn-primary:hover {
  background: linear-gradient(135deg, #0b7f75, var(--primary));
}
.shop-card .card-actions .btn-outline {
  background: linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, rgba(13, 148, 136, 0.18), rgba(13, 148, 136, 0))
      border-box;
  border: 1px solid transparent;
  color: var(--primary);
}
.shop-card .card-actions .btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

/* RTL-friendly hint icons */
.shop-card .card-actions .btn-primary::after {
  content: "↗";
  font-size: 14px;
  line-height: 1;
  margin-inline-start: 6px;
}
.shop-card .card-actions .btn-outline::after {
  content: "↺";
  font-size: 14px;
  line-height: 1;
  margin-inline-start: 6px;
}

.empty {
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  color: #6b7280;
}

/* Floating pill */
.helper {
  position: sticky;
  bottom: 14px;
  z-index: 10;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow-2);
  font-weight: 800;
}

/* ===================== Responsive Adjustments ===================== */
/* Tablets and down */
@media (max-width: 860px) {
  .title {
    font-size: 24px;
    padding: 18px 0 6px;
  }
  .section {
    padding: 20px 0;
  }
  .grid {
    gap: 14px;
  }
}

/* Small tablets / large phones */
@media (max-width: 640px) {
  /* Allow native select dropdown to escape hero on mobile */
  .shops-hero {
    overflow: visible;
  }
  .container {
    padding-inline: 12px;
  }
  .controls {
    position: relative;
    z-index: 100; /* ensure form controls overlay header/subnav */
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .sort {
    position: relative;
    z-index: 101;
    background-color: #fff;
  }
  .ctrl,
  .search,
  .sort {
    width: 100%;
    min-width: 0; /* allow shrinking */
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
  }
  .thumbs {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .shop-banner {
    aspect-ratio: 16/8;
  }
}

/* Phones */
@media (max-width: 480px) {
  .title {
    font-size: 22px;
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
  }
  .shop-meta {
    padding: 12px;
    gap: 8px;
  }
  .head {
    gap: 8px;
  }
  .shop-avatar {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }
  .slug {
    font-size: 11px;
  }
  .thumbs {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .card-actions {
    flex-direction: column;
    gap: 8px;
  }
  .shop-card .card-actions .btn {
    height: 48px; /* better tap target */
  }
  .shop-banner {
    aspect-ratio: 16/9;
  }
}

/* Very small devices */
@media (max-width: 360px) {
  .container {
    padding-inline: 10px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
}

/* Hover/motion fallbacks for mobile */
@media (hover: none) {
  .shop-card:hover {
    transform: none;
    box-shadow: var(--shadow-1);
  }
  .shop-card .card-actions .btn:hover {
    transform: none;
    box-shadow: var(--shadow-1);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Safe-area support (iOS notch) */
@supports (padding: max(0px)) {
  .container {
    padding-inline: max(12px, env(safe-area-inset-right));
  }
}
