/* Stores page styles - modern responsive grid and cards */
@import url("/css/design-tokens.css");

:root {
  --card-aspect: 56.25%; /* 16:9 */
}

body {
  background: var(--bg-light);
  font-family: var(--font-family-primary);
  color: var(--text-primary);
}

.page-header {
  text-align: center;
  color: white;
  margin-top: var(--space-lg);
}
.page-header h1 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-xs);
}

.search-section {
  background: var(--bg-white);
  padding: var(--space-lg);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-lg);
}
.search-box {
  max-width: 780px;
  margin: 0 auto;
  position: relative;
}
.search-box input {
  width: 100%;
  padding: 12px 110px 12px 44px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: var(--font-size-base);
}
.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}
.search-box button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
}

.stores-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, 1fr);
  margin: var(--space-lg) 0;
}

/* Responsive breakpoints */
@media (max-width: 1100px) {
  .stores-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 720px) {
  .stores-grid {
    grid-template-columns: 1fr;
  }
  .search-box input {
    padding-right: 80px;
  }
}

.store-card {
  background: var(--bg-white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
  min-height: 340px;
}
.store-card:focus-within,
.store-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.store-media {
  position: relative;
  width: 100%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.02));
}
.store-media::before {
  content: "";
  display: block;
  padding-top: var(--card-aspect);
}
.store-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.store-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, var(--accent-1, #ffd700), #ffed4e);
  color: #111;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}

.store-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.store-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.store-description {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Provide a non-webkit friendly clamp fallback (best-effort) */

.store-meta {
  margin-top: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.store-meta .meta-item {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
}
.store-meta .meta-item i {
  color: var(--primary-color);
}

.store-footer {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-light);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary-color);
  color: #fff;
  border: none;
  flex: 1;
}
.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  flex: 1;
}

.no-results,
.loading-spinner {
  text-align: center;
  padding: 36px;
  background: var(--bg-white);
  border-radius: 12px;
}

/* Accessibility focus */
.store-card:focus-within {
  outline: 3px solid rgba(0, 123, 255, 0.12);
}
.store-card a {
  color: inherit;
}

/* Small polish for grid item alignment when images missing */
.store-logo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: #fff;
  font-size: 32px;
}

/* Small mobile polish */
@media (max-width: 720px) {
  .store-body {
    padding: 12px;
  }
  .store-card {
    min-height: 360px;
  }
  .stores-grid {
    gap: 14px;
  }
}

/* Larger screens: show 4 columns when plenty of space is available */
@media (min-width: 1300px) {
  .stores-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Utility */
.muted {
  color: var(--text-secondary);
  font-size: 13px;
}
