/* ---- Small utilities that must work even if the Tailwind bundle is purged ---- */

.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Listings cards grid (home/search) ---- */
.as-listings-grid {
  display: grid !important;
  gap: 12px !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

@media (max-width: 640px) {
  .as-listings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .as-listings-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

.as-card-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.as-card-chip {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10px;
  padding: 2px 8px;
}

.as-card-chip-right {
  left: auto;
  right: 8px;
}

.as-card-body {
  padding: 10px;
}

.as-card-title {
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.as-card-desc {
  margin-bottom: 8px;
  font-size: 0.75rem;
  line-height: 1.2rem;
  color: rgb(100 116 139);
}

.as-card-footer {
  padding-top: 8px;
}

.as-card-price {
  font-size: 0.875rem;
}

.as-card-btn {
  height: 28px;
  padding: 0 8px;
  font-size: 10px;
}

/* ---- Deal type select Safari fix ---- */
.as-deal-type-select {
  width: 100%;
  max-width: 100%;
  min-width: 200px;
  text-align: start;
}

html[dir="rtl"] .as-deal-type-select {
  direction: ltr;
  text-align: right;
}

/* ---- Category tree (home) ---- */
.as-cat-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  color: inherit;
}

.as-cat-row:hover {
  background: rgba(148, 163, 184, 0.12);
}

.as-cat-active {
  background: rgba(148, 163, 184, 0.2);
  font-weight: 600;
}

.as-cat-toggle,
.as-cat-toggle-spacer {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 6px;
}

.as-cat-toggle {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
}

.as-cat-toggle:hover {
  background: rgba(148, 163, 184, 0.2);
}

.as-cat-link {
  flex: 1;
  font-size: 0.9rem;
  text-decoration: none;
  color: inherit;
}

.as-cat-count {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  color: #64748b;
}

.as-cat-children {
  margin-left: 16px;
  padding-left: 4px;
}

/* ---- Mobile header/menu ---- */
.as-mobile-only {
  display: none;
}

.as-mobile-menu-btn {
  height: 36px;
  width: 42px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(241, 245, 249, 0.6);
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.as-mobile-menu-btn-bars {
  width: 18px;
  height: 14px;
  position: relative;
}

.as-mobile-menu-btn-bars span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.9;
}

.as-mobile-menu-btn-bars span:nth-child(1) {
  top: 0;
}
.as-mobile-menu-btn-bars span:nth-child(2) {
  top: 6px;
}
.as-mobile-menu-btn-bars span:nth-child(3) {
  top: 12px;
}

.as-mobile-menu {
  display: none;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}

.as-mobile-menu.is-open {
  display: block;
}

.as-mobile-menu a {
  display: block;
  padding: 12px 4px;
  font-weight: 600;
}

.as-mobile-menu .as-mobile-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

@media (max-width: 767px) and (orientation: portrait) {
  .as-mobile-only {
    display: inline-flex !important;
  }
}

/* ---- Telegram widget width guard (Bootstrap auth/profile cards) ---- */
.as-telegram-widget-wrap {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  padding-inline-end: 8px;
}

.as-telegram-widget-wrap iframe {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
}
