/**
 * PixelBorsch Core - Premium Hero Slider Module
 * Description: Premium hero slider with 5 unique presets, animations, and responsive design.
 */

:root {
  /* Colors */
  --pb-hs-gold: #C5A059;
  --pb-hs-gold-hover: #D9B36C;
  --pb-hs-dark: #1a1a1a;
  --pb-hs-light: #ffffff;
  --pb-hs-gray: #5a5a5a;
  --pb-hs-bg-cream: #f5f0e6;
  
  /* Typography - Inherits naturally from theme and Elementor */
  --pb-hs-font-sans: inherit;
  --pb-hs-font-serif: inherit;
  
  /* Layout */
  --pb-hs-height: 600px;
  --pb-hs-height-mobile: 400px;
  --pb-hs-z-index-bg: 1;
  --pb-hs-z-index-overlay: 2;
  --pb-hs-z-index-content: 3;
  --pb-hs-z-index-nav: 4;
  
  /* Transitions */
  --pb-hs-ease: cubic-bezier(0.25, 1, 0.5, 1);
  --pb-hs-duration: 0.7s;
}

/* 1. Core Slider Layout */
.pb-hero-slider {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: var(--pb-hs-height);
  font-family: inherit;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

.pb-hero-slider:active,
.pb-hero-slider.is-grabbing {
  cursor: grabbing !important;
}

.pb-hero-slider img,
.pb-hero-slider a {
  -webkit-user-drag: none;
  user-drag: none;
}

.pb-hero-slider__track {
  width: 100%;
  height: 100%;
  position: relative;
}

.pb-hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  visibility: hidden;
  opacity: 0;
  z-index: 1;
}

.pb-hero-slide.is-active {
  visibility: visible;
  opacity: 1;
  z-index: 2;
}

/* Transitions */
.pb-hero-slider--fade .pb-hero-slide {
  transition: opacity var(--pb-hs-duration) var(--pb-hs-ease), visibility var(--pb-hs-duration) var(--pb-hs-ease);
}

.pb-hero-slider--slide .pb-hero-slide {
  transform: translateX(100%);
  transition: transform var(--pb-hs-duration) var(--pb-hs-ease), visibility var(--pb-hs-duration) var(--pb-hs-ease), opacity 0s var(--pb-hs-duration);
}

.pb-hero-slider--slide .pb-hero-slide.is-leaving {
  transform: translateX(-100%);
  opacity: 1;
  visibility: visible;
  transition: transform var(--pb-hs-duration) var(--pb-hs-ease), visibility var(--pb-hs-duration) var(--pb-hs-ease);
}

.pb-hero-slider--slide .pb-hero-slide.is-active {
  transform: translateX(0);
  transition: transform var(--pb-hs-duration) var(--pb-hs-ease), visibility 0s, opacity 0s;
}

/* 2. Slide Content */
.pb-hero-slide__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center bottom;
  z-index: var(--pb-hs-z-index-bg);
}

.pb-hero-slide__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: var(--pb-hs-z-index-overlay);
  pointer-events: none;
}

.pb-hero-slide__content {
  position: relative;
  z-index: var(--pb-hs-z-index-content);
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  padding: 0 5%;
  max-width: 1400px;
  margin: 0 auto;
}

.pb-hero-slide__title {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 1rem 0;
  opacity: 0;
}

.pb-hero-slide__title em,
.pb-hero-slide__title i {
  font-family: inherit;
  font-style: italic;
  font-weight: 400;
  display: block;
  font-size: 1.1em;
}

.pb-hero-slide__subtitle {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.5;
  margin: 0 0 2rem 0;
  max-width: 600px;
  opacity: 0;
}

.pb-hero-slide__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 2.5rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
  cursor: pointer;
  border: none;
  width: fit-content;
  opacity: 0;
}

.pb-hero-slide__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(197, 160, 89, 0.25);
}

.pb-hero-slide__btn:active {
  transform: translateY(0);
}

.pb-hero-slide__btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform 0.15s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
}

.pb-hero-slide__btn-icon svg {
  width: 1.1em;
  height: 1.1em;
  fill: currentColor;
}

.pb-hero-slide__btn-icon i {
  font-size: 1.1em;
  color: currentColor;
}

.pb-hero-slide__btn:hover .pb-hero-slide__btn-icon {
  transform: none !important;
}

/* 3. Content Positioning */
.pb-hero-slide__content--left {
  align-items: flex-start;
  text-align: left;
  padding-left: 8%;
}

.pb-hero-slide__content--center {
  align-items: center;
  text-align: center;
  padding: 0 5%;
}
.pb-hero-slide__content--center .pb-hero-slide__subtitle {
  margin-left: auto;
  margin-right: auto;
}

.pb-hero-slide__content--right {
  align-items: flex-end;
  text-align: right;
  padding-right: 8%;
}

/* 4. Navigation */
.pb-hero-slider__arrows {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  z-index: var(--pb-hs-z-index-nav);
  pointer-events: none;
  padding: 0 2%;
}

