/* ============================================
   EXOTIC FIBER — MAIN STYLESHEET
   ============================================ */

/* --- Fonts --- */
@font-face {
  font-family: "Figtree";
  src: url("../fonts/Figtree[wght].ttf") format("truetype");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("../fonts/Figtree-Italic[wght].ttf") format("truetype");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}

body {
  font-family: "Figtree", sans-serif;
}

/* --- Announcement Bar Marquee --- */
@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}
.marquee-track {
  animation: marquee 30s linear infinite;
  display: flex;
  width: max-content;
}

/* --- Fiber Roving Marquee (homepage) --- */
.animate-marquee {
  animation: marquee 25s linear infinite;
  display: flex;
  width: max-content;
  flex-shrink: 0;
}

/* Pause on hover — fallback for Tailwind group/marquee variant */
.group\/marquee:hover .animate-marquee {
  animation-play-state: paused;
}

/* Hero Swiper nav arrows */
.hero-prev,
.hero-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: background 0.3s;
}
.hero-prev {
  left: 0.5rem;
}
.hero-next {
  right: 0.5rem;
}
.hero-prev:hover,
.hero-next:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* Swiper pagination dots */
.hero-swiper .swiper-pagination-bullet {
  background: rgba(255, 255, 255, 0.5);
  opacity: 1;
}
.hero-swiper .swiper-pagination-bullet-active {
  background: #dedac8;
}

/* Fix Hero Swiper Fade Overlap */
.hero-swiper {
  overflow: hidden !important;
}

.hero-swiper .swiper-slide {
  opacity: 0 !important;
  visibility: hidden;
  transition:
    opacity 0.8s ease-in-out,
    visibility 0.8s ease-in-out;
  pointer-events: none;
  z-index: 1;
}

.hero-swiper .swiper-slide-active {
  opacity: 1 !important;
  visibility: visible;
  pointer-events: auto;
  z-index: 10;
}

/* --- Header Icon Colors --- */
.header-icon-color {
  color: #1a1a1a;
  transition: all 0.3s ease;
}

.is-home #site-header:not(.scrolled) .header-icon-color {
  color: white;
}

.nav-link-btn {
  color: #1a1a1a;
  transition: all 0.3s ease;
}

.is-home #site-header:not(.scrolled) .nav-link-btn {
  color: white;
}

.is-home #site-header:not(.scrolled) .nav-link-btn:hover {
  color: #dedac8;
}

#site-header.scrolled .nav-link-btn,
#site-header.scrolled .header-icon-color {
  color: #1a1a1a !important;
}

#site-header.scrolled .nav-link-btn:hover,
#site-header.scrolled .header-icon-color:hover {
  color: #8c8a7b !important;
}

/* Smooth header transitions */
#site-header {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border-bottom: 1px solid transparent;
}

#site-header.scrolled {
  position: fixed !important;
  top: 0 !important;
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-underline {
  height: 1.5px !important;
  background-color: currentColor;
  opacity: 0.8;
  bottom: -2px !important;
}

#header-logo {
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#site-header.scrolled #header-logo {
  width: 7rem !important;
}

/* --- Mega Menu --- */
#mega-menu-container {
  display: block;
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

#mega-menu-container.active {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#mega-menu-container {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
}

/* --- Cart Drawer --- */
#cart-drawer.open {
  transform: translateX(0) !important;
}
#cart-overlay.active,
#mobile-overlay.active {
  opacity: 1 !important;
}

/* --- Auth / Search Modals --- */
#search-modal,
#auth-modal {
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  visibility: hidden;
}

#search-modal.active,
#auth-modal.active {
  display: flex !important;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

#search-modal > div:last-child,
#auth-modal > div:last-child {
  transform: scale(0.95) translateY(10px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#search-modal.active > div:last-child,
#auth-modal.active > div:last-child {
  transform: scale(1) translateY(0);
}

/* --- Mobile Menu --- */
#mobile-menu.open {
  transform: translateX(0) !important;
}

#mobile-menu.open .close-mobile {
  animation: slide-in-rtl 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

