/**
 * Luxury Jewelry Catalog — Reusable Components
 *
 * Hallmark seal badge, buttons, toasts, skeleton loaders,
 * filter chips, and other shared UI elements.
 *
 * @package LuxuryJewelryCatalog
 * @since   1.0.0
 */

/* =========================================================================
   1. Hallmark Seal Badge — Signature Element
   ========================================================================= */

.ljc-hallmark-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--ljc-radius-full);
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: linear-gradient(
    135deg,
    #F4E4C4 0%,
    #E5C58D 30%,
    #D9B983 50%,
    #B79173 85%,
    #A07657 100%
  );
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.8),
    inset 0 -1.5px 2px rgba(0, 0, 0, 0.25),
    0 4px 12px rgba(58, 50, 44, 0.15),
    0 1px 2px rgba(58, 50, 44, 0.1);
  font-family: var(--ljc-font-mono) !important;
  font-weight: var(--ljc-weight-semibold) !important;
  color: #3A322C !important;
  text-shadow: 
    0 1px 0 rgba(255, 255, 255, 0.45), 
    0 -0.5px 0.5px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.02em;
  line-height: 1;
  flex-shrink: 0;
  position: relative;
  user-select: none;
}

/* Stamped outer edge ring */
.ljc-hallmark-seal::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: var(--ljc-radius-full);
  border: 0.5px solid rgba(138, 111, 79, 0.4);
  pointer-events: none;
}

/* Stamped inner concentric detail ring */
.ljc-hallmark-seal::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: var(--ljc-radius-full);
  border: 1px dashed rgba(138, 111, 79, 0.25);
  pointer-events: none;
}

/* Signature variant for cards (prominent) */
.ljc-hallmark-seal--sm {
  width: 42px;
  height: 42px;
  font-size: 0.725rem !important;
}

.ljc-hallmark-seal--sm::before {
  inset: 2.5px;
}

.ljc-hallmark-seal--sm::after {
  inset: 4.5px;
}

/* Large variant for modal preview */
.ljc-hallmark-seal--lg {
  width: 58px;
  height: 58px;
  font-size: 0.875rem !important;
  border-width: 1.5px;
}

.ljc-hallmark-seal--lg::before {
  inset: 3.5px;
}

.ljc-hallmark-seal--lg::after {
  inset: 6px;
}

/* =========================================================================
   2. Buttons
   ========================================================================= */

.ljc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ljc-space-2);
  font-family: var(--ljc-font-body);
  font-size: var(--ljc-type-caption);
  font-weight: var(--ljc-weight-medium);
  line-height: 1;
  padding: var(--ljc-space-3) var(--ljc-space-5);
  border-radius: var(--ljc-radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color var(--ljc-transition-fast),
    border-color var(--ljc-transition-fast),
    transform var(--ljc-transition-fast),
    box-shadow var(--ljc-transition-fast);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  min-height: 44px;
  min-width: 44px;
}

.ljc-btn:active {
  transform: scale(0.97);
}

/* Primary — gold accent */
.ljc-btn--primary {
  background-color: var(--ljc-accent-primary);
  color: #FFFFFF;
  border-color: var(--ljc-accent-primary);
}

.ljc-btn--primary:hover {
  background-color: var(--ljc-accent-secondary);
  border-color: var(--ljc-accent-secondary);
  box-shadow: 0 4px 12px rgba(217, 185, 131, 0.3);
}

/* Secondary — outlined */
.ljc-btn--secondary {
  background-color: transparent;
  color: var(--ljc-text-primary);
  border-color: var(--ljc-hairline);
}

.ljc-btn--secondary:hover {
  background-color: var(--ljc-blush-stone);
  border-color: var(--ljc-accent-primary);
}

/* Ghost — minimal, no border */
.ljc-btn--ghost {
  background-color: transparent;
  color: var(--ljc-text-secondary);
  border-color: transparent;
  padding: var(--ljc-space-2) var(--ljc-space-3);
}

.ljc-btn--ghost:hover {
  color: var(--ljc-text-primary);
  background-color: var(--ljc-blush-stone);
}

/* Icon button — square, typically for close/wishlist */
.ljc-btn--icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--ljc-radius-full);
  background: transparent;
  border: none;
  color: var(--ljc-text-secondary);
}

.ljc-btn--icon:hover {
  color: var(--ljc-text-primary);
  background-color: var(--ljc-blush-stone);
}

/* Small button variant */
.ljc-btn--sm {
  padding: var(--ljc-space-2) var(--ljc-space-4);
  font-size: var(--ljc-type-micro);
  min-height: 36px;
}

/* =========================================================================
   3. Wishlist Heart Icon
   =========================================================================

   Note: The pop animation (ljc-heart-pop) lives in ljc-wishlist.css.
   ========================================================================= */

.ljc-wishlist-btn {
  position: relative;
  cursor: pointer;
}

.ljc-wishlist-btn svg {
  width: 22px;
  height: 22px;
  transition: transform var(--ljc-transition-fast);
}

.ljc-wishlist-btn:hover svg {
  transform: scale(1.15);
}

.ljc-wishlist-btn .ljc-heart-outline {
  fill: none;
  stroke: var(--ljc-text-secondary);
  stroke-width: 2;
}

.ljc-wishlist-btn:hover .ljc-heart-outline {
  stroke: var(--ljc-accent-primary);
}

