/* Verso Shop v2.0 - Catalog Page Styles */
/* Uses design-system.css variables exclusively */

/* ========== BASE STYLES ========== */

#app {
  min-height: 100vh;
  padding-bottom: 72px; /* Space for sticky bottom bar */
  position: relative;
}

.hidden {
  display: none !important;
}

/* ========== OUTSIDE-TELEGRAM GUARD ========== */

.telegram-guard {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  background: var(--color-bg);
}

.guard-content {
  text-align: center;
  max-width: 400px;
}

.guard-icon {
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
}

.guard-message {
  font-size: 18px;
  color: var(--color-text);
  margin-bottom: 1rem;
  line-height: 1.8;
  font-weight: 600;
}

.guard-instruction {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.8;
}

/* When guard is visible, hide main content */
.telegram-guard:not(.hidden) ~ .app-header,
.telegram-guard:not(.hidden) ~ .category-nav,
.telegram-guard:not(.hidden) ~ .catalog-content,
.telegram-guard:not(.hidden) ~ .bottom-bar {
  display: none;
}

/* ========== HEADER ========== */

.app-header {
  background: #1e293b;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-logo {
  width: 32px;
  height: 32px;
}

.header-title {
  font-size: 16px;
  font-weight: 700;
}

.wallet-badge {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
}

/* ========== CATEGORY PILLS ========== */

.category-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 12px 16px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 48px;
  z-index: 90;
}

.category-nav::-webkit-scrollbar {
  display: none;
}

.category-pill {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border);
  background: var(--color-bg);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  color: var(--color-text);
}

.category-pill:hover {
  background: var(--color-bg-secondary);
}

.category-pill.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.category-pill.grayed {
  opacity: 0.5;
  color: var(--color-text-muted);
}

.category-pill.grayed.active {
  opacity: 0.7;
}

/* ========== CATALOG CONTENT ========== */

.catalog-content {
  padding: 0 16px 16px;
}

/* ========== CATEGORY SECTION ========== */

.category-section {
  margin-bottom: 24px;
}

.category-section-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 12px;
  padding-top: 16px;
}

/* ========== PRODUCT GRID ========== */

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* ========== PRODUCT CARD ========== */

.product-card {
  position: relative;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow var(--transition-fast);
}

.product-card:hover {
  box-shadow: var(--shadow-elevated);
}

.card-image {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
  background: var(--color-bg-secondary);
}

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

.card-category {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.card-name-fa {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}

.card-name-en {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
  direction: ltr;
  text-align: right;
}

.card-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.card-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.card-buy-btn {
  width: 100%;
  padding: 8px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-button);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: background var(--transition-fast);
  min-height: 36px;
}

.card-buy-btn:hover {
  background: var(--color-primary-dark);
}

.card-buy-btn:active {
  background: var(--color-primary-darker);
}

/* ========== COMING SOON CARD ========== */

.product-card.coming-soon {
  opacity: 0.6;
  pointer-events: none;
}

.product-card.coming-soon .card-image {
  filter: grayscale(100%);
}

.product-card.coming-soon .card-price {
  color: var(--color-text-muted);
}

.product-card.coming-soon .card-buy-btn {
  display: none;
}

/* ========== SKELETON LOADING ========== */

.skeleton-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.skeleton-image {
  width: 100%;
  height: 100px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  position: relative;
  overflow: hidden;
}

.skeleton-body {
  padding: 10px 12px;
}

.skeleton-line {
  height: 14px;
  background: var(--color-bg-secondary);
  border-radius: 4px;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
}

.skeleton-line.short {
  width: 60%;
}

.skeleton-line.shorter {
  width: 40%;
}

.skeleton-btn {
  height: 36px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-button);
  position: relative;
  overflow: hidden;
}

.skeleton-text {
  display: inline-block;
  height: 14px;
  width: 80px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

/* Shimmer animation */
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.skeleton-image::after,
.skeleton-line::after,
.skeleton-btn::after,
.skeleton-text::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shimmer 1.5s infinite;
}

/* ========== ERROR STATE ========== */

#error-state {
  text-align: center;
  padding: 48px 16px;
}

.error-message {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

#error-state .btn-primary {
  padding: 12px 32px;
}

/* ========== BOTTOM BAR ========== */

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1e293b;
  padding: 10px 16px;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.bottom-bar button {
  width: 100%;
  padding: 12px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-button);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  min-height: 44px;
  transition: background var(--transition-fast);
}

.bottom-bar button:hover {
  background: var(--color-primary-dark);
}

.bottom-bar button:active {
  background: var(--color-primary-darker);
}
