/* ============================================
   CHROCHELY CREATIONS — UI Components
   ============================================ */

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  border-radius: var(--radius-md);
  transition: all var(--duration-normal) var(--ease-smooth);
  cursor: pointer;
  border: none;
  outline: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-smooth);
}

.btn:hover::after {
  opacity: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brown), var(--brown-dark));
  color: var(--cream-light);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--white);
  color: var(--brown);
  border: 1.5px solid var(--warm-beige);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--cream);
  border-color: var(--warm-tan);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-soft {
  background: var(--soft-pink);
  color: var(--rose);
}

.btn-soft:hover {
  background: var(--soft-pink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--brown);
  padding: var(--space-2) var(--space-4);
}

.btn-ghost:hover {
  background: var(--cream);
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-full);
  background: var(--white);
  color: var(--brown);
  box-shadow: var(--shadow-sm);
}

.btn-icon:hover {
  background: var(--cream);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--fs-base);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-xs);
}

.btn-full {
  width: 100%;
}

.btn-cart {
  background: linear-gradient(135deg, var(--brown), var(--brown-dark));
  color: var(--cream-light);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-lg);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  box-shadow: var(--shadow-md);
}

.btn-cart:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

.btn-wishlist {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
  background: var(--white-90);
  color: var(--brown-light);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-wishlist:hover {
  color: var(--error);
  transform: scale(1.1);
}

.btn-wishlist.active {
  color: var(--error);
}

.btn-wishlist.active svg {
  fill: var(--error);
}

.btn-wishlist svg {
  width: 18px;
  height: 18px;
  transition: all var(--duration-fast) var(--ease-smooth);
}

/* ── Form Inputs ── */
.form-group {
  margin-bottom: var(--space-5);
  position: relative;
}

.form-label {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--brown);
  margin-bottom: var(--space-2);
  letter-spacing: var(--ls-wide);
}

.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--white);
  border: 1.5px solid var(--warm-beige);
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  color: var(--brown-dark);
  transition: all var(--duration-fast) var(--ease-smooth);
}

.form-input:focus {
  border-color: var(--brown-light);
  box-shadow: 0 0 0 3px rgba(139, 107, 97, 0.1);
}

.form-input::placeholder {
  color: var(--warm-tan);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  font-family: var(--font-body);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238B6B61' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-10);
  cursor: pointer;
}

.form-error {
  color: var(--error);
  font-size: var(--fs-xs);
  margin-top: var(--space-1);
}

.form-input.error {
  border-color: var(--error);
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-handmade {
  background: linear-gradient(135deg, var(--blush), var(--soft-pink));
  color: var(--brown-dark);
}

.badge-sale {
  background: var(--brown);
  color: var(--cream-light);
}

.badge-new {
  background: var(--success);
  color: var(--white);
}

.badge-stock {
  background: var(--cream);
  color: var(--brown-light);
}

.badge-out {
  background: var(--error);
  color: var(--white);
}

/* ── Cards — Product ── */
.product-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all var(--duration-slow) var(--ease-smooth);
  position: relative;
  cursor: pointer;
}

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

.product-card-image {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  background: var(--cream);
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slower) var(--ease-smooth);
}

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

.product-card-image .hover-image {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease-smooth);
}

.product-card:hover .product-card-image .hover-image {
  opacity: 1;
}

.product-card-badges {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 2;
}

.product-card-actions {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 2;
  opacity: 0;
  transform: translateX(8px);
  transition: all var(--duration-normal) var(--ease-smooth);
}

.product-card:hover .product-card-actions {
  opacity: 1;
  transform: translateX(0);
}

.product-card-quick-add {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-3);
  transform: translateY(100%);
  transition: transform var(--duration-normal) var(--ease-smooth);
  z-index: 2;
}

.product-card:hover .product-card-quick-add {
  transform: translateY(0);
}

.product-card-info {
  padding: var(--space-4);
}

.product-card-category {
  font-size: var(--fs-xs);
  color: var(--brown-light);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  font-weight: var(--fw-medium);
  margin-bottom: var(--space-1);
}

.product-card-name {
  font-family: var(--font-heading);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--brown-dark);
  margin-bottom: var(--space-2);
  line-height: var(--lh-snug);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-price {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.product-card-price .current {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--brown-dark);
}

.product-card-price .original {
  font-size: var(--fs-sm);
  color: var(--warm-tan);
  text-decoration: line-through;
}

.product-card-rating {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-2);
}

.product-card-rating .stars {
  color: var(--warning);
  font-size: var(--fs-xs);
}

.product-card-rating .count {
  font-size: var(--fs-xs);
  color: var(--brown-light);
}

.product-card-custom {
  font-size: var(--fs-xs);
  color: var(--brown-light);
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.product-card-custom svg {
  width: 14px;
  height: 14px;
}

/* ── Cards — Category Collection ── */
.collection-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 3/4;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: all var(--duration-slow) var(--ease-smooth);
}

.collection-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
}

.collection-card-image {
  position: absolute;
  inset: 0;
}

.collection-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slower) var(--ease-smooth);
}

.collection-card:hover .collection-card-image img {
  transform: scale(1.08);
}

.collection-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(107, 78, 69, 0.7) 0%, rgba(107, 78, 69, 0.1) 60%, transparent 100%);
  transition: background var(--duration-normal) var(--ease-smooth);
}

.collection-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-6);
  color: var(--white);
  z-index: 2;
}

.collection-card-content h3 {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--white);
  margin-bottom: var(--space-1);
}

