/* ==========================================================================
   KALORA - LUXURY HANDMADE CROCHET
   ========================================================================== */

/* --- CSS VARIABLES --- */
:root {
  /* Brand Colors */
  --primary: #1D4B6F;
  --primary-soft: #2c6491;
  --bg-color: #FDFBF7; /* Soft warm white */
  --bg-tint: #F2F5F8; /* Soft blue tint */
  --accent-warm: #D9C39F;
  --accent-soft: #E6D2AF;
  --gold-shadow: #B89E74;
  
  /* Text */
  --text-dark: #2C3E50;
  --text-muted: #5b6f82;
  
  /* Typography */
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Poppins', sans-serif;
  
  /* Utilities */
  --glass-bg: rgba(253, 251, 247, 0.85);
  --glass-border: rgba(255, 255, 255, 0.6);
  --shadow-soft: 0 10px 30px rgba(184, 158, 116, 0.15);
  --shadow-hover: 0 15px 40px rgba(29, 75, 111, 0.25);
  --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- RESET & ACCESSIBILITY --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
  object-fit: cover;
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4, h5, .logo {
  font-family: var(--font-heading);
  color: var(--primary);
  font-weight: 600;
}

.section-title {
  text-align: center;
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: var(--accent-soft);
  margin-bottom: 3rem;
  font-weight: 300;
}

/* --- BUTTONS --- */
.btn {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  z-index: 1;
  border: none;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-warm), var(--accent-soft));
  color: var(--primary);
  box-shadow: 0 4px 15px rgba(184, 158, 116, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(184, 158, 116, 0.5);
  color: var(--primary);
}

.btn-secondary {
  background: transparent;
  color: var(--bg-color);
  border: 1px solid var(--bg-color);
  backdrop-filter: blur(5px);
}

.btn-secondary:hover {
  background: var(--bg-color);
  color: var(--primary);
}

/* --- TOP ANNOUNCEMENT BAR --- */
.announcement-bar {
  background-color: #12334e;
  color: var(--bg-color);
  padding: 8px 0;
  font-size: 0.85rem;
  letter-spacing: 1px;
  overflow: hidden;
  position: relative;
  white-space: nowrap;
}

.marquee-content {
  display: inline-block;
  animation: marquee 20s linear infinite;
}

@keyframes marquee {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* --- NAVIGATION --- */
header {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 2px 20px rgba(0,0,0,0.03);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 2rem;
  letter-spacing: 2px;
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-links li a {
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
}

.nav-links li a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -4px;
  left: 0;
  background-color: var(--primary);
  transition: var(--transition);
}

.nav-links li a:hover::after {
  width: 100%;
}

/* --- SECTION DIVIDERS (WAVES) --- */
.wave-divider {
  position: relative;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.wave-divider svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 60px;
}

.wave-divider .shape-fill {
  fill: var(--primary);
}

.wave-divider-light .shape-fill {
  fill: var(--bg-color);
}

/* --- HERO SECTION --- */
.hero {
  position: relative;
  height: 90vh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary);
}

.carousel {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 1;
}
/* --- 10 IMAGE SLIDESHOW (30 seconds total, 3s each) --- */

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  /* Total time changed to 30s */
  animation: fade-slide 30s infinite; 
}

/* Image scaling & styling stays the same */
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide::after {
  content: '';
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}

/* Setup the 3-second delay for all 10 slides */
.slide:nth-child(1) { animation-delay: 0s; }
.slide:nth-child(2) { animation-delay: 3s; }
.slide:nth-child(3) { animation-delay: 6s; }
.slide:nth-child(4) { animation-delay: 9s; }
.slide:nth-child(5) { animation-delay: 12s; }
.slide:nth-child(6) { animation-delay: 15s; }
.slide:nth-child(7) { animation-delay: 18s; }
.slide:nth-child(8) { animation-delay: 21s; }
.slide:nth-child(9) { animation-delay: 24s; }
.slide:nth-child(10) { animation-delay: 27s; }

/* The Keyframes: Each slide is visible for 10% of the 30-second loop */
@keyframes fade-slide {
  0% { opacity: 0; transform: scale(1.05); }
  1.5% { opacity: 1; transform: scale(1.04); } /* Fades in smoothly */
  10% { opacity: 1; transform: scale(1.02); }  /* Stays visible until 10% */
  11.5% { opacity: 0; transform: scale(1); }   /* Fades out smoothly */
  100% { opacity: 0; }                         /* Stays hidden until its turn comes again */
}
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--bg-color);
  max-width: 800px;
  padding: 0 20px;
}

