/* =============================================
   Mealmate Product Carousel  v1.3.0
   - Desktop : shows 3 products, all FULL (size + colour + text)
   - Mobile  : center mode -> middle product full,
               left/right products grey with no text
   ============================================= */

.mpc-wrapper {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  padding-bottom: 3rem;
  /* prevent horizontal page scroll */
  overflow-x: clip;
}

/* Track */
.mpc-wrapper .mpc-carousel .splide__track {
  overflow: hidden;
}

/* =============================================
   SLIDES - DESKTOP DEFAULT
   All 3 products shown fully (no dimming / no scaling)
   ============================================= */

.mpc-wrapper .mpc-carousel .splide__slide {
  box-sizing: border-box;
  cursor: pointer;
  opacity: 1;
  transform: scale(1);
  filter: none;
  transition: opacity 0.4s ease, transform 0.4s ease, filter 0.4s ease;
}

/* On desktop every product keeps its name + subtitle */
.mpc-wrapper .mpc-carousel .splide__slide .mpc-slide-text {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease;
}

/* =============================================
   SLIDE CONTENT
   ============================================= */

.mpc-wrapper .mpc-slide-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.mpc-wrapper .mpc-slide-inner img {
  width: 100%;
  height: auto;
  display: block;
}

.mpc-wrapper .mpc-slide-text {
  padding: 4px 8px 0;
  margin-top: -6px;
}

.mpc-wrapper .mpc-slide-text h3 {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 700;
  color: #11723c;
  line-height: 1.3;
}

.mpc-wrapper .mpc-slide-text p {
  margin: 0;
  font-size: 13px;
  color: #11723c;
}

/* =============================================
   MOBILE - CENTER MODE  (<= 768px)
   centre product = full colour + text
   side products  = grey, no text
   ============================================= */

@media (max-width: 768px) {

  /* left / right products -> grey */
  .mpc-wrapper .mpc-carousel .splide__slide:not(.is-active) {
    filter: grayscale(100%) opacity(0.55);
  }

  /* centre product -> full colour */
  .mpc-wrapper .mpc-carousel .splide__slide.is-active {
    filter: none;
  }

  /* hide name + subtitle on the side products */
  .mpc-wrapper .mpc-carousel .splide__slide:not(.is-active) .mpc-slide-text {
    opacity: 0;
    visibility: hidden;
  }

  /* keep name + subtitle ONLY on the centre product */
  .mpc-wrapper .mpc-carousel .splide__slide.is-active .mpc-slide-text {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease 0.1s;
  }
}

/* =============================================
   PAGINATION DOTS
   ============================================= */

.mpc-wrapper .mpc-carousel .splide__pagination {
  position: relative !important;
  bottom: auto !important;
  display: flex !important;
  justify-content: center;
  gap: 6px;
  margin-top: 1rem;
  padding: 0;
  list-style: none;
}

.mpc-wrapper .mpc-carousel .splide__pagination__page {
  background: #11723c !important;
  opacity: 0.35;
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  display: block;
}

.mpc-wrapper .mpc-carousel .splide__pagination__page.is-active {
  opacity: 1 !important;
  width: 28px !important;
  height: 8px !important;
  border-radius: 4px !important;
  transform: none !important;
}

/* =============================================
   HIDE ARROWS
   ============================================= */

.mpc-wrapper .mpc-carousel .splide__arrows,
.mpc-wrapper .mpc-carousel .splide__arrow {
  display: none !important;
}

/* =============================================
   POPUP
   The overlay lives in the footer (one per page). Its show/hide is driven by
   inline style from JavaScript so it works even if anything else misbehaves.
   ============================================= */

.mpc-popup-overlay {
  /* display is set by JS (none <-> flex). none here is the resting state. */
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.mpc-popup-box {
  border-radius: 20px;
  padding: 1.75rem;
  max-width: 460px;
  width: 100%;
  min-height: 120px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-sizing: border-box;
  animation: mpcPopupIn 0.3s ease;
}

@keyframes mpcPopupIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.mpc-popup-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #f0f0f0;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.mpc-popup-close:hover { background: #e0e0e0; }

/* Loading + message states */
.mpc-popup-loading {
  padding: 2.5rem 1rem;
  text-align: center;
  color: #888;
  font-size: 14px;
}

.mpc-popup-msg {
  padding: 2rem 1.25rem;
  text-align: center;
  color: #555;
  font-size: 15px;
  line-height: 1.6;
}

.mpc-popup-msg small {
  color: #999;
  font-size: 12px;
}

/* Keep Bricks template images inside the popup box without forcing
   their width, so the template's own design is preserved. */
.mpc-popup-content img {
  max-width: 100%;
  height: auto;
}
