/* ==============================================
   HEMLINE MARKET - BROWSE PAGE ENHANCEMENTS
   Skeleton Loaders + Applied Filter Chips
   ============================================== */

/* ===== SKELETON LOADER CARDS ===== */
.skeleton-card {
  pointer-events: none;
}

.skeleton-card .listing-thumb {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite ease-in-out;
}

.skeleton-line {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite ease-in-out;
  border-radius: 4px;
  display: block;
}

.skeleton-btn {
  background: linear-gradient(90deg, #e8e8e8 25%, #d8d8d8 50%, #e8e8e8 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite ease-in-out;
  border-radius: 10px;
  border: none;
  height: 36px;
  width: 100%;
}

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

/* Stagger animation for multiple skeleton cards */
.skeleton-card:nth-child(1) { animation-delay: 0ms; }
.skeleton-card:nth-child(2) { animation-delay: 100ms; }
.skeleton-card:nth-child(3) { animation-delay: 200ms; }
.skeleton-card:nth-child(4) { animation-delay: 300ms; }
.skeleton-card:nth-child(5) { animation-delay: 400ms; }
.skeleton-card:nth-child(6) { animation-delay: 500ms; }


/* ===== APPLIED FILTERS CHIP BAR ===== */
.applied-filters {
  display: none; /* Hidden by default, shown via JS when filters active */
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  border: 1px solid var(--hm-border, #e5e7eb);
  align-items: center;
}

.applied-filters.has-filters {
  display: flex;
}

.applied-filters-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--hm-muted, #6b7280);
  margin-right: 4px;
  white-space: nowrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: #991b1b;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  color: #991b1b;
  opacity: 0.7;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.filter-chip-remove:hover {
  opacity: 1;
}

.clear-all-filters-chip {
  background: transparent;
  border: 1px dashed #991b1b;
  color: #991b1b;
  cursor: pointer;
  font-weight: 600;
}

.clear-all-filters-chip:hover {
  background: #fef2f2;
}


/* ===== LOADING INDICATOR (ALTERNATE) ===== */
.browse-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 12px;
}

.browse-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e5e7eb;
  border-top-color: #991b1b;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* ===== ERROR STATE ===== */
.browse-error {
  padding: 40px 20px;
  text-align: center;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #fecaca;
}

.browse-error-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.browse-error-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: #991b1b;
}

.browse-error-text {
  margin: 0 0 16px;
  font-size: 14px;
  color: #6b7280;
}

.browse-error-btn {
  padding: 10px 20px;
  background: #991b1b;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

.browse-error-btn:hover {
  filter: brightness(1.1);
}


/* ===== MOBILE REFINEMENTS ===== */
@media (max-width: 600px) {
  .applied-filters {
    padding: 10px 12px;
    gap: 6px;
  }
  
  .filter-chip {
    padding: 4px 8px;
    font-size: 11px;
    max-width: 150px;
  }
  
  .applied-filters-label {
    display: none; /* Hide label on mobile to save space */
  }
}
