/* ==========================================================================
   EM Farm - Elementor product carousel
   ========================================================================== */

.em-product-carousel {
  --em-pc-columns: 4;
  --em-pc-columns-tablet: 2;
  --em-pc-columns-mobile: 1;
  --em-pc-gap: 8px;
  position: relative;
  width: 100%;
}

.em-product-carousel__viewport {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.em-product-carousel__viewport::-webkit-scrollbar {
  display: none;
}

.em-product-carousel__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--em-pc-gap) * (var(--em-pc-columns) - 1))) / var(--em-pc-columns));
  gap: var(--em-pc-gap);
  align-items: stretch;
}

.em-product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: clamp(520px, 36vw, 670px);
  padding: clamp(18px, 1.45vw, 28px);
  border-radius: 24px;
  background: #f1f1e9;
  color: #145f35;
  overflow: hidden;
  scroll-snap-align: start;
}

.em-product-card__badges {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 70px);
}

.em-product-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 0 10px;
  border-radius: 999px;
  font-family: var(--em-font-heading, "Montserrat", sans-serif);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.em-product-card__badge--new {
  background: #d6bb77;
  color: #07261d;
}

.em-product-card__badge--sale {
  background: #ff6900;
  color: #fff;
}

.em-product-card__wishlist {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: #145f35;
  pointer-events: none;
}

.em-product-card__wishlist svg {
  display: block;
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.em-product-card__image-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  height: clamp(260px, 20vw, 420px);
  margin: 24px 0 18px;
  text-decoration: none;
}

.em-product-card__image {
  display: block;
  width: auto;
  max-width: 86%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 220ms ease;
}

.em-product-card:hover .em-product-card__image {
  transform: translateY(-2px) scale(1.015);
}

.em-product-card__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  text-align: center;
}

.em-product-card__title {
  display: block;
  max-width: 92%;
  margin: 0 auto 18px;
  color: #145f35;
  font-family: var(--em-font-body, "Urbanist", sans-serif);
  font-size: clamp(18px, 1.1vw, 22px);
  font-weight: 700;
  line-height: 1.18;
  text-decoration: none;
}

.em-product-card__title:hover,
.em-product-card__title:focus {
  color: #07261d;
  text-decoration: none;
}

.em-product-card__pack {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 94%;
  min-height: 31px;
  margin: 0 auto 20px;
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: rgba(7, 38, 29, 0.82);
  font-family: var(--em-font-body, "Urbanist", sans-serif);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.em-product-card__price {
  margin: 0 auto 8px;
  color: #145f35;
  font-family: var(--em-font-body, "Urbanist", sans-serif);
  font-size: clamp(18px, 1.1vw, 22px);
  font-weight: 600;
  line-height: 1;
}

.em-product-card__price del {
  margin-right: 6px;
  color: rgba(20, 95, 53, 0.5);
  font-size: 0.82em;
}

.em-product-card__price ins {
  color: #145f35;
  text-decoration: none;
}

.em-product-card__lowest-price {
  min-height: 18px;
  margin: 0 auto 34px;
  color: #145f35;
  font-family: var(--em-font-body, "Urbanist", sans-serif);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.em-product-card__info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  margin-left: 3px;
  border-radius: 999px;
  background: #145f35;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
}

.em-product-card__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: auto;
  padding: 0 25px;
  border: 2px solid #145f35;
  border-radius: 999px;
  background: #145f35;
  color: #fff;
  font-family: var(--em-font-body, "Urbanist", sans-serif);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.em-product-card__button:hover,
.em-product-card__button:focus {
  background: #07261d;
  border-color: #07261d;
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.em-product-card__button:focus-visible,
.em-product-card__title:focus-visible,
.em-product-card__image-link:focus-visible {
  outline: 2px solid #24733a;
  outline-offset: 4px;
}

.em-product-carousel__arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #145f35;
  box-shadow: 0 10px 30px rgba(7, 38, 29, 0.12);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background-color 180ms ease, color 180ms ease, opacity 180ms ease;
}

.em-product-carousel__arrow svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.em-product-carousel__arrow--prev {
  left: 10px;
}

.em-product-carousel__arrow--next {
  right: 10px;
}

.em-product-carousel__arrow:hover,
.em-product-carousel__arrow:focus {
  background: #145f35;
  color: #fff;
}

.em-product-carousel__arrow.is-disabled {
  opacity: 0.28;
  pointer-events: none;
}

.em-product-carousel-empty {
  padding: 22px;
  border: 1px dashed rgba(7, 38, 29, 0.35);
  border-radius: 14px;
  background: #f7f7f3;
  color: #07261d;
  font-family: var(--em-font-body, "Urbanist", sans-serif);
}

@media (max-width: 1199px) {
  .em-product-carousel__track {
    grid-auto-columns: calc((100% - (var(--em-pc-gap) * (var(--em-pc-columns-tablet) - 1))) / var(--em-pc-columns-tablet));
  }

  .em-product-card {
    min-height: 560px;
  }
}

@media (max-width: 767px) {
  .em-product-carousel__track {
    grid-auto-columns: calc((100% - (var(--em-pc-gap) * (var(--em-pc-columns-mobile) - 1))) / var(--em-pc-columns-mobile));
  }

  .em-product-card {
    min-height: 540px;
    border-radius: 18px;
  }

  .em-product-card__image-link {
    height: 280px;
  }

  .em-product-carousel__arrow {
    width: 38px;
    height: 38px;
  }
}

/* Most viewed specific additions */
.em-product-card__badge--views {
  background: #145f35;
  color: #fff;
}

.em-product-card__info {
  position: relative;
  cursor: help;
}

.em-product-card__tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: 190px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #07261d;
  color: #fff;
  font-family: var(--em-font-body, "Urbanist", sans-serif);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.em-product-card__tooltip::after {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: #07261d;
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.em-product-card__info:hover .em-product-card__tooltip,
.em-product-card__info:focus .em-product-card__tooltip,
.em-product-card__info:focus-visible .em-product-card__tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
