﻿/* ============================================================
   animations.css — TheCrochetSuman
   Premium CSS Animations & Transitions
   All keyframes, utility classes, and component-level motion
   ============================================================ */

/* ─────────────────────────────────────────────
   1. REVEAL ANIMATIONS
   Used with GSAP ScrollTrigger: JS adds .is-visible
   ───────────────────────────────────────────── */

.reveal-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-scale.is-visible {
  opacity: 1;
  transform: scale(1);
}

.reveal-fade {
  opacity: 0;
  transition: opacity 1s ease;
}
.reveal-fade.is-visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .reveal-up,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .reveal-fade {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ─────────────────────────────────────────────
   2. STAGGER DELAYS
   Apply .stagger-children to a parent; each
   direct child gets an incremental delay so
   reveal transitions cascade naturally.
   ───────────────────────────────────────────── */

.stagger-children > *:nth-child(1) { transition-delay: 0ms;   }
.stagger-children > *:nth-child(2) { transition-delay: 100ms; }
.stagger-children > *:nth-child(3) { transition-delay: 200ms; }
.stagger-children > *:nth-child(4) { transition-delay: 300ms; }
.stagger-children > *:nth-child(5) { transition-delay: 400ms; }
.stagger-children > *:nth-child(6) { transition-delay: 500ms; }
.stagger-children > *:nth-child(7) { transition-delay: 600ms; }
.stagger-children > *:nth-child(8) { transition-delay: 700ms; }

/* ─────────────────────────────────────────────
   3. IMAGE REVEAL — clip-path wipe
   ───────────────────────────────────────────── */

.img-reveal {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1s cubic-bezier(0.77, 0, 0.18, 1);
}
.img-reveal.is-visible {
  clip-path: inset(0 0% 0 0);
}

@media (prefers-reduced-motion: reduce) {
  .img-reveal {
    clip-path: none;
    transition: none;
  }
}

/* ─────────────────────────────────────────────
   4. HERO ANIMATIONS
   ───────────────────────────────────────────── */

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

.hero-animate {
  animation: heroFadeIn 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-animate-1 {
  animation: heroFadeIn 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 0.2s;
  opacity: 0;
}
.hero-animate-2 {
  animation: heroFadeIn 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 0.4s;
  opacity: 0;
}
.hero-animate-3 {
  animation: heroFadeIn 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 0.6s;
  opacity: 0;
}
.hero-animate-4 {
  animation: heroFadeIn 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 0.8s;
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .hero-animate,
  .hero-animate-1,
  .hero-animate-2,
  .hero-animate-3,
  .hero-animate-4 {
    animation: none;
    opacity: 1;
  }
}

/* ─────────────────────────────────────────────
   5. FLOATING YARN ELEMENTS
   Decorative ambient motion for yarn/crochet imagery
   ───────────────────────────────────────────── */

@keyframes floatYarn {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  33% {
    transform: translateY(-18px) rotate(5deg);
  }
  66% {
    transform: translateY(-8px) rotate(-3deg);
  }
}

@keyframes floatYarn2 {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  50% {
    transform: translateY(-24px) rotate(-8deg) scale(1.05);
  }
}

.float-1 {
  animation: floatYarn 7s ease-in-out infinite;
}
.float-2 {
  animation: floatYarn2 9s ease-in-out infinite 1s;
}
.float-3 {
  animation: floatYarn 11s ease-in-out infinite 2s;
}
.float-4 {
  animation: floatYarn2 8s ease-in-out infinite 0.5s;
}

@media (prefers-reduced-motion: reduce) {
  .float-1,
  .float-2,
  .float-3,
  .float-4 {
    animation: none;
  }
}

/* ─────────────────────────────────────────────
   6. SCROLL LINE (Hero indicator)
   ───────────────────────────────────────────── */

@keyframes scrollLine {
  0% {
    transform: scaleY(0);
    transform-origin: top;
  }
  50% {
    transform: scaleY(1);
    transform-origin: top;
  }
  51% {
    transform-origin: bottom;
  }
  100% {
    transform: scaleY(0);
    transform-origin: bottom;
  }
}

.scroll-line {
  display: block;
  width: 1px;
  height: 60px;
  background: #C67B5D;
  animation: scrollLine 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .scroll-line {
    animation: none;
    transform: scaleY(1);
  }
}

/* ─────────────────────────────────────────────
   7. LOADING SKELETON
   ───────────────────────────────────────────── */

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

.skeleton {
  background: linear-gradient(
    90deg,
    #f0ebe4 25%,
    #e8e0d5 50%,
    #f0ebe4 75%
  );
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: 8px;
}

/* Specific skeleton shape variants */
.skeleton-text {
  height: 1em;
  border-radius: 4px;
  margin-bottom: 0.5em;
}
.skeleton-text:last-child {
  width: 75%;
}
.skeleton-img {
  width: 100%;
  padding-bottom: 100%;
  border-radius: 12px;
}
.skeleton-circle {
  border-radius: 50%;
}
.skeleton-btn {
  height: 48px;
  border-radius: 999px;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
    background: #f0ebe4;
  }
}

/* ─────────────────────────────────────────────
   8. PULSE / HEARTBEAT
   Wishlist heart active state
   ───────────────────────────────────────────── */

@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.2);
  }
  50% {
    transform: scale(0.95);
  }
  75% {
    transform: scale(1.1);
  }
}