.collection-card-content p {
  font-size: var(--fs-sm);
  color: var(--white-70);
  margin-bottom: var(--space-3);
}

.collection-card-link {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  letter-spacing: var(--ls-wide);
  transition: gap var(--duration-fast) var(--ease-smooth);
}

.collection-card:hover .collection-card-link {
  gap: var(--space-3);
}

.collection-card-link svg {
  width: 16px;
  height: 16px;
}

/* ── Review Card ── */
.review-card {
  background: var(--white);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: all var(--duration-normal) var(--ease-smooth);
}

.review-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.review-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.review-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--soft-pink);
}

.review-card-name {
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-base);
  color: var(--brown-dark);
}

.review-card-stars {
  color: var(--warning);
  font-size: var(--fs-sm);
}

.review-card-text {
  font-style: italic;
  font-size: var(--fs-base);
  color: var(--brown-light);
  line-height: var(--lh-relaxed);
  position: relative;
  padding-left: var(--space-4);
  border-left: 3px solid var(--rose);
}

/* ── Toast / Notification ── */
.toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  background: var(--white);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  z-index: var(--z-toast);
  transform: translateY(120%);
  opacity: 0;
  transition: all var(--duration-normal) var(--ease-smooth);
  max-width: 360px;
  border-left: 4px solid var(--success);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-icon {
  color: var(--success);
  flex-shrink: 0;
}

.toast-icon svg {
  width: 22px;
  height: 22px;
}

.toast-message {
  font-size: var(--fs-sm);
  color: var(--brown);
  font-weight: var(--fw-medium);
}

.toast-close {
  margin-left: auto;
  color: var(--brown-light);
  cursor: pointer;
  padding: var(--space-1);
}

/* ── Skeleton Loading ── */
.skeleton {
  background: linear-gradient(90deg, var(--cream) 25%, var(--cream-light) 50%, var(--cream) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-sm);
}

.skeleton-text:last-child {
  width: 70%;
}

.skeleton-title {
  height: 20px;
  width: 60%;
  margin-bottom: var(--space-3);
}

.skeleton-image {
  aspect-ratio: 4/5;
}

.skeleton-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.skeleton-circle {
  border-radius: var(--radius-full);
}

.skeleton-btn {
  height: 44px;
  width: 140px;
}

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

  100% {
    background-position: -200% 0;
  }
}

/* ── Quantity Selector ── */
.qty-selector {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--warm-beige);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
}

.qty-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  color: var(--brown);
  transition: background var(--duration-fast) var(--ease-smooth);
  cursor: pointer;
  border: none;
  background: none;
}

.qty-btn:hover {
  background: var(--cream);
}

.qty-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.qty-value {
  width: 48px;
  text-align: center;
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-base);
  color: var(--brown-dark);
  border-left: 1px solid var(--warm-beige);
  border-right: 1px solid var(--warm-beige);
  padding: var(--space-2) 0;
}

/* ── Color Swatches ── */
.color-swatches {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  position: relative;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.active {
  border-color: var(--brown);
  box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--brown);
}

/* ── Star Rating ── */
.star-rating {
  display: flex;
  gap: 2px;
}

.star-rating .star {
  color: var(--warm-beige);
  font-size: var(--fs-sm);
}

.star-rating .star.filled {
  color: var(--warning);
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1.5px solid var(--warm-beige);
  margin-bottom: var(--space-6);
  overflow-x: auto;
}

.tab {
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--brown-light);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.tab:hover {
  color: var(--brown);
}

.tab.active {
  color: var(--brown-dark);
  border-bottom-color: var(--brown);
}

/* ── Accordion ── */
.accordion-item {
  border-bottom: 1px solid var(--warm-beige);
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) 0;
  font-family: var(--font-heading);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--brown-dark);
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
}

.accordion-trigger svg {
  width: 20px;
  height: 20px;
  transition: transform var(--duration-fast) var(--ease-smooth);
  color: var(--brown-light);
  flex-shrink: 0;
}

.accordion-item.open .accordion-trigger svg {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-normal) var(--ease-smooth);
}

.accordion-item.open .accordion-content {
  max-height: 500px;
}

.accordion-body {
  padding-bottom: var(--space-5);
  font-size: var(--fs-base);
  color: var(--brown-light);
  line-height: var(--lh-relaxed);
}

/* ── Tag / Chip ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--cream);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--brown);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  border: 1px solid transparent;
}

.tag:hover {
  background: var(--blush);
}

.tag.active {
  background: var(--brown);
  color: var(--cream-light);
}

/* ── Tooltip ── */
.tooltip-wrap {
  position: relative;
}

.tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--brown-dark);
  color: var(--cream-light);
  font-size: var(--fs-xs);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all var(--duration-fast) var(--ease-smooth);
  z-index: var(--z-tooltip);
}

.tooltip-wrap:hover .tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Mobile Touch Targets ── */
@media (max-width: 768px) {
  .btn {
    min-height: 48px;
    padding: var(--space-3) var(--space-5);
  }

  .btn-lg {
    min-height: 52px;
  }

  .btn-icon {
    width: 48px;
    height: 48px;
  }

  .form-input {
    min-height: 48px;
    padding: var(--space-4);
  }

  .qty-btn {
    width: 48px;
    height: 48px;
  }

  .product-card-actions {
    opacity: 1;
    transform: translateX(0);
  }

  .product-card-quick-add {
    transform: translateY(0);
  }

  .toast {
    left: var(--space-4);
    right: var(--space-4);
    bottom: calc(var(--mobile-nav-height) + var(--space-4));
    max-width: none;
  }
}