/* ================================================================
   ItemListing.css — Product grid, cards, filter sidebar
   All values use Momento design tokens from tokens.css
   ================================================================ */

/* ── List header ────────────────────────────────────────────── */
.itemlist-container {
  display: flex;
  padding: var(--space-2) var(--space-2) var(--space-2) 0;
  justify-content: space-between;
  align-items: center;
  align-self: stretch;
}

.itemlist-header {
  color: var(--color-text-primary);
  font-family: var(--font-heading);
  font-size: var(--text-heading-md-size);
  font-weight: var(--fw-xbold);
  line-height: var(--text-heading-md-lh);
  letter-spacing: -0.12px;
}

/* ── Sort chip ──────────────────────────────────────────────── */
.itemlist-sort-container {
  display: flex;
  padding: 4px var(--space-2);
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-1);
  border-radius: var(--radius-sm);
  background: var(--color-surface-info-bg);
}

.itemlist-sort-label {
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--text-xs-size);
  font-weight: var(--fw-normal);
}

/* ── Item card container ────────────────────────────────────── */
.itemlist-item-container {
  flex-shrink: 0;
  border-radius: var(--radius-lg);
  background: var(--color-surface-subtle);
  width: 100%;
  max-width: none;
  height: auto;
  box-sizing: border-box;
  justify-content: flex-start;
  display: flex;
  flex-direction: column;
}

/* ── Badge colours (single source of truth) ─────────────────── */
.cls_badge_hot {
  background-color: var(--color-brand-accent);
  color: var(--color-surface-default);
}

.cls_badge_clearance {
  background-color: var(--color-warning);
  color: var(--color-text-primary);
}

/* ── Item description area ──────────────────────────────────── */
.itemlist-desc-container {
  display: flex;
  padding: var(--space-2);
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  align-self: stretch;
}

.itemlist-item-label {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  align-self: stretch;
  overflow: hidden;
  color: var(--color-text-secondary);
  text-overflow: ellipsis;
  text-align: start;
  text-transform: none;
}

.itemlist-item-amount-container {
  display: flex;
  align-items: center;
  gap: 4px;
  align-self: stretch;
}

/* ── Inline badge bubbles ───────────────────────────────────── */
.itemlist-item-hot-container {
  display: flex;
  padding: 4px var(--space-1);
  justify-content: center;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-lg);
  background: var(--color-brand-accent);
}

.itemlist-item-clearance-container {
  display: flex;
  padding: 4px var(--space-1);
  justify-content: center;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-lg);
  background: var(--color-warning);
}

.itemlist-item-hot-label {
  color: var(--color-surface-default);
  font-family: var(--font-body);
  font-size: var(--text-xs-size);
  font-weight: var(--fw-bold);
  line-height: var(--text-xs-lh);
  letter-spacing: 0.2px;
}

.itemlist-item-clearance-label {
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--text-xs-size);
  font-weight: var(--fw-bold);
  line-height: var(--text-xs-lh);
  letter-spacing: 0.2px;
}

.itemlist-item-amount-label {
  color: var(--color-text-secondary);
  font-family: var(--font-body);
}

/* ── Heart / favourite button ───────────────────────────────── */
.itemlist-heart-icon {
  position: absolute;
  top: var(--space-1);
  right: var(--space-1);
  display: flex;
  width: 32px;
  height: 32px;
  padding: var(--space-1);
  justify-content: center;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--color-surface-default);
  color: var(--color-text-primary);
  text-align: center;
  font-size: 24px;
  font-weight: 300;
  line-height: normal;
}

.itemlist-favourite-icon-filled {
  color: var(--color-brand-accent);
  font-size: 24px;
  font-weight: 900;
  line-height: normal;
  position: absolute;
  top: var(--space-1);
  right: var(--space-1);
  display: flex;
  width: 32px;
  height: 32px;
  padding: var(--space-1);
  justify-content: center;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--color-surface-default);
}

.itemlist-favourite-icon-filled:hover,
.itemlist-heart-icon:hover {
  cursor: pointer;
  background: var(--color-surface-default);
}

/* ── Product grid / layout ──────────────────────────────────── */
.itemlisting-layout {
  display: flex;
  flex-direction: row;
  gap: var(--space-3);
  align-items: flex-start;
}

.itemlisting-grid-section {
  flex: 1;
  min-width: 0;
}

.filter-sidebar-desktop {
  overflow-y: auto;
  max-height: calc(100vh - 32px);
}

.items-product-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
  .items-product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
  .items-product-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1024px) {
  .items-product-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-2);
  }
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar-accordion-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 44px;
  padding: 12px 0;
  background: none;
  border: none;
  cursor: pointer;
  outline: none;
}