.heartbeat {
  animation: heartbeat 0.5s ease;
}

/* ─────────────────────────────────────────────
   9. SPIN (Loading indicator)
   ───────────────────────────────────────────── */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spin {
  animation: spin 1s linear infinite;
  display: inline-block;
}

/* ─────────────────────────────────────────────
   10. SHIMMER (Button hover effect)
   ───────────────────────────────────────────── */

@keyframes shimmer {
  0% {
    transform: translateX(-100%) skewX(-12deg);
  }
  100% {
    transform: translateX(200%) skewX(-12deg);
  }
}

.btn-shimmer {
  position: relative;
  overflow: hidden;
}

.btn-shimmer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.25) 50%,
    transparent 100%
  );
  transform: translateX(-100%) skewX(-12deg);
  pointer-events: none;
}

.btn-shimmer:hover::before {
  animation: shimmer 0.7s ease;
}

@media (prefers-reduced-motion: reduce) {
  .btn-shimmer:hover::before {
    animation: none;
  }
}

/* ─────────────────────────────────────────────
   11. COUNTER / COUNT-UP
   JS animates the numeric value; this class
   ensures correct rendering and prevents layout
   shift during the counting sequence.
   ───────────────────────────────────────────── */

.count-up {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  min-width: 1ch;
}

/* ─────────────────────────────────────────────
   12. LIGHTBOX / IMAGE ZOOM MODAL
   ───────────────────────────────────────────── */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(30, 22, 15, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 16px;
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
}

.lightbox-overlay.active .lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.lightbox-close:active {
  transform: scale(0.95);
}

/* Prev / Next navigation arrows */
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}
.lightbox-prev { left: 2rem; }
.lightbox-next { right: 2rem; }
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

/* ─────────────────────────────────────────────
   13. TAB TRANSITIONS
   ───────────────────────────────────────────── */

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

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: tabFadeIn 0.4s ease;
}

@media (prefers-reduced-motion: reduce) {
  .tab-content.active {
    animation: none;
  }
}

/* ─────────────────────────────────────────────
   14. ACCORDION
   ───────────────────────────────────────────── */

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.accordion-toggle svg {
  transition: transform 0.3s ease;
}

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

.accordion-item {
  border-bottom: 1px solid #E8DED3;
  transition: border-color 0.3s ease;
}

.accordion-item.open {
  border-color: #C67B5D;
}

.accordion-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: color 0.3s ease;
}

/* ─────────────────────────────────────────────
   15. PAGE LOADER
   ───────────────────────────────────────────── */

@keyframes loaderFadeIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes dotBounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  40% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

#page-loader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #FAF7F2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Logo image */
#page-loader .loader-logo-img {
  width: 130px;
  height: auto;
  animation: loaderFadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* 3-dot bounce row */
#page-loader .loader-dots {
  display: flex;
  gap: 10px;
  align-items: center;
}

#page-loader .loader-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #C67B5D;
  display: inline-block;
  animation: dotBounce 1.2s ease-in-out infinite;
}

#page-loader .loader-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

#page-loader .loader-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

/* ─────────────────────────────────────────────
   16. STICKY ADD TO CART BAR
   Product page — slides up from bottom
   ───────────────────────────────────────────── */

.sticky-atc {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  background: rgba(250, 247, 242, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid #E8DED3;
  padding: 1rem 0;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 24px rgba(79, 58, 45, 0.08);
}

.sticky-atc.visible {
  transform: translateY(0);
}

.sticky-atc-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 1320px;
  margin: auto;
  padding-inline: clamp(1rem, 5vw, 3rem);
}

