/**
 * WP Carousel Pro — Core & Styling
 * Performance-tuned Vanilla CSS
 */

:root {
  --wcp-primary: #6366f1;
  --wcp-primary-hover: #4f46e5;
  --wcp-text: #1e293b;
  --wcp-text-muted: #64748b;
  --wcp-bg-card: rgba(255, 255, 255, 0.85);
  --wcp-border-radius: 16px;
  --wcp-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  --wcp-shadow-hover: 0 20px 35px -5px rgba(99, 102, 241, 0.12), 0 10px 12px -6px rgba(0, 0, 0, 0.04);
}

.wcp-carousel-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 1rem 0.5rem 3rem 0.5rem;
  background: transparent;
  box-sizing: border-box;
}

/* Core Scroll Snap Track */
.wcp-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--wcp-item-width, 280px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: var(--wcp-gap, 1.5rem);
  padding: 1rem 0;
  margin: 0;
  
  /* Visual Scrollbar Hiding */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE */
  
  /* Critical Performance */
  contain: layout style;
  will-change: scroll-position;
}

.wcp-carousel::-webkit-scrollbar {
  display: none;
}

.wcp-carousel-item {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  transform: translateZ(0); /* Prevent repaints on scroll */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--wcp-bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--wcp-border-radius);
  box-shadow: var(--wcp-shadow);
  padding: 1.25rem;
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
              box-shadow 0.35s ease, 
              border-color 0.35s ease;
  overflow: hidden;
  box-sizing: border-box;
}

.wcp-carousel-item:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: var(--wcp-shadow-hover);
}

/* Thumbnail */
.wcp-card-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: calc(var(--wcp-border-radius) - 4px);
  overflow: hidden;
  background: #f1f5f9;
  margin-bottom: 1.2rem;
}

.wcp-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.wcp-carousel-item:hover .wcp-card-thumbnail img {
  transform: scale(1.08);
}

/* Meta & Badges */
.wcp-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.725rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(225, 29, 72, 0.35);
  z-index: 2;
  pointer-events: none;
}

/* Title, Pricing & Excerpts */
.wcp-card-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 0.5rem;
}

.wcp-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
  color: var(--wcp-text);
  transition: color 0.25s ease;
}

.wcp-card-title a {
  text-decoration: none;
  color: inherit;
}

.wcp-card-title a:hover {
  color: var(--wcp-primary);
}

.wcp-card-excerpt {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--wcp-text-muted);
  margin: 0 0 1rem 0;
}

/* Arrow controls */
.wcp-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s ease;
  color: var(--wcp-text);
}

.wcp-nav-btn:hover {
  background: var(--wcp-primary);
  color: #ffffff;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

.wcp-nav-btn svg {
  fill: currentColor;
  transition: transform 0.2s ease;
}

.wcp-nav-btn.wcp-prev {
  left: -20px;
}
.wcp-nav-btn.wcp-prev:active svg {
  transform: translateX(-4px);
}

.wcp-nav-btn.wcp-next {
  right: -20px;
}
.wcp-nav-btn.wcp-next:active svg {
  transform: translateX(4px);
}

/* Dots / Pagination */
.wcp-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 1.5rem;
  width: 100%;
}

.wcp-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
  border: none;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
              background-color 0.3s ease, 
              width 0.3s ease;
  padding: 0;
}

.wcp-dot.active {
  background: var(--wcp-primary);
  width: 24px;
  border-radius: 12px;
  transform: scale(1.1);
}