#mobile-menu.open .close-mobile:nth-child(1) {
  animation-delay: 0.1s;
}
#mobile-menu.open .close-mobile:nth-child(2) {
  animation-delay: 0.15s;
}
#mobile-menu.open .close-mobile:nth-child(3) {
  animation-delay: 0.2s;
}

@keyframes slide-in-rtl {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* --- Hero Section --- */
.hero-section {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 900px;
  background-color: #1a1a1a;
  overflow: hidden;
}
.hero-section .hero-bg {
  position: absolute;
  inset: 0;
}
.hero-section .hero-bg img {
  width: 100%;
  height: 115%;
  object-fit: cover;
  opacity: 0.9;
  transform: scale(1.05);
}
.hero-section .hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.8),
    rgba(0, 0, 0, 0.5),
    transparent
  );
}
.hero-section .hero-gradient-top {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.6),
    transparent 50%,
    rgba(0, 0, 0, 0.3)
  );
}

/* Scroll hint bounce animation */
@keyframes bounce-y {
  0%,
  100% {
    transform: translateY(0) translateX(-50%);
  }
  50% {
    transform: translateY(10px) translateX(-50%);
  }
}
.scroll-hint {
  animation: bounce-y 2s ease-in-out infinite;
}

/* --- Category Grid accordion --- */
.category-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border-radius: 1.5rem;
  height: 450px;
  flex: 1;
  transition: flex 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}
@media (min-width: 1024px) {
  .category-item {
    height: auto;
  }
  .category-item.active {
    flex: 3 !important;
  }
}
.category-item .cat-desc {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.4s ease,
    opacity 0.3s ease;
}
.category-item.active .cat-desc {
  max-height: 200px;
  opacity: 1;
}
.category-item .cat-icon {
  transition: all 0.3s;
}
.category-item.active .cat-icon {
  background-color: #dedac8;
  color: black;
  border-color: transparent;
}

/* --- Product Card --- */
.product-card {
  position: relative;
}
.product-card .product-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  width: 100%;
}
.product-card:hover .product-actions {
  transform: translateY(0);
}
.product-card:hover .product-overlay {
  opacity: 1;
}
.product-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.3s;
}
.product-card img {
  transition: transform 0.5s ease;
}
.product-card:hover img {
  transform: scale(1.05);
}

/* --- Fade-in on scroll --- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
.fade-in-delay-1 {
  transition-delay: 0.1s;
}
.fade-in-delay-2 {
  transition-delay: 0.2s;
}
.fade-in-delay-3 {
  transition-delay: 0.3s;
}
.fade-in-delay-4 {
  transition-delay: 0.4s;
}

/* --- Process / Story Section --- */
.process-line {
  position: absolute;
  top: 50%;
  left: calc(50% + 2rem);
  right: calc(-50% + 2rem);
  height: 1px;
  background: linear-gradient(to right, #dedac8, transparent);
}

/* --- Newsletter section sparkle --- */
@keyframes float-up {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.1;
  }
  50% {
    transform: translateY(-40px);
    opacity: 0.3;
  }
}
.sparkle-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #dedac8;
  border-radius: 50%;
  animation: float-up 4s ease-in-out infinite;
}

/* --- Footer accordion (mobile) --- */
.footer-accordion-content {
  overflow: hidden;
  transition:
    max-height 0.3s ease,
    opacity 0.3s ease;
}

/* Show on desktop always */
@media (min-width: 768px) {
  .footer-accordion-content {
    display: block !important;
    max-height: none !important;
    opacity: 1 !important;
  }
}

/* --- Swiper customisation --- */
.swiper-pagination-bullet {
  background: rgba(255, 255, 255, 0.3) !important;
  opacity: 1 !important;
  width: 8px !important;
  height: 8px !important;
}
.swiper-pagination-bullet-active {
  background: white !important;
}