.sticky-atc-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.sticky-atc-name {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: #4F3A2D;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sticky-atc-price {
  font-size: 0.875rem;
  color: #C67B5D;
  font-weight: 600;
}

.sticky-atc-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .sticky-atc-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .sticky-atc-actions {
    justify-content: stretch;
  }

  .sticky-atc-actions > * {
    flex: 1;
  }
}

/* ─────────────────────────────────────────────
   17. CUSTOM CURSOR
   Desktop pointer enhancement (hidden on touch)
   ───────────────────────────────────────────── */

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9998;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #C67B5D;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition:
    width 0.3s ease,
    height 0.3s ease,
    opacity 0.3s ease,
    background 0.3s ease,
    border 0.3s ease;
  mix-blend-mode: multiply;
  will-change: transform;
}

.custom-cursor.hover {
  width: 40px;
  height: 40px;
  background: rgba(198, 123, 93, 0.15);
  border: 1.5px solid #C67B5D;
}

.custom-cursor.click {
  width: 8px;
  height: 8px;
  background: #4F3A2D;
}

.custom-cursor.hidden {
  opacity: 0;
}

@media (pointer: coarse) {
  .custom-cursor {
    display: none;
  }
}

/* ─────────────────────────────────────────────
   18. NOTIFICATION TOAST
   Success / error / info toasts
   ───────────────────────────────────────────── */

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

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

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 700;
  min-width: 260px;
  max-width: 360px;
  background: #fff;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 8px 32px rgba(79, 58, 45, 0.15);
  border-left: 4px solid #C67B5D;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  animation: toastSlideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.toast.dismissing {
  animation: toastSlideOut 0.3s ease forwards;
}

.toast-success { border-color: #7BAF8E; }
.toast-error   { border-color: #C0504A; }
.toast-info    { border-color: #5D8EC6; }

@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none;
  }
}

/* ─────────────────────────────────────────────
   19. CART DRAWER
   Slide-in side panel from right
   ───────────────────────────────────────────── */

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  width: min(420px, 100vw);
  background: #FAF7F2;
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(79, 58, 45, 0.12);
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 499;
  background: rgba(30, 22, 15, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.cart-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ─────────────────────────────────────────────
   20. MOBILE NAV DRAWER
   Slide-in side panel from left
   ───────────────────────────────────────────── */

.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 490;
  width: min(340px, 100vw);
  background: #FAF7F2;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 8px 0 40px rgba(79, 58, 45, 0.12);
  overflow-y: auto;
}

.nav-drawer.open {
  transform: translateX(0);
}

/* Hamburger morphs to X */
.hamburger-line {
  display: block;
  width: 24px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.35s ease;
  transform-origin: center;
}

.nav-open .hamburger-line:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}
.nav-open .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-open .hamburger-line:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* ─────────────────────────────────────────────
   21. TOOLTIP
   ───────────────────────────────────────────── */

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  white-space: nowrap;
  background: #4F3A2D;
  color: #FAF7F2;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─────────────────────────────────────────────
   22. PRODUCT CARD HOVER EFFECTS
   ───────────────────────────────────────────── */

.product-card {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.35s ease;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(79, 58, 45, 0.14);
}

.product-card .card-img-wrap {
  overflow: hidden;
}

