/* ==========================================================================
   Panda Store - Components Stylesheet
   Cards, Badges, Buttons, Drawers, Modals & Micro-interactions
   ========================================================================== */

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--accent-green);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  background-color: var(--accent-green-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-green-glow);
}

.btn-primary:active {
  background-color: var(--accent-green-active);
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  color: var(--accent-green);
  background-color: var(--bg-card);
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  border-color: var(--border-hover);
  color: var(--accent-green);
  background-color: var(--accent-green-subtle);
}

/* Category Filter Chips */
.category-filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 18px;
  scrollbar-width: none;
}

.category-filter-chips::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-chip:hover {
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.filter-chip.active {
  background-color: var(--accent-green);
  border-color: var(--accent-green);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--accent-green-glow);
}

/* Category Cards */
.category-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-xs);
}

.category-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

.category-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  font-size: 26px;
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.category-card:hover .category-icon-wrapper {
  background: var(--accent-green-light);
  border-color: var(--accent-green);
}

.category-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Product Cards */
.product-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-xs);
}

.product-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

.product-image-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid var(--border-subtle);
}

.product-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.product-card:hover .product-image-container img {
  transform: scale(1.05);
}

.product-custom-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tg-custom-emoji-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 6px;
  transition: transform var(--transition-fast);
}

.product-card:hover .tg-custom-emoji-img {
  transform: scale(1.1);
}

.tg-inline-custom-emoji {
  width: 22px;
  height: 22px;
  object-fit: contain;
  vertical-align: -4px;
  margin: 0 3px;
  display: inline-block;
}

.hero-avatar-img {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 2px solid var(--accent-green);
  box-shadow: 0 4px 14px var(--accent-green-glow);
}

/* Badges */
.product-badge-stock {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background-color: var(--accent-green-light);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

html[dir="rtl"] .product-badge-stock {
  right: auto;
  left: 8px;
}

.product-badge-out {
  background-color: var(--color-danger-light);
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.2);
}

.product-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}

.product-category-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 8px;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.product-price-box {
  display: flex;
  flex-direction: column;
}

.product-price {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-green);
}

.product-old-price {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.product-buy-btn {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-xs);
  background-color: var(--accent-green);
  color: #ffffff;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.product-buy-btn:hover {
  background-color: var(--accent-green-hover);
  box-shadow: 0 2px 8px var(--accent-green-glow);
}

.product-card.out-of-stock {
  opacity: 0.75;
}

.product-card.out-of-stock .product-buy-btn {
  background-color: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Modals & Dialogs */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 24px;
  transform: scale(0.96);
  transition: transform var(--transition-fast);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.modal-close-btn:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

/* Language Dropdown (Reference Image 1) */
.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 150;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px;
  min-width: 170px;
  box-shadow: var(--shadow-md);
  display: none;
}

html[dir="rtl"] .lang-dropdown-menu {
  right: auto;
  left: 0;
}

.lang-dropdown-menu.active {
  display: block;
}

.lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-item:hover {
  background-color: var(--accent-green-light);
  color: var(--accent-green);
}

.lang-item.selected {
  color: var(--accent-green);
}

/* User Balance Pill */
.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--accent-green-light);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: toastIn 0.25s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Skeleton Loading Shimmer */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-subtle) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

/* Telegram Custom Emoji Sticker & Image Styles */
.tg-custom-emoji-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
  transition: transform var(--transition-fast);
}

.product-card:hover .tg-custom-emoji-img {
  transform: scale(1.08);
}

.tg-inline-custom-emoji {
  width: 22px;
  height: 22px;
  object-fit: contain;
  vertical-align: -4px;
  display: inline-block;
  margin: 0 2px;
}

.hero-avatar-img {
  transition: transform var(--transition-bounce);
}

.hero-avatar-img:hover {
  transform: scale(1.06) rotate(3deg);
}

.brand-logo-img {
  transition: transform var(--transition-fast);
}

.brand-logo-img:hover {
  transform: scale(1.05);
}

