/* ==========================================================================
   HOME PAGE - PRODUCTS SECTION (Slider + Outlet)
   ========================================================================== */

.outer-block.products-home {
  max-width: var(--wrap, min(1760px, 94vw));
  margin-inline: auto;
  padding-inline: clamp(1rem, 2.2vw, 2.5rem);
  padding-block: clamp(1.5rem, 3vw, 2.5rem);
}

/* ==========================================================================
   LAYOUT: Slider LEFT + Outlet RIGHT
   ========================================================================== */

.products-home .inner-block.row {
  display: flex;
  gap: 1.25rem;
  align-items: stretch;
}

.list-home-outer-product {
  flex: 1 1 0;
  min-width: 0;
}

.list-home-outer {
  flex: 0 0 340px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
}


/* ==========================================================================
   LEFT SIDE: STOCK SLIDER
   ========================================================================== */

.list-stock {
  overflow: visible;
}

/* Header: Title + Link */
.list-stock .view-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.list-stock .view-header-home h2 {
  font-family: var(--font-display, 'Archivo', Arial, sans-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink, #1b2531);
  margin: 0;
}

.list-stock .view-header .button-voorraad a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--rust-600, #c1592b);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.55rem 1.15rem;
    border-radius: var(--r-sm, 4px);
    text-decoration: none;
    white-space: nowrap;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(22, 32, 43, .08));
    transition: background-color .2s var(--ease, ease), transform .15s ease;
}

