/* ============================================
   PRODUCT CAROUSEL STYLES
   DIYPack Homepage Product Carousel Component
   ============================================ */

/* ----------------------------------------
   1. SECTION CONTAINER
   ---------------------------------------- */
.product-carousel-section {
  padding: 60px 0;
  background: #fff;
}

/* ----------------------------------------
   2. HEADER STYLES
   ---------------------------------------- */
.product-carousel-header {
  width: 90%;
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 0 30px;
  text-align: center;
}

.product-carousel-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--bs-primary, #1a3a5c);
  margin-bottom: 12px;
}

.product-carousel-header p {
  font-size: 1rem;
  color: #555;
  max-width: 700px;
  line-height: 1.6;
  margin-left: auto;
  margin-right: auto;
}

/* ----------------------------------------
   3. CAROUSEL WRAPPER & TRACK
   ---------------------------------------- */
.product-carousel-wrapper {
  position: relative;
  width: 90%;
  max-width: 1920px;
  margin: 0 auto;
  padding: 0;
}

.product-carousel-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 10px 0 30px;
  -webkit-overflow-scrolling: touch;
}

.product-carousel-track::-webkit-scrollbar {
  display: none;
}

/* ----------------------------------------
   4. PRODUCT CARD - BASE STYLES
   ---------------------------------------- */
.product-card {
  flex: 0 0 400px;
  background: #fff;
  border-radius: 1rem;
  border: 1px solid hsl(150, 15%, 88%);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px hsla(160, 30%, 10%, 0.04);
}

/* ----------------------------------------
   5. PRODUCT CARD - IMAGE
   ---------------------------------------- */
.product-card-image {
  width: 400px;
  height: 300px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  text-decoration: none;
}

.product-card-image img {
  width: 400px;
  height: 300px;
  object-fit: cover;
}

/* ----------------------------------------
   6. PRODUCT CARD - CONTENT
   ---------------------------------------- */
.product-card-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ----------------------------------------
   7. PRODUCT CARD - TITLE
   ---------------------------------------- */
.product-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--bs-primary, #1a3a5c);
  margin: 0;
}

h3.product-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--bs-primary, #1a3a5c);
  margin: 0;
  position: relative;
  padding-bottom: 12px;
}

h3.product-card-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: clamp(60px, 8vw, 110px);
  border-radius: 4px;
  background: linear-gradient(90deg, #44bda0 0%, #dd1f44 100%);
}

/* Title Link Styles */
.product-card-title a {
  color: inherit;
  text-decoration: none;
}

.product-card-title a:hover,
.product-card-title a:focus,
.product-card-title a:active {
  color: inherit;
  text-decoration: none;
}

/* ----------------------------------------
   8. PRODUCT CARD - DESCRIPTION
   ---------------------------------------- */
.product-card-desc {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.5;
  margin-bottom: 12px;
  flex-grow: 1;
}

.product-card-qty-pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1.5px solid #ddd;
  color: #666;
  background: #fff;
  transition: all 0.2s ease;
}

.product-card-qty-pill.active {
  background: #e85a6b;
  border-color: #e85a6b;
  color: #fff;
}

/* ----------------------------------------
   11. PRODUCT CARD - BUTTON
   ---------------------------------------- */
.product-card-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: #dd1f44;
  color: #fff;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none !important;
  margin-top: auto;
  box-shadow: 0 2px 4px rgba(221, 31, 68, 0.2);
}

.product-card-btn:hover {
  background: #c41b3d;
  color: #fff;
  text-decoration: none !important;
  box-shadow: 0 6px 12px rgba(221, 31, 68, 0.35);
}

.product-card-btn:active {
  box-shadow: 0 2px 4px rgba(221, 31, 68, 0.2);
  text-decoration: none !important;
}

.product-card-btn:focus {
  text-decoration: none !important;
  outline: 2px solid rgba(221, 31, 68, 0.5);
  outline-offset: 2px;
}

/* ----------------------------------------
   12. CAROUSEL NAVIGATION
   ---------------------------------------- */
.carousel-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  width: 90%;
  max-width: 1920px;
  margin: 0 auto;
}

