/**
 * Product Slider Styles
 * Based on slider.html design - Modern product carousel
 *
 * @package Isoboard
 */

/* ========================================
   Section Container
   ======================================== */
.product-slider-section {
  padding: 3rem 0 4rem;
  background-color: #fff;
}

/* ========================================
   Header: Title + Navigation
   ======================================== */
.product-slider-header {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .product-slider-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4rem;
  }
}

.product-slider-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 10px 0 0;
  letter-spacing: -0.025em;
}

@media (min-width: 768px) {
  .product-slider-title {
    font-size: 2rem;
  }
}

/* ========================================
   Navigation Buttons
   ======================================== */
.product-slider-nav {
  display: flex;
  gap: 1rem;
  align-self: flex-end;
}

@media (min-width: 768px) {
  .product-slider-nav {
    align-self: auto;
  }
}

.product-slider-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  outline: none;
}

.product-slider-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.3);
}

/* Both buttons - filled dark style when active */
.product-slider-btn--prev,
.product-slider-btn--next {
  background-color: #1a1a2e;
  color: #fff;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.product-slider-btn--prev:hover,
.product-slider-btn--next:hover {
  background-color: #2c2c4e;
}

/* Disabled state - light/outline style */
.product-slider-btn.splide-button-disabled {
  background-color: #fff;
  border: 1px solid #d1d5db;
  color: #374151;
  box-shadow: none;
  opacity: 1;
  cursor: not-allowed;
}

/* ========================================
   Splide Container
   ======================================== */
.product-slider {
  overflow: visible;
}

/* FOUC Prevention: default state before JS loads */
.product-slider:not(.is-initialized) {
  overflow: hidden; /* Hide overflow initially to prevent broken layout */
}

.product-slider:not(.is-initialized) .splide__list {
  display: flex;
  gap: 15px; /* Approximate gap */
}

.product-slider:not(.is-initialized) .splide__slide {
  width: 25%; /* Default to 4 columns on desktop */
  flex-shrink: 0;
  margin-right: 15px; /* Fallback gap */
}

/* Responsive fallbacks for uninitialized state */
@media (max-width: 991px) {
  .product-slider:not(.is-initialized) .splide__slide {
    width: 33.33%; /* 3 columns tablet */
  }
}

@media (max-width: 767px) {
  .product-slider:not(.is-initialized) .splide__slide {
    width: 50%; /* 2 columns mobile landscape */
  }
}

@media (max-width: 479px) {
  .product-slider:not(.is-initialized) .splide__slide {
    width: 85%; /* 1.1 slides on mobile with peek */
  }
}

.product-slider .splide__list {
  align-items: stretch;
}

.product-slider .splide__slide {
  height: auto;
}

/* ========================================
   Product Card
   ======================================== */
.product-slider-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Image Container */
.product-slider-card__image {
  position: relative;
  aspect-ratio: 1 / 1;
  margin-bottom: 1.5rem;
  overflow: hidden;
  border-radius: 2px;
  background-color: #f7f7f7;
}

/* Consistent product image height for all cards */
.product-image {
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #e6e6e6;
}

.product-image img {
  width: 100%!important;
  height: 100%!important;
  object-fit: cover;
}

/* Alternate card background */
.splide__slide:nth-child(even) .product-slider-card__image {
  background-color: #fff;
  border: 1px solid #f0f0f0;
}

.product-slider-card__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2rem;
  mix-blend-mode: multiply;
  transition: transform 0.5s ease-out;
}

.product-slider-card:hover .product-slider-card__image img {
  transform: scale(1.05);
}

/* Brand Badge */
.product-slider-card__badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  opacity: 0.7;
}

.product-slider-card__badge-icon {
  color: #FFBB46;
  display: flex;
  align-items: center;
}

.product-slider-card__badge-text {
  font-size: 0.65rem;
  font-weight: 700;
  color: #1e3a5f;
  text-transform: uppercase;
  line-height: 1.1;
}

/* Title */
.product-slider-card__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 13px 0 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s ease;
  display: inline-block;
  width: fit-content;
}

.product-slider-card:hover .product-slider-card__title {
  border-bottom-color: #e5e7eb;
}

/* Description */
.product-slider-card__description {
  font-size: 0.9rem;
  color: #4a4a4a;
  line-height: 1.7;
  margin: 0.5rem 0 0;
}

@media (min-width: 768px) {
  .product-slider-card__description {
    font-size: 1rem;
  }
}

/* ========================================
   Responsive Breakpoints
   ======================================== */
@media (max-width: 575.98px) {
  .product-slider-section {
    padding: 2rem 0 3rem;
  }

  .product-slider-title {
    font-size: 2rem;
  }

  .product-slider-card__image {
    margin-bottom: 1rem;
  }

  .product-slider-card__title {
    font-size: 1.25rem;
  }
}

/* ========================================
   Pagination
   ======================================== */
.woocommerce .navigation.pagination {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
}

.woocommerce .navigation.pagination .nav-links {
  display: flex;
  gap: 15px; /* Increased gap */
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.woocommerce .navigation.pagination .page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background-color: #fff;
  border: 1px solid #e0e0e0; /* Lighter border */
  color: #333;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 300; /* Thinner font */
  transition: all 0.3s ease;
  line-height: 1;
  border-radius: 0; /* Strict square */
}

.woocommerce .navigation.pagination .page-numbers.current {
  background-color: #000;
  color: #fff;
  border-color: #000;
}

.woocommerce .navigation.pagination .page-numbers:hover:not(.current) {
  background-color: #fff; /* Keep white on hover */
  border-color: #000; /* Black border on hover */
  color: #000;
}

.woocommerce .navigation.pagination .prev,
.woocommerce .navigation.pagination .next {
  font-size: 1.5rem; /* Larger arrows */
  font-weight: 300;
  border: 1px solid #e0e0e0;
}

.woocommerce .navigation.pagination .prev:hover,
.woocommerce .navigation.pagination .next:hover {
  border-color: #000;
}