.ljc-wishlist-btn .ljc-heart-filled {
  fill: var(--ljc-accent-primary);
  stroke: var(--ljc-accent-primary);
  stroke-width: 2;
  display: none;
}

.ljc-wishlist-btn.is-active .ljc-heart-outline {
  display: none;
}

.ljc-wishlist-btn.is-active .ljc-heart-filled {
  display: block;
}

/* =========================================================================
   4. Toast Notifications
   ========================================================================= */

.ljc-toast-container {
  position: fixed;
  bottom: var(--ljc-space-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--ljc-z-toast);
  pointer-events: none;
  padding: 0 var(--ljc-space-4);
  width: 100%;
  max-width: 400px;
}

.ljc-toast {
  pointer-events: auto;
  background: var(--ljc-glass-bg);
  -webkit-backdrop-filter: blur(var(--ljc-glass-blur));
  backdrop-filter: blur(var(--ljc-glass-blur));
  border: 1px solid var(--ljc-glass-border);
  box-shadow: var(--ljc-glass-shadow);
  border-radius: var(--ljc-radius-md);
  padding: var(--ljc-space-3) var(--ljc-space-5);
  font-size: var(--ljc-type-caption);
  color: var(--ljc-text-primary);
  text-align: center;
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--ljc-transition-base),
    transform var(--ljc-transition-base);
  margin-bottom: var(--ljc-space-2);
}

.ljc-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.ljc-toast.is-exiting {
  opacity: 0;
  transform: translateY(-8px);
}

/* Safe area inset for iOS */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .ljc-toast-container {
    bottom: calc(var(--ljc-space-6) + env(safe-area-inset-bottom));
  }
}

/* =========================================================================
   5. Skeleton Loading Placeholders
   ========================================================================= */

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

.ljc-skeleton {
  background: linear-gradient(
    90deg,
    var(--ljc-blush-stone) 25%,
    rgba(246, 238, 228, 0.5) 50%,
    var(--ljc-blush-stone) 75%
  );
  background-size: 200% 100%;
  animation: ljc-shimmer 1.8s ease-in-out infinite;
  border-radius: var(--ljc-radius-sm);
}

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

.ljc-skeleton-card__image {
  aspect-ratio: 1 / 1;
  width: 100%;
}

.ljc-skeleton-card__body {
  padding: var(--ljc-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--ljc-space-2);
}

.ljc-skeleton-card__line {
  height: 14px;
  border-radius: 4px;
}

.ljc-skeleton-card__line--short {
  width: 60%;
}

.ljc-skeleton-card__line--medium {
  width: 80%;
}

.ljc-skeleton-card__btn {
  height: 36px;
  border-radius: var(--ljc-radius-full);
  margin-top: var(--ljc-space-2);
}

/* =========================================================================
   6. Filter Chips
   ========================================================================= */

.ljc-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--ljc-space-1);
  padding: var(--ljc-space-2) var(--ljc-space-3);
  border-radius: var(--ljc-radius-full);
  border: 1px solid var(--ljc-hairline);
  background: var(--ljc-bg-base);
  font-family: var(--ljc-font-body);
  font-size: var(--ljc-type-caption);
  font-weight: var(--ljc-weight-medium);
  color: var(--ljc-text-secondary);
  cursor: pointer;
  transition:
    background-color var(--ljc-transition-fast),
    border-color var(--ljc-transition-fast),
    color var(--ljc-transition-fast);
  white-space: nowrap;
  user-select: none;
  min-height: 36px;
}

.ljc-chip:hover {
  border-color: var(--ljc-accent-primary);
  color: var(--ljc-text-primary);
  background-color: var(--ljc-blush-stone);
}

.ljc-chip.is-active {
  background-color: var(--ljc-accent-primary);
  border-color: var(--ljc-accent-primary);
  color: #FFFFFF;
}

.ljc-chip.is-active:hover {
  background-color: var(--ljc-accent-secondary);
  border-color: var(--ljc-accent-secondary);
  color: #FFFFFF;
}

/* =========================================================================
   7. SVG Icon System
   ========================================================================= */

.ljc-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ljc-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ljc-icon--sm svg {
  width: 16px;
  height: 16px;
}

.ljc-icon--lg svg {
  width: 24px;
  height: 24px;
}

/* =========================================================================
   8. Overlay
   ========================================================================= */

.ljc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(58, 50, 44, 0.35);
  z-index: var(--ljc-z-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ljc-transition-base);
}

.ljc-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* =========================================================================
   9. End-of-Scroll Indicator
   ========================================================================= */

.ljc-end-of-results {
  text-align: center;
  padding: var(--ljc-space-8) var(--ljc-space-4);
  color: var(--ljc-text-secondary);
  font-size: var(--ljc-type-caption);
}

.ljc-end-of-results::before {
  content: '';
  display: block;
  width: 48px;
  height: 1px;
  background: var(--ljc-hairline);
  margin: 0 auto var(--ljc-space-4);
}

/* =========================================================================
   10. Loading Spinner (for infinite scroll indicator)
   ========================================================================= */

.ljc-scroll-loader {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--ljc-space-6) 0;
  gap: var(--ljc-space-2);
}

.ljc-scroll-loader__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--ljc-radius-full);
  background-color: var(--ljc-accent-primary);
  opacity: 0.3;
  animation: ljc-dot-pulse 1.2s ease-in-out infinite;
}

.ljc-scroll-loader__dot:nth-child(2) {
  animation-delay: 0.2s;
}

.ljc-scroll-loader__dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes ljc-dot-pulse {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}