.product-card .card-img {
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Quick-add CTA slides up on card hover */
.product-card .card-quick-add {
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* ─────────────────────────────────────────────
   23. MARQUEE / TICKER (brand strip)
   ───────────────────────────────────────────── */

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 28s linear infinite;
}

.marquee-track:hover {
  animation-play-state: paused;
}

/* Reversed variant */
.marquee-track--reverse {
  animation-direction: reverse;
  animation-duration: 32s;
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track,
  .marquee-track--reverse {
    animation: none;
  }
}

/* ─────────────────────────────────────────────
   24. PARALLAX WRAPPER
   JS sets --parallax-offset via CSS custom prop
   ───────────────────────────────────────────── */

.parallax-el {
  will-change: transform;
  transform: translateY(var(--parallax-offset, 0px));
  transition: transform 0.1s linear;
}

/* ─────────────────────────────────────────────
   25. BUTTON BASE TRANSITIONS
   Global interactive element motion polish
   ───────────────────────────────────────────── */

a,
button,
[role="button"],
input[type="submit"],
input[type="button"] {
  transition-property: color, background-color, border-color, box-shadow,
                       opacity, transform;
  transition-duration: 0.25s;
  transition-timing-function: ease;
}

/* Accessible focus ring */
:focus-visible {
  outline: 2px solid #C67B5D;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ─────────────────────────────────────────────
   26. BACK-TO-TOP BUTTON
   ───────────────────────────────────────────── */

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 140;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #4F3A2D;
  color: #FAF7F2;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.35s ease,
              transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              background 0.25s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(79, 58, 45, 0.25);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.back-to-top:hover {
  background: #C67B5D;
  transform: translateY(-2px);
}

/* ─────────────────────────────────────────────
   27. FORM INPUT TRANSITIONS
   ───────────────────────────────────────────── */

.form-input,
.form-textarea,
.form-select {
  transition: border-color 0.25s ease,
              box-shadow 0.25s ease,
              background-color 0.25s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  box-shadow: 0 0 0 3px rgba(198, 123, 93, 0.18);
}

/* Floating label */
.form-group {
  position: relative;
}

.form-label-float {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.9375rem;
  color: #9E8572;
  transition: top 0.25s ease,
              font-size 0.25s ease,
              color 0.25s ease,
              transform 0.25s ease;
  background: #FAF7F2;
  padding-inline: 0.25rem;
}

.form-input:focus ~ .form-label-float,
.form-input:not(:placeholder-shown) ~ .form-label-float {
  top: 0;
  font-size: 0.75rem;
  color: #C67B5D;
  transform: translateY(-50%);
}

/* ─────────────────────────────────────────────
   28. RIPPLE (click effect on gallery images)
   ───────────────────────────────────────────── */

@keyframes ripple {
  from {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.4;
  }
  to {
    transform: translate(-50%, -50%) scale(4);
    opacity: 0;
  }
}

.ripple-target {
  position: relative;
  overflow: hidden;
}

.ripple-circle {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(198, 123, 93, 0.35);
  pointer-events: none;
  animation: ripple 0.6s ease-out forwards;
}

/* ─────────────────────────────────────────────
   29. UNDERLINE HOVER LINK EFFECT
   ───────────────────────────────────────────── */

.link-underline {
  position: relative;
  text-decoration: none;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.link-underline:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ─────────────────────────────────────────────
   30. UTILITY HELPERS
   ───────────────────────────────────────────── */

/* Disable all transitions/animations (fast interactions / tests) */
.no-transition,
.no-transition * {
  transition: none !important;
  animation: none !important;
}

/* Pause all animations (a11y toggle) */
.animations-paused,
.animations-paused * {
  animation-play-state: paused !important;
}

/* will-change hints — apply sparingly to animated elements */
.will-change-transform { will-change: transform; }
.will-change-opacity   { will-change: opacity;   }

/* ─────────────────────────────────────────────
   ENHANCED SEARCH OVERLAY
   ───────────────────────────────────────────── */

@keyframes searchPanelIn {
  from { opacity: 0; transform: translateY(-24px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)     scale(1);    }
}

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

/* Overlay wrapper */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 0;
}

.search-overlay.is-open {
  display: flex;
}

/* Blurred backdrop */
.search-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Search panel card */
.search-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  background: #FFFFFF;
  border-radius: 0 0 24px 24px;
  box-shadow: 0 24px 80px rgba(79, 58, 45, 0.14);
  padding: 0 0 28px;
  animation: searchPanelIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  min-height: min-content;
}

/* ── Header ── */
.search-header {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 28px 18px;
  border-bottom: 1.5px solid #EDE8E3;
}

.search-input-row {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FAF7F2;
  border-radius: 14px;
  padding: 12px 16px;
  border: 1.5px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input-row:focus-within {
  border-color: #C67B5D;
  box-shadow: 0 0 0 3px rgba(198, 123, 93, 0.12);
}

.search-icon-svg {
  flex-shrink: 0;
  color: #9E8572;
}

.search-field {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.05rem;
  font-family: 'Poppins', sans-serif;
  color: #4F3A2D;
  outline: none;
  line-height: 1.4;
  min-width: 0;
}

.search-field::placeholder { color: #B5A49A; }
.search-field::-webkit-search-cancel-button { display: none; }

.search-clear-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #9E8572;
  padding: 2px;
  display: flex;
  align-items: center;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.search-clear-btn:hover { color: #4F3A2D; background: #F2ECE4; }

.search-close-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #FAF7F2;
  border: 1.5px solid #EDE8E3;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  color: #9E8572;
  font-size: 0.7rem;
  font-family: 'Poppins', sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.search-close-btn:hover { border-color: #C67B5D; color: #C67B5D; background: #FBF3EF; }
.search-close-btn svg { flex-shrink: 0; }

/* ── Section labels & headers ── */
.search-section-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9E8572;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
}

.search-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

/* ── Categories ── */
.search-categories { padding: 22px 28px 4px; }
.search-categories > .search-section-label { display: block; margin-bottom: 14px; }
.search-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.search-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: #FAF7F2;
  border: 1.5px solid #EDE8E3;
  border-radius: 999px;
  font-size: 0.82rem;
  font-family: 'Poppins', sans-serif;
  color: #4F3A2D;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.search-chip:hover { border-color: #C67B5D; background: #FBF3EF; color: #C67B5D; }

/* ── Recent Searches ── */
.search-recents { padding: 20px 28px 4px; }

.search-clear-recents-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.75rem; color: #9E8572; font-family: 'Poppins', sans-serif;
  text-decoration: underline; padding: 0; transition: color 0.2s;
}

.search-clear-recents-btn:hover { color: #C67B5D; }

.search-recents-list { display: flex; flex-direction: column; gap: 2px; }

.search-recent-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px; cursor: pointer;
  transition: background 0.15s; border: none; background: none;
  text-align: left; width: 100%; font-family: 'Poppins', sans-serif;
  font-size: 0.88rem; color: #4F3A2D;
}

.search-recent-item:hover { background: #FAF7F2; }
.search-recent-item svg { color: #B5A49A; flex-shrink: 0; }

/* ── Live Results ── */
.search-results-wrap { padding: 20px 28px 4px; }

.search-view-all {
  font-size: 0.78rem; color: #C67B5D; text-decoration: none;
  font-family: 'Poppins', sans-serif; transition: opacity 0.2s;
}

.search-view-all:hover { opacity: 0.75; }

.search-results-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.search-result-card {
  text-decoration: none; display: flex; flex-direction: column;
  border-radius: 14px; overflow: hidden; border: 1.5px solid #EDE8E3;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  background: #FFFFFF; animation: searchResultIn 0.25s ease forwards;
  -webkit-tap-highlight-color: transparent;
}

.search-result-card:hover {
  border-color: #C67B5D; box-shadow: 0 6px 24px rgba(198, 123, 93, 0.14);
  transform: translateY(-3px);
}

.search-result-img-wrap { aspect-ratio: 4/3; overflow: hidden; background: #FAF7F2; }
.search-result-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.search-result-card:hover .search-result-img-wrap img { transform: scale(1.06); }

.search-result-body { padding: 10px 12px 12px; }

.search-result-cat {
  font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: #9E8572; font-family: 'Poppins', sans-serif; margin-bottom: 3px;
}

.search-result-name {
  font-family: 'Playfair Display', serif; font-size: 0.88rem; color: #4F3A2D;
  line-height: 1.3; margin-bottom: 5px; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.search-result-price {
  font-size: 0.82rem; font-weight: 600; color: #C67B5D; font-family: 'Poppins', sans-serif;
}

/* ── No Results ── */
.search-no-results { padding: 40px 28px; text-align: center; }
.search-no-results-icon { font-size: 3rem; margin-bottom: 12px; }
.search-no-results-title { font-family: 'Playfair Display', serif; font-size: 1.25rem; color: #4F3A2D; margin: 0 0 8px; }
.search-no-results-sub { font-size: 0.9rem; color: #9E8572; margin: 0; font-family: 'Poppins', sans-serif; }
.search-no-results-sub a { color: #C67B5D; text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .search-panel { border-radius: 0 0 20px 20px; max-width: 100%; }
  .search-header {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%; padding: 14px 16px 14px; gap: 8px; }
  .search-input-row {
  min-width: 0; padding: 10px 13px; }
  .search-field {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden; font-size: 1rem; }
  .search-close-btn span { display: none; }
  .search-close-btn { padding: 8px; }
  .search-categories, .search-recents, .search-results-wrap, .search-no-results { padding-left: 16px; padding-right: 16px; }
  .search-results-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .search-result-name { font-size: 0.82rem; }
}

@media (max-width: 576px) {
  /* Convert grid to list view for mobile */
  .search-results-grid { grid-template-columns: 1fr; gap: 10px; }
  .search-result-card { flex-direction: row; align-items: center; }
  .search-result-img-wrap { width: 85px; height: 85px; flex-shrink: 0; }
  .search-result-body { padding: 10px 12px; flex: 1; }
  .search-result-name { font-size: 0.9rem; -webkit-line-clamp: 1; }
  
  .search-chips { gap: 6px; }
  .search-chip { font-size: 0.75rem; padding: 6px 12px; }
}

@media (max-width: 991px) {
  #back-to-top, .back-to-top { display: none !important; }
}