.list-stock .view-header .button-voorraad a:hover,
.list-stock .view-header .button-voorraad a:focus {
    background: var(--rust-500, #d97a52);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.list-stock .view-header .button-voorraad a:active {
    transform: translateY(0);
}


/* Hide footer link */
.list-stock .view-footer {
  display: none;
}

/* ==========================================================================
   SPLIDE OVERRIDES
   ========================================================================== */

.list-stock .splide {
  overflow: visible;
}

.list-stock .splide__track {
  overflow: hidden;
  padding: 20px 0 32px;   /* ruimte voor hover-lift (boven) + schaduw-bleed (onder) */
  margin: -20px 0 -32px;  /* trekt de padding er weer af -> hoogte van de strip blijft exact gelijk */
}

.list-stock .splide__list {
  align-items: stretch !important;
}

.list-stock .splide__slide {
  height: 181px !important;   /* zelfde waarde als "Fixed height" in Stijlopties */
  display: flex;
  flex-direction: column;
  background: var(--surface, #ffffff);
  border: 1px solid var(--line, #e3e0d8);
  border-radius: var(--r-md, 8px);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}


.list-stock .splide__slide:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md, 0 10px 26px -10px rgba(22,32,43,.28));
}

/* Fix the nested span structure from Drupal */
.list-stock .splide__slide > .views-field {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

/* BELANGRIJK: display:flex + flex-direction:column zijn nodig op BEIDE
   geneste <span>-lagen. Zonder display:flex is de ouder geen flex-container,
   waardoor "flex: 1 1 auto" op de <a> hieronder genegeerd wordt en de foto
   zijn eigen (intrinsieke) hoogte pakt i.p.v. de resterende ruimte binnen
   de vaste 181px-kaart. Dat duwde de titel-balk buiten de zichtbare rand. */
.list-stock .splide__slide > span,
.list-stock .splide__slide > span > span {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Image container */
.list-stock .splide__slide > span > span > a {
  display: block;
  flex: 1 1 auto;
  min-height: 0;   /* cruciaal: anders duwt de intrinsieke min-height de kaart alsnog groter dan 181px */
  overflow: hidden;
}

.list-stock .splide__slide > span > span > a img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   SLIDER CARD TITLE
   ========================================================================== */

.list-stock .splide__slide .title-slider {
  padding: 0.6rem 0.75rem;
  font-family: var(--font-body, 'Inter', Arial, sans-serif);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink, #1b2531);
  line-height: 1.35;
  background: var(--surface, #ffffff);
  flex: 0 0 auto;
  height: 2.8rem;   /* was min-height → nu vast, zodat 1- en 2-regelige titels evenveel ruimte innemen */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   PRIJSTOPPER TAG
   ========================================================================== */

.list-stock .aanbieding {
  position: absolute;
  top: 8px;
  left: 0;
  z-index: 5;
  background: var(--rust-600, #c1592b);
  color: #fff;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-weight: 600;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 0 3px 3px 0;
}

/* ==========================================================================
   SPLIDE ARROWS
   ========================================================================== */

.list-stock .splide__arrow {
  background: var(--surface, #ffffff);
  border: 1px solid var(--line, #e3e0d8);
  opacity: 1;
}

.list-stock .splide__arrow:hover {
  background: var(--rust-100, #f7e6da);
}

.list-stock .splide__arrow svg {
  fill: var(--ink, #1b2531);
}

/* ==========================================================================
   RIGHT SIDE: OUTLET - Stretch all wrappers to fill height
   ========================================================================== */

.list-home-outer .list-outlet,
.list-home-outer .field,
.list-home-outer .views-element-container,
.list-home-outer .view,
.list-home-outer .view-content,
.list-home-outer .outlet-carousel,
.list-home-outer .carousel-inner,
.list-home-outer .carousel-item {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  margin: 0;
  padding: 0;
}

.list-home-outer .carousel-item.active {
  display: flex;
}

/* The carousel card */
.outlet-carousel {
  border-radius: var(--r-lg, 14px);
  overflow: hidden;
  box-shadow: var(--shadow-md, 0 10px 26px -10px rgba(22,32,43,.28));
}

/* The outlet card container */
.outlet-relative {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Image link fills the entire card */
.outlet-relative > a {
  display: block;
  flex: 1;
  overflow: hidden;
  height: 100%;
}

.outlet-relative img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Price label - top right */
.outlet-absolute-top {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #e53935;
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--r-sm, 4px);
  font-family: var(--font-display, 'Archivo', Arial, sans-serif);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(22,32,43,.08));
}

/* Phone label - bottom right */
.outlet-absolute-bottom {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background: #e53935;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--r-sm, 4px);
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(22,32,43,.08));
}
.outlet-absolute-bottom a,
.outlet-absolute-bottom a:hover,
.outlet-absolute-bottom a:focus,
.outlet-absolute-bottom a:visited {
    color: #fff;
    text-decoration: none;
}


/* Carousel controls */
.outlet-carousel .carousel-control-prev,
.outlet-carousel .carousel-control-next {
  width: 40px;
  height: 40px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  opacity: 0.8;
}

.outlet-carousel .carousel-control-prev {
  left: 0.75rem;
}

.outlet-carousel .carousel-control-next {
  right: 0.75rem;
}

.outlet-carousel .carousel-control-prev:hover,
.outlet-carousel .carousel-control-next:hover {
  opacity: 1;
}

.outlet-carousel .carousel-control-prev-icon,
.outlet-carousel .carousel-control-next-icon {
  width: 1rem;
  height: 1rem;
  filter: invert(1) grayscale(100%);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1200px) {
  .list-home-outer {
    flex: 0 0 280px;
    max-width: 280px;
  }
}

@media (max-width: 992px) {
  .products-home .inner-block.row {
    align-items: stretch;
  }
  
  .list-home-outer {
    flex: 0 0 auto;
    max-width: 100%;
    width: 100%;
    height: auto;
  }
  
  .outlet-carousel {
    min-height: 300px;
  }
}

@media (max-width: 600px) {
  .list-stock .view-header {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .list-stock .view-header-home h2 {
    font-size: 1.1rem;
  }
}
@media (max-width: 767px) {
    /* Outlet-kaart: hoogte laten bepalen door een vaste beeldverhouding,
       niet door de hoogte van tekst-kaarten ernaast */
    .list-home-outer .outlet-carousel,
    .list-home-outer .carousel-inner,
    .list-home-outer .carousel-item,
    .outlet-relative {
        height: auto;
        min-height: 0;
    }

    .outlet-carousel {
        aspect-ratio: 4 / 3;
    }

    .outlet-relative {
        height: 100%; /* nu wél zinvol: vult de aspect-ratio-box hierboven */
    }

    .outlet-relative > a {
        display: block;
        height: 100%;
    }

    .outlet-relative > a img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    /* Prijsbadge iets compacter op smalle schermen */
    .outlet-absolute-top {
        top: 0.75rem;
        right: 0.75rem;
        padding: 0.45rem 0.75rem;
        font-size: 0.78rem;
    }
}
@media (max-width: 767px) {
    .outlet-absolute-bottom {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        display: flex;
        justify-content: center;
        padding: 0.7rem 1rem;
    }

    .outlet-absolute-bottom a {
        font-size: 1rem;
        letter-spacing: 0.01em;
    }
}