/* --- Shop Grid --- */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .shop-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1280px) {
  .shop-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* --- Filter Sidebar --- */
.filter-sidebar {
  position: sticky;
  top: 160px;
  height: fit-content;
}

/* --- Wishlist heart fill toggle --- */
.wishlist-btn.wishlisted svg {
  fill: #555348;
  stroke: #555348;
}

/* --- Toast Notifications --- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  background: #1a1a1a;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(100px);
  opacity: 0;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.success {
  background: #166534;
}
.toast.error {
  background: #991b1b;
}

/* --- Quick View Modal --- */
#quick-view-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 2100;
  opacity: 0;
  transition: opacity 0.4s ease;
}
#quick-view-modal.active {
  display: flex !important;
  opacity: 1;
}
#qv-overlay,
.quick-view-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: -1;
}
.quick-view-container {
  position: relative;
  width: 100%;
  max-width: 1000px;
  background: #ffffff;
  border-radius: 1.5rem;
  box-shadow: 0 40px 100px -15px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}
#quick-view-modal.active .quick-view-container {
  transform: scale(1);
}
.quick-view-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 50;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border: 1px solid #f0f0f0;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.quick-view-close:hover {
  background: #000;
  color: #fff;
  transform: rotate(90deg) scale(1.1);
}
.qv-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
}
.qv-content > div {
  width: 100%;
}
/* Smooth Marquee Transition */
.roving-swiper .swiper-slide {
  width: 320px !important;
}
.roving-swiper .swiper-wrapper {
  transition-timing-function: linear !important;
  will-change: transform;
}
@media (max-width: 767px) {
  .quick-view-container {
    height: 92vh;
    max-height: none;
    top: 50%;
  }
  .qv-content > div {
    flex-direction: column !important;
    overflow-y: auto;
  }
  .qv-content > div > div {
    width: 100% !important;
    height: auto !important;
  }
}

/* --- Quantity Stepper --- */
.qty-stepper {
  display: flex;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  overflow: hidden;
  width: fit-content;
}
.qty-stepper button {
  padding: 0.5rem 0.875rem;
  background: white;
  cursor: pointer;
  font-size: 1rem;
  color: #374151;
  transition: background 0.2s;
}
.qty-stepper button:hover {
  background: #f9f8f6;
}
.qty-stepper span {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  min-width: 3rem;
  text-align: center;
}

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.breadcrumb a {
  color: inherit;
}
.breadcrumb a:hover {
  color: #1a1a1a;
}
.breadcrumb span {
  color: #d1d5db;
}

/* --- Sales notification badge --- */
@keyframes slide-in-left {
  from {
    transform: translateX(-120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes slide-out-left {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(-120%);
    opacity: 0;
  }
}
.sales-notif {
  animation: slide-in-left 0.5s ease forwards;
}
.sales-notif.hide {
  animation: slide-out-left 0.5s ease forwards;
}

/* --- Floating CTA --- */
#floating-cta {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 50;
  transition:
    opacity 0.3s,
    transform 0.3s;
}
#floating-cta.hidden-cta {
  opacity: 0;
  pointer-events: none;
  transform: translateY(1rem);
}

/* --- Page transitions --- */
.page-content {
  animation: fadeInPage 0.4s ease;
}
@keyframes fadeInPage {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
  background: #c5c3b7;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #8c8a7b;
}

/* --- Range slider (for price filter) --- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #555348;
  border-radius: 50%;
  cursor: pointer;
}

/* --- Star Rating --- */
.star-rating {
  display: flex;
  gap: 2px;
  color: #dedac8;
}
.star-rating .star {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.star-rating .star.empty {
  fill: #e5e7eb;
}

/* --- Review form stars --- */
.rating-input label {
  cursor: pointer;
  font-size: 1.5rem;
  color: #e5e7eb;
  transition: color 0.15s;
}
.rating-input input:checked ~ label,
.rating-input label:hover,
.rating-input label:hover ~ label {
  color: #dedac8;
}
.rating-input {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

/* --- Checkout Steps --- */
.checkout-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  opacity: 0.4;
}
.checkout-step.active {
  opacity: 1;
}
.checkout-step.completed {
  opacity: 0.7;
}
.checkout-step-num {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}
.checkout-step.completed .checkout-step-num {
  background: #1a1a1a;
  color: white;
  border-color: #1a1a1a;
}

/* --- No Scrollbar --- */
.no-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* --- Spinner --- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- Custom Animations --- */
@keyframes bounce-short {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}
.animate-bounce-short {
  animation: bounce-short 1s ease-in-out infinite;
}