.sidebar-section-title {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: var(--fw-bold);
  color: var(--color-text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.sidebar-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 4px 0;
}

.sidebar-input-label {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: var(--fw-bold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.sidebar-price-input-wrapper {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-1);
  height: 36px;
  background: var(--color-surface-default);
}

.sidebar-currency {
  color: var(--color-text-muted);
  font-size: var(--text-label-md-size);
  margin-right: 2px;
  flex-shrink: 0;
}

.sidebar-price-input {
  border: none;
  outline: none;
  font-size: var(--text-label-md-size);
  width: 100%;
  background: transparent;
  -moz-appearance: textfield;
}

.sidebar-price-input::-webkit-inner-spin-button,
.sidebar-price-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.sidebar-category-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--color-brand-primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Dual range slider ──────────────────────────────────────── */
.dual-range-wrapper {
  position: relative;
  height: 32px;
}

.dual-range-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 6px;
  border-radius: 3px;
  background: var(--color-border);
  transform: translateY(-50%);
  pointer-events: none;
}

.dual-range-fill {
  position: absolute;
  top: 0;
  height: 100%;
  background: var(--color-brand-primary);
  border-radius: 3px;
}

.dual-range-input {
  position: absolute;
  width: 100%;
  top: 4px;
  height: 24px;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  outline: none;
  margin: 0;
}

.dual-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;          /* was 22px — fixed to 8px grid */
  height: 24px;
  border-radius: 50%;
  background: var(--color-surface-default);
  border: 2px solid var(--color-brand-primary);
  cursor: grab;
  pointer-events: all;
  box-shadow: var(--elevation-sm);
}

.dual-range-input::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-surface-default);
  border: 2px solid var(--color-brand-primary);
  cursor: grab;
  pointer-events: all;
  box-shadow: var(--elevation-sm);
}

/* ── Sidebar / filter visibility ────────────────────────────── */
@media (min-width: 1280px) {
  #sort-filter-trigger { display: none !important; }
}
@media (min-width: 1024px) {
  .sort-filter-btn-wrapper { display: none !important; }
}
@media (max-width: 1023px) {
  .filter-sidebar-desktop { display: none !important; }
}

/* ── Product card ───────────────────────────────────────────── */
.product-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface-default);
  transition: box-shadow 0.15s ease;
}

.product-card-image-wrapper {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--color-surface-subtle);
  overflow: hidden;
  border-radius: var(--radius-md);
}

.product-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Card tags */
.product-card-tag {
  position: absolute;
  top: var(--space-1);
  left: var(--space-1);
  padding: 2px var(--space-1);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-xs-size);
  font-weight: var(--fw-bold);
  line-height: var(--text-xs-lh);
  letter-spacing: 0.2px;
  z-index: 1;
  pointer-events: none;
}

.product-card-tag.cls_badge_hot {
  background: var(--color-brand-accent);
  color: var(--color-surface-default);
}

.product-card-tag.cls_badge_clearance {
  background: var(--color-warning);
  color: var(--color-text-primary);
}

/* Heart button */
.product-card-heart-btn {
  position: absolute;
  top: var(--space-1);
  right: var(--space-1);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-surface-default);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
  box-shadow: var(--elevation-sm);
  padding: 0;
}

.product-card-heart-btn:hover {
  background: var(--color-surface-subtle);
}

/* Card info */
.product-card-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);         /* was 4px — kept as design allows half-unit for tight cards */
  padding: var(--space-1) 4px 4px 4px;
}

.product-card-name {
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  font-weight: var(--fw-normal);
  color: var(--color-text-primary);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  margin: 0;
}

.product-card-price-row {
  display: flex;
  align-items: center;
  gap: var(--space-1);         /* was 6px — fixed to 8px grid */
}

/* Price uses Inter (heading-level numerics) */
.product-card-price {
  font-family: var(--font-heading);
  font-size: var(--text-heading-xsm-size);
  font-weight: var(--fw-bold);
  color: var(--color-text-primary);
  line-height: 1.2;
}

.product-card-original-price {
  font-family: var(--font-heading);
  font-size: var(--text-heading-xsm-size);
  font-weight: var(--fw-normal);
  color: var(--color-text-disabled);
  text-decoration: line-through;
  line-height: 1.2;
}

.product-card-auth {
  display: flex;
  align-items: center;
  gap: 4px;
}

.product-card-auth-text {
  font-family: var(--font-body);
  font-size: var(--text-xs-size);
  font-weight: var(--fw-bold);
  color: var(--color-success);
  line-height: 1.3;
}

.product-card-store {
  display: flex;
  align-items: center;
  gap: 4px;
}

.product-card-store-text {
  font-family: var(--font-body);
  font-size: var(--text-xs-size);
  font-weight: var(--fw-bold);
  color: var(--color-text-muted);
  line-height: 1.3;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