.pb-hero-slider__arrow {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  color: #1a1a1a !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
}

.pb-hero-slider__arrow svg {
  width: 24px !important;
  height: 24px !important;
  stroke: currentColor !important;
  stroke-width: 2.5px !important;
  fill: none !important;
  display: block !important;
}

.pb-hero-slider__arrow:hover {
  background: #C5A059 !important;
  color: #ffffff !important;
  transform: scale(1.1) !important;
  box-shadow: 0 6px 20px rgba(197, 160, 89, 0.4) !important;
}

.pb-hero-slider__dots {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: var(--pb-hs-z-index-nav);
}

.pb-hero-slider__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  border: none;
  padding: 0;
  transition: all 0.3s ease;
}

.pb-hero-slider__dot:hover {
  background: rgba(255, 255, 255, 0.8);
}

.pb-hero-slider__dot.is-active {
  width: 30px;
  border-radius: 5px;
  background: var(--pb-hs-gold);
}

/* 5. Presets */

/* Preset 1: Elegance */
.pb-hero-slider--elegance .pb-hero-slide__overlay {
  background: linear-gradient(90deg, rgba(245,240,230,0.3) 0%, rgba(245,240,230,0) 45%);
  pointer-events: none;
}
.pb-hero-slider--elegance .pb-hero-slide__title {
  color: var(--pb-hs-dark);
}
.pb-hero-slider--elegance .pb-hero-slide__title em,
.pb-hero-slider--elegance .pb-hero-slide__title i {
  color: var(--pb-hs-gold);
}
.pb-hero-slider--elegance .pb-hero-slide__subtitle {
  color: var(--pb-hs-gray);
}
.pb-hero-slider--elegance .pb-hero-slide__btn {
  background: transparent;
  border: 2px solid var(--pb-hs-gold);
  color: var(--pb-hs-gold);
  border-radius: 8px;
}
.pb-hero-slider--elegance .pb-hero-slide__btn:hover {
  background: var(--pb-hs-gold);
  color: var(--pb-hs-light);
}

/* Preset 2: Centered */
.pb-hero-slider--centered .pb-hero-slide__overlay {
  background: rgba(0,0,0,0.5);
}
.pb-hero-slider--centered .pb-hero-slide__content {
  color: var(--pb-hs-light);
}
.pb-hero-slider--centered .pb-hero-slide__title {
  color: var(--pb-hs-light);
}
.pb-hero-slider--centered .pb-hero-slide__btn {
  background: var(--pb-hs-light);
  color: var(--pb-hs-dark);
  border-radius: 4px;
}
.pb-hero-slider--centered .pb-hero-slide__btn:hover {
  background: var(--pb-hs-gold);
  color: var(--pb-hs-light);
}

/* Preset 3: Minimal */
.pb-hero-slider--minimal .pb-hero-slide__overlay {
  display: none;
}
.pb-hero-slider--minimal .pb-hero-slide__content {
  justify-content: flex-end;
  padding-bottom: 8%;
}
.pb-hero-slider--minimal .pb-hero-slide__title,
.pb-hero-slider--minimal .pb-hero-slide__subtitle {
  color: var(--pb-hs-light);
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  font-weight: 300;
}
.pb-hero-slider--minimal .pb-hero-slide__btn {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--pb-hs-light);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50px;
}
.pb-hero-slider--minimal .pb-hero-slide__btn:hover {
  background: rgba(255,255,255,0.3);
}

/* Preset 4: Split */
.pb-hero-slider--split .pb-hero-slide {
  display: flex;
}
.pb-hero-slider--split .pb-hero-slide__bg {
  position: relative;
  width: 50%;
  flex-shrink: 0;
  order: 2;
}
.pb-hero-slider--split .pb-hero-slide__content {
  width: 50%;
  background: var(--pb-hs-bg-cream);
  order: 1;
  padding: 0 5%;
}
.pb-hero-slider--split .pb-hero-slide__overlay {
  display: none;
}
.pb-hero-slider--split .pb-hero-slide__title {
  color: var(--pb-hs-dark);
}
.pb-hero-slider--split .pb-hero-slide__subtitle {
  color: var(--pb-hs-gray);
}
.pb-hero-slider--split .pb-hero-slide__btn {
  background: var(--pb-hs-gold);
  color: var(--pb-hs-light);
}
.pb-hero-slider--split .pb-hero-slide__btn:hover {
  background: var(--pb-hs-gold-hover);
}

