/* =========================================================
   LLIBRE CAROUSEL BLOCK
   ========================================================= */

.c-llibres-destacats-carousel {
  margin-top: var(--mar-t, 0);
  margin-bottom: var(--mar-b, 0);
  padding-top: var(--pad-t, 4rem);
  padding-bottom: var(--pad-b, 4rem);
  position: relative;
  z-index: 1;
}

.c-llibres-destacats-carousel__wrapper {
  position: relative;
  z-index: 10;
}

.c-llibres-destacats-carousel:hover {
  z-index: 50;
}

.c-llibres-destacats-carousel.is-hidden {
  display: none;
}

.c-llibres-destacats-carousel__header {
  margin-bottom: 2rem;
}

.c-llibres-destacats-carousel__titol {
  font-size: var(--fs-tit-bloc, 52px);
  line-height: 1.1;
  font-weight: var(--fw-tit-bloc, 700);
  color: var(--c-tit-bloc, #1e1348);
  margin: 0;
}

.c-llibres-destacats-carousel__track-outer {
  width: 100%;
  overflow-x: clip;
  overflow-y: visible;
  padding-bottom: 30px;
}

.c-llibres-destacats-carousel__track {
  display: flex;
  align-items: stretch;
  gap: var(--grid-gap);
  list-style: none;
  margin: 0;
  padding: 0;
  transition: transform 0.4s ease-in-out;
  will-change: transform;
}

.c-llibres-destacats-carousel__card {
  flex: 0 0 calc(((100% - (var(--grid-gap) * 5)) / 6) - 0.5px);
  position: relative;
  z-index: 1;
  display: flex;
}

.c-llibres-destacats-carousel__card:hover {
  z-index: 10;
}

.c-llibres-destacats-carousel__card-inner {
  display: flex;
  flex-direction: column;
  background-color: transparent;
  position: relative;
  text-decoration: none;
  transform: translateZ(0);
  backface-visibility: hidden;
  height: 100%;
  width: 100%;
}

.c-llibres-destacats-carousel__card-image {
  width: 100%;
  height: var(--img-h, auto);
  aspect-ratio: var(--img-ratio, 205/250);
  border-radius: var(--br-img, 20px);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.c-llibres-destacats-carousel__card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.c-llibres-destacats-carousel__card-body {
  padding: 2.75rem 1.25rem 1.25rem 1.25rem;
  background: var(--bg-card, #fff);
  border: 1px solid var(--bd-card, #edecf0);
  border-radius: var(--br-card, 0 0 20px 20px);
  margin-top: -24px;
  position: relative;
  flex-grow: 1; 
  display: flex;
  flex-direction: column;
}

.c-llibres-destacats-carousel__card-colleccio {
  font-size: var(--fs-col, 16px);
  color: var(--c-col, #1e1348);
  font-weight: var(--fw-col, 400);
  margin-bottom: 0.25rem;
}

.c-llibres-destacats-carousel__card-title {
  font-size: var(--fs-titol, 16px);
  font-weight: var(--fw-titol, 600);
  color: var(--c-titol, #1e1348);
  margin: 0;
  line-height: 1.3;
}

.c-llibres-destacats-carousel__card-hover {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: absolute;
  top: 100%;
  left: 4px;
  right: 4px;
  background-color: var(--bg-hover, #ffffff);
  padding: 30px 20px 20px 20px;
  margin-top: -15px;
  border-radius: var(--br-card, 0 0 20px 20px);
  border: 1px solid var(--bd-card, #edecf0);
  border-top: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: -1;
}

.c-llibres-destacats-carousel__card:hover
  .c-llibres-destacats-carousel__card-hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.c-llibres-destacats-carousel__divider {
  width: 100%;
  height: 2px;
  background-color: #f0f0f0;
  margin: 4px 0;
}

.c-llibres-destacats-carousel__cta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  color: var(--c-link, #5d4d9b);
  font-weight: 600;
  font-size: 16px;
  transition: color 0.2s ease;
}

.c-llibres-destacats-carousel__cta:hover {
  color: var(--c-link-hover, #b2a4d2);
}

.c-llibres-destacats-carousel__cta-desktop {
  display: flex;
  align-items: center;
  gap: 6px;
}

.c-llibres-destacats-carousel__cta svg {
  transition: transform 0.2s ease;
}

.c-llibres-destacats-carousel__nav-wrapper {
  margin-top: 1rem;
  position: relative;
  z-index: 1;
}

.c-llibres-destacats-carousel__nav {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.c-llibres-destacats-carousel__btn {
  width: 44px;
  height: 44px;
  border-radius: var(--br-btn, 50%);
  background-color: var(--nav-bg, #1e1348);
  color: var(--nav-c, #fff);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.c-llibres-destacats-carousel__btn--prev svg {
  transform: rotate(180deg);
}

.c-llibres-destacats-carousel__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
  background-color: #b2a4d2;
}

.c-llibres-destacats-carousel__btn:not(:disabled):hover {
  background-color: var(--nav-hbg, #110626);
  color: var(--nav-hc, #fff);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.c-llibres-destacats-carousel__cta-mobile {
  display: none;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1200px) {
  .c-llibres-destacats-carousel__card {
    flex: 0 0 calc(((100% - (var(--grid-gap) * 4)) / 5) - 0.5px);
  }
}

@media (max-width: 1024px) {
  .c-llibres-destacats-carousel__card {
    flex: 0 0 calc(((100% - (var(--grid-gap) * 3)) / 4) - 0.5px);
  }
}

@media (max-width: 900px) {
  .c-llibres-destacats-carousel__card {
    flex: 0 0 calc(((100% - (var(--grid-gap) * 2)) / 3) - 0.5px);
  }
}

@media (max-width: 768px) {
  .c-llibres-destacats-carousel {
    padding-top: var(--pad-t-mob, 4rem);
    padding-bottom: var(--pad-b-mob, 4rem);
  }

  .c-llibres-destacats-carousel__titol {
    font-size: var(--fs-tit-bloc-mob, 32px);
    line-height: 1.1;
  }

  .c-llibres-destacats-carousel__card {
    --col-width-mob: calc((100% - (var(--grid-gap) * 3)) / 4);
    flex: 0 0 calc((var(--col-width-mob) * 2.5) + (var(--grid-gap) * 1.5));
  }

  .c-llibres-destacats-carousel__card-colleccio {
    font-size: var(--fs-col-mob, 14px);
  }

  .c-llibres-destacats-carousel__card-title {
    font-size: var(--fs-titol-mob, 16px);
  }

  .c-llibres-destacats-carousel__nav {
    justify-content: space-between;
  }

  .c-llibres-destacats-carousel__track-outer {
    padding-bottom: 50px;
  }

  .c-llibres-destacats-carousel__card-hover {
    flex-direction: row;
    justify-content: space-evenly;
    align-items: center;
    padding: 20px 15px 5px 15px;
    gap: 0;
  }

  .c-llibres-destacats-carousel__cta {
    justify-content: center;
    flex: 1;
  }

  .c-llibres-destacats-carousel__divider {
    width: 1px;
    height: 18px;
    margin: 0 10px;
  }

  .c-llibres-destacats-carousel__cta-desktop {
    display: none;
  }

  .c-llibres-destacats-carousel__cta-mobile {
    display: inline;
  }
}