/* Shop home ("/"), styled like the app's shop screens (Roz/lib/features/shop_home). */
.shop-home {
  --shop-primary: #1E88E5;
  --shop-primary-dark: #1565C0;
  --shop-secondary: #42A5F5;
  --shop-soft: #E3F2FD;
  --shop-bg: #F3F8FE;
  --shop-card: #FFFFFF;
  --shop-border: #E2E8F0;
  --shop-text: #0F172A;
  --shop-muted: #475569;
  --shop-sale: #E53935;
  --shop-success: #198754;
  --shop-radius: 16px;
  --shop-radius-btn: 12px;
  --shop-shadow: 0 4px 18px rgba(21, 101, 192, 0.08);
  background: var(--shop-bg);
  color: var(--shop-text);
  padding: 24px 0 48px;
  min-height: 60vh;
}

[dir="rtl"] .shop-home,
[dir="rtl"] .shop-home input,
[dir="rtl"] .shop-home select,
[dir="rtl"] .shop-home button {
  font-family: 'Vazirmatn', system-ui, sans-serif;
}

.shop-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Buttons */
.shop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--shop-radius-btn);
  padding: 10px 20px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.shop-btn--primary { background: var(--shop-primary); color: #fff; }
.shop-btn--primary:hover { background: var(--shop-primary-dark); color: #fff; }
.shop-btn--ghost { background: var(--shop-card); color: var(--shop-primary-dark); border: 1px solid var(--shop-border); }
.shop-btn--ghost:hover { background: var(--shop-soft); }
.shop-btn--light { background: #fff; color: var(--shop-primary-dark); }

/* Banners */
.shop-banners .carousel,
.shop-banner {
  border-radius: 20px;
  overflow: hidden;
}
.shop-banner {
  position: relative;
  display: block;
  height: 340px;
  background: #1E88E5;
  color: #fff;
  text-decoration: none;
}
.shop-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* An admin banner is the finished design (text inside, 2:1): the whole picture at every width, nothing on top. */
.shop-banner.shop-banner--image {
  height: auto;
  aspect-ratio: 2 / 1;
  background: var(--shop-soft);
}
.shop-banner--image img { object-fit: contain; }
/* The carousel is a 2:1 box of its own, so its space is reserved before any picture (or Bootstrap's CSS) has
   arrived and nothing jumps; the picture fills it. Until the CSS of Bootstrap is here only the active slide shows. */
.shop-banners .carousel { aspect-ratio: 2 / 1; background: var(--shop-soft); }
.shop-banners .carousel-item:not(.active):not(.carousel-item-next):not(.carousel-item-prev) { display: none; }
.shop-banner__text {
  position: relative;
  z-index: 1;
  height: 100%;
  max-width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  padding: 32px 40px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.55), rgba(15, 23, 42, 0));
}
[dir="rtl"] .shop-banner__text { background: linear-gradient(270deg, rgba(15, 23, 42, 0.55), rgba(15, 23, 42, 0)); }
.shop-banner--default .shop-banner__text { background: none; }
.shop-banner__text h1,
.shop-banner__text h2 { color: #fff; font-size: 2rem; font-weight: 800; margin: 0; }
.shop-banner__text p { color: rgba(255, 255, 255, 0.9); font-size: 1.05rem; margin: 0; }
.shop-banners .carousel-indicators [data-bs-target] { width: 10px; height: 10px; border-radius: 50%; }
/* A click, double click or drag selected the picture and the browser painted it blue (selection); a phone's tap
   and long press did the same. Nothing in the banners can be selected or dragged; keyboard focus still shows. */
.shop-banners {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
.shop-banners img { -webkit-user-drag: none; user-drag: none; }
.shop-banners .shop-banner:focus:not(:focus-visible) { outline: none; }
/* «‹» «›» (937): round, half-clear white, brand blue, 44 px to tap; over Bootstrap's full-height 15 % strips. */
.shop-banners .shop-banner-arrow {
  top: 50%;
  bottom: auto;
  width: 44px;
  height: 44px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  color: var(--shop-primary);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  opacity: 1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
  transition: background 0.15s;
}
.shop-banners .shop-banner-arrow span { margin-top: -4px; }
.shop-banners .shop-banner-arrow.carousel-control-prev { inset-inline-start: 12px; }
.shop-banners .shop-banner-arrow.carousel-control-next { inset-inline-end: 12px; }
.shop-banners .shop-banner-arrow:hover,
.shop-banners .shop-banner-arrow:focus { background: rgba(255, 255, 255, 0.95); color: var(--shop-primary-dark); opacity: 1; }
.shop-banners .shop-banner-arrow:focus:not(:focus-visible) { outline: none; }
.shop-banners .shop-banner-arrow:focus-visible { outline: 2px solid var(--shop-primary); outline-offset: 2px; }
@media (max-width: 640px) {
  .shop-banners .shop-banner-arrow.carousel-control-prev { inset-inline-start: 8px; }
  .shop-banners .shop-banner-arrow.carousel-control-next { inset-inline-end: 8px; }
}

/* Filter bar: the app's two rows of tiles on the page background (shop_filter_bar.dart); no box around them.
   Row 1: category · sort · discount. Row 2: min price · max price · reset square. A pick submits the form (shop-home.js). */
.shop-filters { display: flex; flex-direction: column; gap: 10px; }
.shop-filters__row { display: flex; gap: 10px; align-items: stretch; }
.shop-tile {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 56px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: var(--shop-card);
  border: 1px solid #E1EAF5;
  border-radius: 12px;
  cursor: pointer;
}
.shop-tile.is-active { background: var(--shop-soft); border-color: var(--shop-primary); }
.shop-tile__icon { flex: none; color: var(--shop-muted); font-size: 0.95rem; }
.shop-tile.is-active .shop-tile__icon { color: var(--shop-primary); }
.shop-tile__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.shop-tile__text strong { font-size: 12px; font-weight: 700; color: var(--shop-text); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-tile__text small { font-size: 11px; color: var(--shop-muted); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-tile__chevron { flex: none; color: var(--shop-muted); font-size: 0.7rem; }
/* The real <select> covers the tile (invisible), so a tap opens the phone's own picker. */
.shop-tile__control { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.shop-tile__input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 11px;
  line-height: 1.2;
  color: var(--shop-muted);
  -moz-appearance: textfield;
}
.shop-tile__input::-webkit-outer-spin-button,
.shop-tile__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.shop-tile:focus-within { border-color: var(--shop-primary); }
.shop-reset {
  flex: none;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #E1EAF5;
  border-radius: 12px;
  background: var(--shop-card);
  color: #94A3B8;
  text-decoration: none;
}
.shop-reset.is-on { background: var(--shop-soft); border-color: var(--shop-primary); color: var(--shop-primary); }
.shop-filters__apply { align-self: flex-start; }

/* Search */
.shop-search {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--shop-card);
  border: 1px solid var(--shop-border);
  border-radius: var(--shop-radius);
  padding: 8px 8px 8px 18px;
  box-shadow: var(--shop-shadow);
}
[dir="rtl"] .shop-search { padding: 8px 18px 8px 8px; }
.shop-search > i { color: var(--shop-muted); }
.shop-search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 1rem; color: var(--shop-text); min-width: 0; }

/* Categories */
.shop-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 14px;
}
.shop-category {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 0 14px;
  overflow: hidden;
  background: var(--shop-card);
  border: 1px solid var(--shop-border);
  border-radius: var(--shop-radius);
  text-decoration: none;
  color: var(--shop-text);
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.shop-category:hover,
.shop-category.is-active { border-color: var(--shop-primary); box-shadow: var(--shop-shadow); color: var(--shop-text); }
.shop-category__image {
  /* The picture fills the card's full width, whole (contain) on white, rounded at the top. */
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--shop-radius) var(--shop-radius) 0 0;
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--shop-primary);
  font-size: 2.6rem;
}
/* Sample v3.1: the whole picture in a rounded square, never a circle crop. */
.shop-category__image img { width: 100%; height: 100%; object-fit: contain; }
.shop-category__name { font-weight: 700; font-size: 0.95rem; padding: 0 10px; }
.shop-category__count { font-size: 0.8rem; color: var(--shop-muted); padding: 0 10px; }

/* Section headers */
.shop-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.shop-section-header h2 { font-size: 1.35rem; font-weight: 800; margin: 0; color: var(--shop-text); }
.shop-section-header h2 i { color: var(--shop-primary); }
.shop-section-header p { margin: 4px 0 0; color: var(--shop-muted); }
.shop-view-all { font-weight: 700; color: var(--shop-primary); text-decoration: none; white-space: nowrap; }
.shop-view-all:hover { color: var(--shop-primary-dark); }

/* Discounted products strip: the app's light-blue panel with an endless self-moving row (shop-home.js). */
.shop-deals {
  background: #E8F2FD;
  border-radius: 20px;
  padding: 20px;
}
.shop-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 220px;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.shop-strip::-webkit-scrollbar { display: none; }

/* Products grid: plain cards on the page background, no box around the grid. */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

/* Product card, like the app's ShopProductCard. */
.shop-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: var(--shop-card);
  border: 1px solid var(--shop-border);
  border-radius: var(--shop-radius);
  box-shadow: var(--shop-shadow);
  min-width: 0;
}
.shop-card__photo { position: relative; }
.shop-card__media {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  /* Pure white, with a thin line so a white picture does not melt into the white card. */
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
}
.shop-card__media.is-out::after { content: ''; position: absolute; inset: 0; background: rgba(255, 255, 255, 0.45); }
.shop-card__media img { width: 100%; height: 100%; object-fit: contain; }
.shop-card__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--shop-muted);
  font-size: 2.2rem;
}
.shop-badge {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  padding: 3px 7px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
}
.shop-badge--sale { background: var(--shop-sale); }
.shop-badge--new { background: var(--shop-success); }
.shop-badge--sample { background: #1565C0; }
.shop-card__heart {
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--shop-primary-dark);
  font-size: 1.1rem;
}
.shop-card__heart.is-on { color: var(--shop-sale); }
.shop-stock {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid var(--stock, #1FA463);
  background: #fff;
  color: var(--stock, #1FA463);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}
.shop-stock::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.shop-stock.is-in { --stock: #1FA463; }
.shop-stock.is-low { --stock: #E08A00; }
.shop-stock.is-out { --stock: #E5484D; }
.shop-stock.is-sample { --stock: #1565C0; }
.shop-card__name {
  margin-top: 4px;
  color: var(--shop-text);
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-card__name:hover { color: var(--shop-primary-dark); }
.shop-card__stars { display: flex; justify-content: center; align-items: center; gap: 1px; font-size: 13px; color: var(--shop-border); }
.shop-card__stars .is-rated { color: #FFB400; }
.shop-card__stars span { margin-inline-start: 4px; font-size: 11.5px; font-weight: 800; color: var(--shop-text); }
[dir="rtl"] .shop-card__stars .fa-star-half-stroke { transform: scaleX(-1); }
.shop-card__original-row { min-height: 18px; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.shop-card__original { color: var(--shop-muted); text-decoration: line-through; font-size: 11px; }
.shop-card__clock { display: inline-flex; align-items: center; gap: 2px; color: var(--shop-sale); font-size: 11px; font-weight: 800; }
.shop-card__price { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.shop-card__current { min-width: 0; color: var(--shop-primary-dark); font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The round cart button is blue like the app's (790); red is only the discount badge and the sale clock. */
.shop-card__cart {
  flex: none;
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--shop-primary);
  color: #fff;
  font-size: 0.8rem;
}
.shop-card__cart:disabled { background: var(--shop-border); cursor: not-allowed; }

/* Empty state and pages */
.shop-empty {
  text-align: center;
  padding: 48px 16px;
  background: var(--shop-card);
  border: 1px dashed var(--shop-border);
  border-radius: var(--shop-radius);
  color: var(--shop-muted);
}
.shop-empty i { font-size: 2.4rem; color: #CBD5E1; margin-bottom: 10px; }
.shop-empty h3 { font-size: 1.1rem; font-weight: 800; color: var(--shop-text); }
.shop-pages { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.shop-pages a {
  min-width: 40px;
  padding: 8px 12px;
  border-radius: var(--shop-radius-btn);
  background: var(--shop-card);
  border: 1px solid var(--shop-border);
  color: var(--shop-text);
  text-align: center;
  text-decoration: none;
  font-weight: 700;
}
.shop-pages a.is-current { background: var(--shop-primary); border-color: var(--shop-primary); color: #fff; }

/* Toast */
.shop-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--shop-text);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--shop-radius-btn);
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 2000;
}
.shop-toast.is-visible { opacity: 1; }

/* Products results page */
.shop-results__header { margin-bottom: 0; }
.shop-results__header h1 { font-size: 1.6rem; font-weight: 800; margin: 0; color: var(--shop-text); }
.shop-results__count { color: var(--shop-muted); font-weight: 600; margin: 0 0 12px; }

/* Smaller windows */
/* Wide screens: the two rows become one row of five tiles and the reset square. */
@media (min-width: 900px) {
  .shop-filters { flex-direction: row; align-items: stretch; }
  .shop-filters__row:first-of-type { flex: 3 1 0; }
  .shop-filters__row:nth-of-type(2) { flex: 2 1 0; }
}
@media (max-width: 480px) {
  .shop-tile { gap: 6px; padding: 0 8px; }
  .shop-tile__chevron { display: none; }
}
@media (max-width: 640px) {
  .shop-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-banner { height: 220px; }
  .shop-banner.shop-banner--image { height: auto; }
  .shop-banner__text { max-width: 100%; padding: 20px; }
  .shop-banner__text h1,
  .shop-banner__text h2 { font-size: 1.35rem; }
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .shop-strip { grid-auto-columns: 150px; }
  .shop-deals { padding: 14px; }
  .shop-search .shop-btn { padding: 10px 14px; }
}
