/* =========================================================
   KYD's Choice — Enhanced Ecommerce Styles
   Animations, filters, sort, frequently bought, etc.
   ========================================================= */

/* --- Scroll Reveal Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.animate-in {
  animation: fadeInUp 0.5s ease forwards;
}
.animate-fade {
  animation: fadeIn 0.4s ease forwards;
}
.animate-scale {
  animation: scaleIn 0.3s ease forwards;
}

/* Stagger children */
.stagger > * { opacity: 0; animation: fadeInUp 0.4s ease forwards; }
.stagger > *:nth-child(1) { animation-delay: 0s; }
.stagger > *:nth-child(2) { animation-delay: 0.05s; }
.stagger > *:nth-child(3) { animation-delay: 0.1s; }
.stagger > *:nth-child(4) { animation-delay: 0.15s; }
.stagger > *:nth-child(5) { animation-delay: 0.2s; }
.stagger > *:nth-child(6) { animation-delay: 0.25s; }
.stagger > *:nth-child(7) { animation-delay: 0.3s; }
.stagger > *:nth-child(8) { animation-delay: 0.35s; }

/* --- Sort / Filter Bar --- */
.shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.shop-toolbar__count {
  font-size: 13px;
  color: var(--color-muted-gray);
}
.shop-toolbar__controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.shop-sort {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-faint-border);
  background: var(--color-pure-white);
  font-size: 13px;
  font-family: inherit;
  color: var(--color-ink-black);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23787574' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color .15s, box-shadow .15s;
}
.shop-sort:focus {
  border-color: var(--color-violet-wash);
  box-shadow: 0 0 0 3px rgba(84,51,235,0.08);
}
.price-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-muted-gray);
}
.price-filter input {
  width: 70px;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-faint-border);
  font-size: 12px;
  text-align: center;
  outline: none;
}
.price-filter input:focus {
  border-color: var(--color-violet-wash);
}

/* --- Enhanced Card hover --- */
.card {
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), box-shadow 0.35s ease, border-color 0.35s ease;
}
.card__media img {
  transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
}
.card:hover .card__media img {
  transform: scale(1.06);
}
.card__add {
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}
.card__add:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(91,61,245,0.28);
}

/* --- Frequently Bought Together --- */
.fbt {
  margin-top: var(--spacing-32);
  padding: var(--spacing-24);
  background: var(--color-pure-white);
  border-radius: var(--radius-cards);
  box-shadow: var(--shadow-card);
}
.fbt__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 var(--spacing-16);
}
.fbt__items {
  display: flex;
  align-items: center;
  gap: var(--spacing-12);
  overflow-x: auto;
  padding-bottom: var(--spacing-8);
}
.fbt__item {
  display: flex;
  align-items: center;
  gap: var(--spacing-10);
  background: var(--color-canvas-mist);
  border-radius: var(--radius-pills);
  padding: var(--spacing-8);
  min-width: 200px;
  flex-shrink: 0;
  transition: background .15s;
}
.fbt__item:hover {
  background: rgba(84,51,235,.04);
}
.fbt__item img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}
.fbt__item-info {
  flex: 1;
  min-width: 0;
}
.fbt__item-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fbt__item-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-shop-violet);
}
.fbt__plus {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--color-faint-border);
  color: var(--color-muted-gray);
  font-size: 14px;
  flex-shrink: 0;
}
.fbt__total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--spacing-12);
  padding-top: var(--spacing-12);
  border-top: 1px solid var(--color-faint-border);
}
.fbt__total-price {
  font-size: 18px;
  font-weight: 700;
}
.fbt__total-label {
  font-size: 12px;
  color: var(--color-muted-gray);
}

/* --- Newsletter Section --- */
.newsletter {
  background: var(--color-ink-black);
  border-radius: var(--radius-cards);
  padding: var(--spacing-48) var(--spacing-24);
  text-align: center;
  color: #fff;
  margin-top: var(--section-gap);
  position: relative;
  overflow: hidden;
}
.newsletter::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(91,61,245,.22) 0%, transparent 55%);
  pointer-events: none;
}
.newsletter h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 var(--spacing-8);
  position: relative;
}
.newsletter p { position: relative; }
.newsletter__form { position: relative; }
.newsletter p {
  color: rgba(255,255,255,.7);
  font-size: 14px;
  margin: 0 0 var(--spacing-20);
}
.newsletter__form {
  display: flex;
  max-width: 420px;
  margin: 0 auto;
  gap: 8px;
}
.newsletter__input {
  flex: 1;
  padding: 12px 18px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 14px;
  outline: none;
}
.newsletter__input::placeholder {
  color: rgba(255,255,255,.5);
}
.newsletter__input:focus {
  border-color: var(--color-violet-wash);
  background: rgba(255,255,255,.12);
}
.newsletter__btn {
  padding: 12px 24px;
  border-radius: var(--radius-full);
  background: #fff;
  color: var(--color-ink-black);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, background .18s, color .18s;
}
.newsletter__btn:hover {
  transform: translateY(-2px);
  background: var(--color-shop-violet);
  color: #fff;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .shop-toolbar { flex-direction: column; align-items: stretch; }
  .shop-toolbar__controls { justify-content: space-between; }
  .newsletter__form { flex-direction: column; }
  .fbt__items { flex-direction: column; }
  .fbt__plus { display: none; }
}
