/* ==========================================================================
   UI COMPONENTS - DevForge Digital Marketplace
   ========================================================================== */

/* Announcement Bar */
.announcement-bar {
  background: linear-gradient(90deg, #1e1b4b 0%, #3730a3 40%, #4f46e5 100%);
  color: #ffffff;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.announcement-bar strong {
  background: rgba(254, 240, 138, 0.2);
  color: #fef08a;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
}

.announcement-bar a {
  color: #93c5fd;
  text-decoration: underline;
  margin-left: 0.25rem;
  font-weight: 700;
}

/* Header & Navigation Bar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(8px);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 72px;
}

/* Brand Logo & Header Nav Group */
.header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-shrink: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 900;
  font-size: 1.1rem;
}

.nav-links-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Header Search */
.header-search {
  position: relative;
  flex: 1;
  max-width: 440px;
  min-width: 200px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.header-search-input {
  width: 100%;
  padding: 0.55rem 2.5rem 0.55rem 1rem;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background-color: var(--bg-subtle);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.header-search-input:focus {
  background-color: var(--bg-surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
  outline: none;
}

.header-search-btn {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  padding: 0;
  line-height: 1;
}

.header-search-btn:hover {
  background-color: var(--bg-card);
  color: var(--primary);
}

/* Search Autocomplete Suggestions Dropdown */
.search-suggestions-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  z-index: 100;
  display: none;
}

.search-suggestions-dropdown.active {
  display: block;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  text-decoration: none;
  transition: background-color var(--transition-fast);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover, .suggestion-item:focus {
  background-color: var(--bg-subtle);
}

.suggestion-thumb {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.suggestion-title {
  font-size: 0.88rem;
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

/* User Account Dropdown System */
.user-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.user-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 240px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  overflow: hidden;
}

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

.user-dropdown-header {
  padding: 0.75rem 1rem;
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--transition-fast);
}

.user-dropdown-item:hover {
  background-color: var(--bg-subtle);
  color: var(--primary);
}

.user-dropdown-item.text-danger:hover {
  background-color: var(--danger-bg);
  color: var(--danger);
}

.user-nav-display-name {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}

.header-user-direct-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.account-sub-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  scrollbar-width: thin;
}

.account-sub-nav::-webkit-scrollbar {
  height: 4px;
}

.account-sub-nav::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: var(--radius-full);
}

.account-sub-nav .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.desktop-only-user-btns {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--text-primary);
  background-color: var(--bg-subtle);
}

.nav-link.active {
  color: var(--primary);
  background-color: var(--primary-light);
  font-weight: 700;
}

/* Cart Button - Attention-Grabbing Highlight */
.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  padding: 0.42rem 0.85rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.86rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 3px 12px rgba(234, 88, 12, 0.35);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  line-height: 1;
}

.cart-btn:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.5);
  color: #ffffff !important;
}

.cart-btn:active {
  transform: translateY(0) scale(0.98);
}

.cart-btn-icon {
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
}

.cart-btn-label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.cart-btn.has-items {
  animation: cartAttentionGlow 2.5s infinite;
}

@keyframes cartAttentionGlow {
  0%, 100% {
    box-shadow: 0 3px 12px rgba(234, 88, 12, 0.35);
  }
  50% {
    box-shadow: 0 4px 22px rgba(245, 158, 11, 0.7), 0 0 12px rgba(234, 88, 12, 0.45);
    transform: scale(1.03);
  }
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background-color: #ef4444;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  border: 2px solid var(--bg-surface);
  line-height: 1;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0.55rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-subtle);
}

/* Product Card */
.product-card {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  height: 100%;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 32px -8px var(--primary-glow);
  border-color: rgba(99, 102, 241, 0.45);
}

.product-thumb-link {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--bg-subtle);
}

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

.product-card:hover .product-thumb {
  transform: scale(1.03);
}

.product-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.product-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

.product-title a {
  color: var(--text-primary);
}

.product-title a:hover {
  color: var(--primary);
}

.product-description {
  font-size: 0.88rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
  flex: 1;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.product-pricing {
  display: flex;
  flex-direction: column;
}

.product-price {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--price-color);
  letter-spacing: -0.02em;
}

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

/* Skeleton Loading Animation */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--border-color) 37%, var(--bg-subtle) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-md);
}

.skeleton-card {
  height: 380px;
  border-radius: var(--radius-lg);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  max-width: 500px;
  margin: 0 auto;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #ffffff;
  animation: slideInRight 0.25s ease-out;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-success { background-color: var(--success); }
.toast-error { background-color: var(--danger); }
.toast-warning { background-color: var(--warning); color: #000; }
.toast-info { background-color: var(--primary); }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

/* Site Footer */
.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem;
  margin-top: 5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Footer Social Links */
.footer-social-wrapper {
  margin-top: 1.25rem;
}

.footer-social-heading {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.footer-social-links {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.footer-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.footer-social-btn:hover {
  transform: translateY(-2px);
  background-color: var(--bg-surface);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.footer-social-btn.instagram:hover {
  color: #E1306C;
  border-color: #E1306C;
  box-shadow: 0 4px 12px rgba(225, 48, 108, 0.25);
}

.footer-social-btn.youtube:hover {
  color: #FF0000;
  border-color: #FF0000;
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.25);
}

.footer-social-btn.telegram:hover {
  color: #229ED9;
  border-color: #229ED9;
  box-shadow: 0 4px 12px rgba(34, 158, 217, 0.25);
}

.footer-social-btn.facebook:hover {
  color: #1877F2;
  border-color: #1877F2;
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.25);
}

.footer-social-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ==========================================================================
   PRODUCT DETAIL PAGE COMPONENTS
   ========================================================================== */
.product-detail-layout {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 3.5rem;
}

.product-breadcrumb {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.35rem;
}

.product-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

.product-breadcrumb a:hover {
  color: var(--primary);
}

.product-thumb-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-subtle);
}

.product-thumb-card img {
  width: 100%;
  height: auto;
  max-height: 460px;
  object-fit: contain;
  border-radius: var(--radius-md);
  display: block;
}

.product-detail-title {
  font-size: 2.15rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
  color: var(--text-primary);
  word-break: break-word;
  overflow-wrap: break-word;
}

.product-tags-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.product-tags-wrapper .badge {
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  white-space: nowrap;
}

.product-price-box {
  background-color: var(--bg-surface);
  border: 1.5px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 8px 24px -4px var(--primary-glow);
}

.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.product-active-price {
  font-size: 2.35rem;
  font-weight: 900;
  color: var(--price-color);
  letter-spacing: -0.02em;
  line-height: 1;
}

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

.product-action-buttons {
  display: flex;
  gap: 0.75rem;
}

.product-description-container {
  color: var(--text-secondary);
  line-height: 1.75;
  font-size: 1rem;
  margin-top: 0.85rem;
  word-break: break-word;
  overflow-wrap: break-word;
}

.product-description-container p {
  margin-bottom: 1rem;
  line-height: 1.75;
}

.product-description-container h4 {
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.65rem;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.product-description-container ul,
.product-description-container ol {
  margin-left: 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.product-description-container li {
  line-height: 1.6;
}

.product-description-container hr {
  border: 0;
  border-top: 1px dashed var(--border-color);
  margin: 1.5rem 0;
}
