/* ================================
   Midwest Add To Cart Popup
================================ */

.mw-cart-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(15, 25, 18, 0.18);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 110px 24px 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .35s ease, visibility .35s ease;
}

.mw-cart-popup-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mw-cart-popup {
  position: relative;
  width: min(100%, 1320px);
  min-height: 230px;
  display: grid;
  grid-template-columns: 150px 220px 1fr auto;
  align-items: center;
  gap: 34px;
  background: #FAF9F5;
  border: 1px solid #B8C4B8;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,.16);
  overflow: hidden;
  transform: translateY(-40px);
  opacity: 0;
  transition: transform .35s ease, opacity .35s ease;
}

.mw-cart-popup-overlay.is-active .mw-cart-popup {
  transform: translateY(0);
  opacity: 1;
}

/* Left green panel */
.mw-cart-popup-side {
  height: 100%;
  min-height: 230px;
  background: linear-gradient(135deg, #123C27 0%, #2F4A34 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.mw-cart-popup-side::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 40% 30%, rgba(255,255,255,.12), transparent 28%),
    linear-gradient(160deg, rgba(255,255,255,.05), transparent);
  opacity: .75;
}

.mw-cart-popup-check {
  position: relative;
  z-index: 2;
  width: 78px;
  height: 78px;
  border: 4px solid #FFFFFF;
  border-radius: 50%;
  color: #FFFFFF;
  font-size: 42px;
  line-height: 70px;
  text-align: center;
  font-weight: 600;
}

/* Product image */
.mw-cart-popup-image-wrap {
  width: 180px;
  height: 180px;
  background: #FFFFFF;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
}

.mw-cart-popup-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Content */
.mw-cart-popup-content {
  padding: 36px 0;
}

.mw-cart-popup-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 44px;
  font-weight: 500;
  line-height: 1.12;
  color: #2F4A34;
  margin: 0 0 28px;
}

.mw-cart-popup-title::after {
  content: "";
  display: block;
  width: 100%;
  max-width: 720px;
  height: 1px;
  background: #D9D6D0;
  margin-top: 24px;
}

.mw-cart-popup-meta {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  font-family: 'Poppins', sans-serif;
  font-size: 17px;
  color: #2F2F2F;
}

.mw-cart-popup-success {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #2F2F2F;
}

.mw-cart-popup-success::first-letter {
  color: transparent;
}

.mw-cart-popup-success::before {
  content: "✓";
  width: 34px;
  height: 34px;
  background: #2F4A34;
  color: #FFFFFF;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.mw-cart-popup-count {
  border-left: 1px solid #D9D6D0;
  padding-left: 28px;
}

/* Button */
.mw-cart-popup-actions {
  padding-right: 44px;
}

.mw-cart-popup-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 220px;
  min-height: 58px;
  background: #8B4E05;
  color: #FFFFFF !important;
  border-radius: 6px;
  padding: 0 30px;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  text-decoration: none !important;
  box-shadow: 0 12px 26px rgba(139,78,5,.18);
  transition: all .25s ease;
}

.mw-cart-popup-button:hover {
  background: #6F3D00;
  color: #FFFFFF !important;
  transform: translateY(-2px);
}

.mw-cart-popup-button span {
  font-size: 28px;
  line-height: 1;
}

/* Close */
.mw-cart-popup-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #2F4A34;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  transition: color .25s ease;
}

.mw-cart-popup-close:hover {
  color: #8B4E05;
}

/* Hide native WooCommerce success notice */
.woocommerce-message {
  display: none !important;
}

.single-product a.added_to_cart.wc-forward {
  display: none !important;
}

/* ==================================
   Mobile Premium Layout
================================== */

@media (max-width: 767px) {

  .mw-cart-popup-overlay {
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 25, 18, .34);
    backdrop-filter: blur(5px);
  }

  .mw-cart-popup {
    width: min(100%, 390px);
    max-height: calc(100vh - 36px);
    min-height: auto;

    display: grid;
    grid-template-columns: 92px 1fr;
    grid-template-rows: auto auto auto;
    gap: 0;

    background: #FAF9F5;
    border: 1px solid rgba(47, 74, 52, .22);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
    overflow: hidden;

    transform: translateY(-18px) scale(.98);
  }

  .mw-cart-popup-overlay.is-active .mw-cart-popup {
    transform: translateY(0) scale(1);
  }

  /* Franja verde */
  .mw-cart-popup-side {
    grid-column: 1;
    grid-row: 1 / 3;

    width: 92px;
    min-height: 250px;
    height: 100%;

    background: linear-gradient(160deg, #123C27 0%, #2F4A34 100%);
  }

  .mw-cart-popup-check {
    width: 52px;
    height: 52px;
    border-width: 3px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 30px;
    line-height: 1;
  }

  /* Área superior */
  .mw-cart-popup-image-wrap {
    grid-column: 2;
    grid-row: 1;

    width: 120px;
    height: 120px;
    margin: 28px auto 10px;
    padding: 14px;

    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .07);
  }

  .mw-cart-popup-content {
    grid-column: 2;
    grid-row: 2;

    width: 100%;
    padding: 8px 26px 24px;
    text-align: center;
  }

  .mw-cart-popup-title {
    margin: 0 0 18px;
    padding: 0;

    font-size: 30px;
    line-height: 1.08;
    text-align: center;
    color: #2F4A34;
  }

  .mw-cart-popup-title::after {
    display: block;
    width: 72px;
    height: 1px;
    margin: 18px auto 0;
    background: #D9D6D0;
  }

  /* Solo mostrar conteo */
  .mw-cart-popup-meta {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 0;

    border: none;
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
  }

  .mw-cart-popup-success {
    display: none;
  }

  .mw-cart-popup-count {
    border: none;
    padding: 0;
    color: #2F2F2F;
  }

  /* CTA inferior */
  .mw-cart-popup-actions {
    grid-column: 1 / -1;
    grid-row: 3;

    width: 100%;
    padding: 18px;
    background: #F4F1EA;
    border-top: 1px solid #DDD8CE;
  }

  .mw-cart-popup-button {
    width: 100%;
    min-width: 0;
    min-height: 58px;

    padding: 0 24px;
    border-radius: 8px;

    font-size: 14px;
    letter-spacing: 1.1px;
  }

  /* Cerrar */
  .mw-cart-popup-close {
    top: 14px;
    right: 14px;

    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #8B4E05;
    color: #FFFFFF;
    border-radius: 7px;

    font-size: 24px;
    line-height: 1;
  }

  .mw-cart-popup-close:hover {
    background: #6F3D00;
    color: #FFFFFF;
  }
}