.carousel-nav-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--bs-primary, #1a3a5c);
  background: #fff;
  color: var(--bs-primary, #1a3a5c);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.carousel-nav-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Active state for touch devices */
.carousel-nav-btn:active {
  background: var(--bs-primary, #1a3a5c);
  color: #fff;
}

/* ----------------------------------------
   13. CAROUSEL PROGRESS BAR / SCROLLBAR
   ---------------------------------------- */
.carousel-progress-container {
  flex: 1;
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  margin-left: 20px;
  cursor: grab;
  position: relative;
  overflow: hidden;
}

.carousel-progress-container:active {
  cursor: grabbing;
}

.carousel-scrollbar-thumb {
  position: absolute;
  top: 0;
  height: 100%;
  width: 20%;
  min-width: 60px;
  background: var(--bs-primary, #1a3a5c);
  border-radius: 2px;
  left: 0;
  transition: left 0.15s ease-out;
  pointer-events: none;
}

.carousel-scrollbar-thumb.dragging {
  transition: none;
}

/* ============================================
   14. HOVER STATES (Desktop Only)
   Only apply on devices that support hover
   ============================================ */
@media (hover: hover) and (pointer: fine) {
  .product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px hsla(160, 30%, 10%, 0.08);
  }

  .carousel-nav-btn:hover {
    background: var(--bs-primary, #1a3a5c);
    color: #fff;
  }
}

/* ============================================
   15. CAROUSEL VARIANT - BREAKOUT STYLE
   Edge-to-edge carousel layout
   ============================================ */
.product-carousel-section.breakout .product-carousel-wrapper {
  width: 100%;
  max-width: 100%;
  padding: 0;
}

.product-carousel-section.breakout .product-carousel-track {
  padding-left: calc(5% - 10px);
  padding-right: calc(5% - 10px);
}

.product-carousel-section.breakout .carousel-nav {
  width: 90%;
  max-width: 1920px;
}

@media (min-width: 1024px) {
  .product-carousel-section.breakout .product-carousel-track {
    padding-left: calc(10% - 10px);
    padding-right: calc(10% - 10px);
  }
  .product-carousel-section.breakout .carousel-nav {
    width: 80%;
  }
}

/* For very wide screens where max-width kicks in */
@media (min-width: 2134px) {
  .product-carousel-section.breakout .product-carousel-track {
    padding-left: calc((100vw - 1920px) / 2 - 10px);
    padding-right: calc((100vw - 1920px) / 2 - 10px);
  }
}

/* ============================================
   16. CAROUSEL VARIANT - 3D DRUM/CYLINDER
   ============================================ */
.product-carousel-section.carousel-3d {
  perspective: 1200px;
  overflow: visible;
}

.product-carousel-section.carousel-3d .product-carousel-wrapper {
  width: 100%;
  max-width: 100%;
  padding: 60px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
}

.product-carousel-section.carousel-3d .product-carousel-track {
  display: flex;
  gap: 0;
  overflow: visible;
  padding: 0;
  position: relative;
  width: 400px;
  height: 520px;
  transform-style: preserve-3d;
}

.product-carousel-section.carousel-3d .product-card {
  position: absolute;
  left: 0;
  top: 0;
  width: 400px;
  backface-visibility: hidden;
  transition: transform 0.5s ease, opacity 0.5s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.product-carousel-section.carousel-3d .carousel-nav {
  width: 90%;
  max-width: 600px;
  justify-content: center;
  gap: 20px;
}

.product-carousel-section.carousel-3d .carousel-progress-container {
  display: none;
}

/* ============================================
   17. RESPONSIVE - TABLET (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
  /* Header */
  .product-carousel-header {
    width: 90%;
    padding: 0 0 20px;
  }

  .product-carousel-header h2 {
    font-size: 1.8rem;
  }

  /* Wrapper */
  .product-carousel-wrapper {
    width: 90%;
    padding: 0;
  }

  /* Track - enable grab cursor on touch */
  .product-carousel-track {
    cursor: grab;
  }

  .product-carousel-track:active {
    cursor: grabbing;
  }

  /* Cards */
  .product-card {
    flex: 0 0 260px;
  }

  .product-card-image {
    width: 260px;
    height: 195px;
  }

  .product-card-image img {
    width: 260px;
    height: 195px;
  }

  /* Navigation */
  .carousel-nav {
    width: 90%;
    padding: 0;
  }

  .carousel-progress-container {
    margin-left: 12px;
  }

  /* 3D Carousel adjustments */
  .product-carousel-section.carousel-3d .product-carousel-track,
  .product-carousel-section.carousel-3d .product-card {
    width: 300px;
  }

  .product-carousel-section.carousel-3d .product-carousel-track {
    height: 440px;
  }
}

/* ============================================
   18. RESPONSIVE - MOBILE (max-width: 576px)
   ============================================ */
@media (max-width: 576px) {
  /* Cards */
  .product-card {
    flex: 0 0 220px;
  }

  .product-card-image {
    width: 220px;
    height: 165px;
  }

  .product-card-image img {
    width: 220px;
    height: 165px;
  }

  /* Content */
  .product-card-content {
    padding: 14px;
    gap: 10px;
  }

  .product-card-title,
  h3.product-card-title {
    font-size: 1.1rem;
  }

  .product-card-desc {
    font-size: 0.85rem;
  }

  .product-card-btn {
    padding: 10px 14px;
    font-size: 0.8rem;
  }
}