.hero-content h1 {
  font-size: 4.5rem;
  color: var(--bg-color);
  margin-bottom: 1rem;
  text-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.hero-content p {
  font-size: 1.2rem;
  font-weight: 300;
  margin-bottom: 2.5rem;
  letter-spacing: 1px;
}

.hero-buttons {
  display: flex; gap: 20px; justify-content: center;
}

/* --- BEST SELLERS (BOLD SECTION) --- */
.best-sellers-wrapper {
  background-color: var(--primary);
  padding: 60px 0 20px;
}

.best-sellers-wrapper .section-title,
.best-sellers-wrapper .section-subtitle {
  color: var(--bg-color);
}

.best-sellers-wrapper .section-subtitle {
  color: var(--accent-warm);
}

.product-section {
  padding: 20px 20px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.product-card {
  background: var(--bg-color);
  border-radius: 16px;
  padding: 15px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

.product-img {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4/5;
  margin-bottom: 15px;
  position: relative;
}

.product-img img {
  width: 100%;
  height: 100%;
  transition: var(--transition);
}

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

.product-info {
  text-align: center;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-info h3 {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 5px;
}

.product-price {
  color: var(--gold-shadow);
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 15px;
}

.btn-order {
  width: 100%;
  padding: 10px;
  font-size: 0.85rem;
}

/* --- COLLECTIONS --- */
.collections {
  padding: 80px 20px 40px;
  max-width: 1200px;
  margin: 0 auto;
  background-color: var(--bg-color);
}

.collection-grid {
  display: flex;
  gap: 30px;
  padding-bottom: 20px;
}

.category-card {
  flex: 1;
  text-align: center;
  cursor: pointer;
}

.category-img-wrap {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 1;
  margin-bottom: 15px;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}

.category-img-wrap img {
  width: 100%;
  height: 100%;
  transition: var(--transition);
}

.category-card:hover .category-img-wrap {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

.category-card:hover .category-img-wrap img {
  transform: scale(1.1);
}

.category-card h3 {
  font-size: 1.2rem;
  transition: var(--transition);
}

.category-card:hover h3 {
  color: var(--gold-shadow);
}

/* --- REVIEWS (IMAGES ONLY) --- */
.reviews-wrapper {
  background-color: var(--bg-tint);
  padding: 60px 0 80px;
}

.reviews-container {
  max-width: 400px;
  margin: 0 auto;
  height: 500px;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
  mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
}

.reviews-track {
  display: flex;
  flex-direction: column;
  gap: 30px;
  animation: scroll-vertical 20s linear infinite;
}

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

.review-card {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  cursor: pointer;
}

.review-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: block;
}

.review-card:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-hover);
}

@keyframes scroll-vertical {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

/* --- SHIPPING & PROCESSING INFO --- */
.shipping-wrapper {
  padding: 80px 20px 40px;
  background-color: var(--bg-color);
  max-width: 1200px;
  margin: 0 auto;
}

.shipping-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 40px;
}

.shipping-card {
  background: #fff;
  padding: 40px 30px;
  border-radius: 20px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(217, 195, 159, 0.2);
  transition: var(--transition);
}

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

.shipping-card h3 {
  color: var(--gold-shadow);
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: 15px;
}

.shipping-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* --- ABOUT & CONTACT --- */
.about-contact-wrapper {
  background-color: var(--bg-color);
  padding: 40px 20px 80px;
}

.about-contact {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-img {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  position: relative;
  height: 300px;
  width: 300px;
}

.about-img::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border: 2px solid var(--accent-warm);
  border-radius: 20px;
  transform: translate(15px, 15px);
  z-index: -1;
}

.contact-info {
  background: #fff;
  padding: 40px;
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
}

.contact-item {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  font-size: 1.05rem;
}

.contact-item strong {
  color: var(--primary);
  width: 100px;
}

/* --- FOOTER --- */
footer {
  background-color: var(--primary);
  color: var(--bg-color);
  padding: 60px 20px 20px;
  position: relative;
}

.footer-top {
  border-top: 1px solid rgba(217, 195, 159, 0.2);
  position: absolute;
  top: 0; left: 10%; right: 10%;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h4 {
  color: var(--accent-warm);
  margin-bottom: 20px;
  font-size: 1.2rem;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a {
  opacity: 0.8;
}

.footer-col ul li a:hover {
  opacity: 1;
  color: var(--accent-warm);
  padding-left: 5px;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.9rem;
  opacity: 0.8;
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 992px) {
  .hero-content h1 { font-size: 3.5rem; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .shipping-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  
  .hero-content h1 { font-size: 2.8rem; }
  .hero-content p { font-size: 1rem; }
  .hero-buttons { flex-direction: column; }
  
  .collection-grid {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 30px;
  }
  
  .collection-grid::-webkit-scrollbar { display: none; }
  
  .category-card {
    min-width: 45%;
    flex: 0 0 45%;
    scroll-snap-align: start;
  }

  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
  .shipping-grid { grid-template-columns: 1fr; gap: 20px; }
  
  .about-contact { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 480px) {
  .category-card { min-width: 60%; flex: 0 0 60%; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .contact-item { flex-direction: column; align-items: flex-start; }
}

/* --- SCROLL REVEAL ANIMATION (BEST SELLERS) --- */

/* 1. Define the slide-up keyframes */
@keyframes slideUpOnScroll {
  0% {
    opacity: 0;
    transform: translateY(80px); /* Starts 80px lower */
  }
  100% {
    opacity: 1;
    transform: translateY(0); /* Rests at normal position */
  }
}

/* 2. Apply the scroll-driven animation specifically to Best Seller cards */
@supports (animation-timeline: view()) {
  #best-sellers .product-card {
    /* Bind the animation to the element */
    animation: slideUpOnScroll linear both;
    
    /* Link the animation strictly to the scroll timeline */
    animation-timeline: view();
    
    /* Control exactly when it starts and ends during scroll */
    /* Starts fading in when it enters the viewport, finishes when it's 25% visible */
    animation-range: entry 5% cover 25%; 
  }
}