/* Preset 5: Dark */
.pb-hero-slider--dark .pb-hero-slide__overlay {
  background: rgba(10,10,20,0.75);
}
.pb-hero-slider--dark .pb-hero-slide__title,
.pb-hero-slider--dark .pb-hero-slide__subtitle {
  color: var(--pb-hs-light);
}
.pb-hero-slider--dark .pb-hero-slide__title em,
.pb-hero-slider--dark .pb-hero-slide__title i {
  color: var(--pb-hs-gold);
  text-shadow: 0 0 15px rgba(197, 160, 89, 0.5);
}
.pb-hero-slider--dark .pb-hero-slide__btn {
  background: transparent;
  border: 1px solid var(--pb-hs-gold);
  color: var(--pb-hs-gold);
  box-shadow: 0 0 15px rgba(197, 160, 89, 0.2), inset 0 0 15px rgba(197, 160, 89, 0.2);
}
.pb-hero-slider--dark .pb-hero-slide__btn:hover {
  background: var(--pb-hs-gold);
  color: var(--pb-hs-dark);
  box-shadow: 0 0 25px rgba(197, 160, 89, 0.5);
}
.pb-hero-slider--dark .pb-hero-slider__arrow {
  border-color: var(--pb-hs-gold);
  color: var(--pb-hs-gold);
  box-shadow: 0 0 10px rgba(197, 160, 89, 0.3);
}
.pb-hero-slider--dark .pb-hero-slider__arrow:hover {
  box-shadow: 0 0 20px rgba(197, 160, 89, 0.6);
  background: rgba(197, 160, 89, 0.1);
}
.pb-hero-slider--dark .pb-hero-slider__dot.is-active {
  box-shadow: 0 0 10px rgba(197, 160, 89, 0.8);
  animation: pbDotPulse 2s infinite;
}

/* 6. Animations */
@keyframes pbSlideIn {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pbFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pbDotPulse {
  0% { box-shadow: 0 0 0 0 rgba(197, 160, 89, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(197, 160, 89, 0); }
  100% { box-shadow: 0 0 0 0 rgba(197, 160, 89, 0); }
}

/* Apply animations to active slide */
.pb-hero-slide.is-active .pb-hero-slide__title {
  animation: pbSlideIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 0.3s;
}

.pb-hero-slide.is-active .pb-hero-slide__subtitle {
  animation: pbSlideIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 0.5s;
}

.pb-hero-slide.is-active .pb-hero-slide__btn {
  animation: pbSlideIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 0.7s;
}

/* 7. Responsive */
@media (max-width: 1024px) {
  .pb-hero-slider {
    height: 500px;
  }
  .pb-hero-slide__content {
    padding: 0 3%;
  }
  .pb-hero-slide__content--left {
    padding-left: 5%;
  }
  .pb-hero-slide__content--right {
    padding-right: 5%;
  }
}

@media (max-width: 767px) {
  .pb-hero-slider {
    min-height: 380px;
  }

  .pb-hero-slide__content {
    justify-content: center;
    padding: 30px 20px;
    box-sizing: border-box;
  }

  .pb-hero-slide__content--left,
  .pb-hero-slide__content--center,
  .pb-hero-slide__content--right {
    padding-left: 20px;
    padding-right: 20px;
  }

  .pb-hero-slide__title {
    font-size: clamp(2rem, 7.5vw, 2.85rem);
    line-height: 1.2;
    margin-bottom: 0.75rem;
  }

  .pb-hero-slide__subtitle {
    font-size: clamp(0.95rem, 3.8vw, 1.15rem);
    line-height: 1.45;
    margin-bottom: 1.25rem;
    max-width: 100%;
  }

  .pb-hero-slide__btn {
    padding: 0.85rem 2rem;
    font-size: 0.95rem;
    width: auto;
    max-width: 100%;
    text-align: center;
    justify-content: center;
  }

  .pb-hero-slider__arrows {
    display: none !important;
  }

  .pb-hero-slider__dots {
    bottom: 16px;
  }

  /* Preset 1 (Elegance) Mobile overlay adaptation: smooth bottom-to-top gradient */
  .pb-hero-slider--elegance .pb-hero-slide__overlay {
    background: linear-gradient(180deg, rgba(255,255,255,0) 20%, rgba(245,240,230,0.85) 65%, rgba(245,240,230,0.98) 100%) !important;
    pointer-events: none !important;
  }

  /* Split layout mobile adjustments */
  .pb-hero-slider--split .pb-hero-slide {
    flex-direction: column;
  }
  .pb-hero-slider--split .pb-hero-slide__bg {
    width: 100%;
    height: 50%;
    order: 1;
  }
  .pb-hero-slider--split .pb-hero-slide__content {
    width: 100%;
    height: 50%;
    order: 2;
    padding: 1.5rem 5% !important;
    align-items: center;
    text-align: center;
  }
}

/* 8. Elementor Editor Preview */
.elementor-editor-active .pb-hero-slider .pb-hero-slide {
  transition: none !important;
}
.elementor-editor-active .pb-hero-slider .pb-hero-slide:first-child {
  visibility: visible;
  opacity: 1;
  z-index: 2;
}
.elementor-editor-active .pb-hero-slider .pb-hero-slide:first-child .pb-hero-slide__title,
.elementor-editor-active .pb-hero-slider .pb-hero-slide:first-child .pb-hero-slide__subtitle,
.elementor-editor-active .pb-hero-slider .pb-hero-slide:first-child .pb-hero-slide__btn {
  opacity: 1;
  animation: none;
}
