/* =========================================================
   MX GLOBAL UPSELL MODAL
   ========================================================= */

html.mx-upsell-open,
body.mx-upsell-open{
  overflow:hidden !important;
}

.mx-global-upsell{
  position:fixed;
  inset:0;
  z-index:100000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .18s ease, visibility .18s ease;
}

.mx-global-upsell.is-open{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}

.mx-global-upsell__overlay{
  position:absolute;
  inset:0;
  border:0;
  background:rgba(0,0,0,.56);
  backdrop-filter:blur(4px);
  -webkit-backdrop-filter:blur(4px);
  cursor:pointer;
}

.mx-global-upsell__dialog{
  position:relative;
  z-index:2;
  width:min(980px, 100%);
  max-height:min(86vh, 820px);
  background:#fff;
  color:#111827;
  border-radius:18px;
  box-shadow:0 28px 80px rgba(0,0,0,.32);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  transform:translateY(12px) scale(.985);
  transition:transform .18s ease;
}

.mx-global-upsell.is-open .mx-global-upsell__dialog{
  transform:translateY(0) scale(1);
}

.mx-global-upsell__close{
  position:absolute;
  top:12px;
  right:12px;
  width:38px;
  height:38px;
  border:0;
  border-radius:999px;
  background:#f3f4f6;
  color:#111827;
  font-size:28px;
  line-height:1;
  cursor:pointer;
  z-index:3;
}

.mx-global-upsell__head{
  display:flex;
  align-items:flex-start;
  gap:14px;
  padding:24px 60px 18px 24px;
  border-bottom:1px solid #eef2f7;
}

.mx-global-upsell__success{
  width:42px;
  height:42px;
  flex:0 0 42px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:#16a34a;
  color:#fff;
  font-weight:900;
  font-size:22px;
}

.mx-global-upsell__eyebrow{
  font-size:12px;
  line-height:1;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#16a34a;
  margin-bottom:7px;
}

.mx-global-upsell__head h2{
  margin:0;
  color:#111827;
  font-size:24px;
  line-height:1.15;
  font-weight:900;
}

.mx-global-upsell__head p{
  margin:7px 0 0;
  color:#6b7280;
  font-size:14px;
  line-height:1.45;
}

.mx-global-upsell__product{
  display:grid;
  grid-template-columns:58px minmax(0,1fr);
  gap:12px;
  align-items:center;
  margin:16px 24px 0;
  padding:12px;
  border:1px solid #e5e7eb;
  border-radius:14px;
  background:#f9fafb;
}

.mx-global-upsell__product-img{
  width:58px;
  height:58px;
  object-fit:contain;
  border-radius:10px;
  background:#fff;
  border:1px solid #edf2f7;
}

.mx-global-upsell__product strong{
  display:block;
  color:#111827;
  font-size:14px;
  line-height:1.3;
}

.mx-global-upsell__product span{
  display:block;
  color:#6b7280;
  font-size:13px;
  margin-top:4px;
}

.mx-global-upsell__groups{
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  padding:18px 24px 6px;
}

.mx-global-upsell__section{
  margin-bottom:22px;
}

.mx-global-upsell__section-title{
  margin:0 0 12px;
  color:#111827;
  font-size:18px;
  line-height:1.2;
  font-weight:900;
}

.mx-global-upsell__grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:12px;
}

.mx-global-upsell-card{
  min-width:0;
  border:1px solid #e5e7eb;
  border-radius:14px;
  background:#fff;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  box-shadow:0 4px 14px rgba(15,23,42,.05);
}

.mx-global-upsell-card__media{
  height:132px;
  padding:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#f8fafc;
}

.mx-global-upsell-card__img{
  width:100%;
  height:100%;
  object-fit:contain;
}

.mx-global-upsell-card__placeholder{
  width:100%;
  height:100%;
  display:grid;
  place-items:center;
  color:#94a3b8;
  font-weight:800;
  font-size:13px;
}

.mx-global-upsell-card__body{
  flex:1;
  padding:12px;
  display:flex;
  flex-direction:column;
  min-width:0;
}

.mx-global-upsell-card__title{
  color:#111827 !important;
  font-size:13px;
  line-height:1.35;
  font-weight:800;
  text-decoration:none;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.mx-global-upsell-card__bottom{
  margin-top:auto;
  padding-top:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}

.mx-global-upsell-card__bottom strong{
  color:#111827;
  font-size:15px;
  font-weight:900;
  white-space:nowrap;
}

.mx-global-upsell-card__btn{
  min-height:34px;
  border:0;
  border-radius:8px;
  padding:0 12px;
  background:#68b800;
  color:#fff;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}

.mx-global-upsell-card__btn.is-loading{
  opacity:.7;
  cursor:wait;
}

.mx-global-upsell-card__btn.is-added{
  background:#16a34a;
}

.mx-global-upsell__empty{
  padding:14px;
  border-radius:12px;
  background:#f8fafc;
  color:#6b7280;
  font-size:14px;
}

.mx-global-upsell__footer{
  display:flex;
  justify-content:flex-end;
  gap:12px;
  padding:16px 24px 22px;
  border-top:1px solid #eef2f7;
  background:#fff;
}

.mx-global-upsell__continue,
.mx-global-upsell__cart{
  min-height:44px;
  border-radius:10px;
  padding:0 18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  font-size:14px;
  font-weight:900;
}

.mx-global-upsell__continue{
  border:1px solid #d1d5db;
  background:#fff;
  color:#374151;
  cursor:pointer;
}

.mx-global-upsell__cart{
  border:1px solid #68b800;
  background:#68b800;
  color:#fff !important;
}

@media (max-width:768px){
  .mx-global-upsell{
    align-items:flex-end;
    padding:8px;
  }

  .mx-global-upsell__dialog{
    max-height:88dvh;
    border-radius:18px 18px 12px 12px;
  }

  .mx-global-upsell__head{
    padding:20px 54px 14px 16px;
  }

  .mx-global-upsell__head h2{
    font-size:20px;
  }

  .mx-global-upsell__product{
    margin:12px 16px 0;
  }

  .mx-global-upsell__groups{
    padding:14px 16px 4px;
  }

  .mx-global-upsell__grid{
    grid-template-columns:repeat(2, minmax(0,1fr));
    gap:10px;
  }

  .mx-global-upsell-card__media{
    height:118px;
  }

  .mx-global-upsell__footer{
    padding:12px 16px 16px;
    flex-direction:column;
  }

  .mx-global-upsell__continue,
  .mx-global-upsell__cart{
    width:100%;
  }
}

/* =========================================================
   PRODUCT PAGE INLINE ADMIN UPSELL SERVICES
   ========================================================= */

.mx-admin-services.is-empty{
  display:none !important;
}

.mx-inline-upsells__body,
.mx-inline-upsells__warranty{
  display:grid;
  gap:8px;
}

.mx-inline-upsells__warranty{
  margin-top:10px;
}

.mx-inline-upsell-note{
  display:block;
  margin-top:3px;
  color:#6b7280;
  font-size:12px;
  line-height:1.35;
  font-weight:500;
}

.mx-warranty-product{
  padding-top:9px !important;
  padding-bottom:9px !important;
  border-top:1px dashed #dfe4ea;
}

.mx-warranty-checkbox:checked + .mx-service-check,
.mx-service-checkbox:checked + .mx-service-check{
  background:#68b800;
  border-color:#68b800;
}

.mx-warranty-checkbox:checked + .mx-service-check svg,
.mx-service-checkbox:checked + .mx-service-check svg{
  opacity:1;
}

.mx-service-check svg{
  width:14px;
  height:14px;
  fill:#fff;
  opacity:0;
  display:block;
}

.mx-inline-upsells__empty{
  color:#6b7280;
  font-size:13px;
  line-height:1.45;
}

/* =========================================================
   GLOBAL UPSELL NOTICE / STOCK ERRORS
   ========================================================= */
.mx-global-upsell__notice{
  display:none;
  margin:0 0 14px;
  padding:12px 14px;
  border-radius:10px;
  font-size:14px;
  line-height:1.45;
  font-weight:800;
}

.mx-global-upsell__notice.is-visible{
  display:block;
}

.mx-global-upsell__notice.is-error{
  background:#fef2f2;
  color:#991b1b;
  border:1px solid #fecaca;
}

.mx-global-upsell__notice.is-success{
  background:#ecfdf5;
  color:#065f46;
  border:1px solid #86efac;
}

/* =========================================================
   V2 — GROUP TITLES, SELECTED LIST, SERVICE CHECKBOXES
   ========================================================= */
.mx-global-upsell__section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin:0 0 12px;
}

.mx-global-upsell__section-kicker{
  display:inline-flex;
  align-items:center;
  min-height:22px;
  padding:0 8px;
  border-radius:999px;
  background:#eef9ff;
  color:#4f9600;
  font-size:11px;
  line-height:1;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.04em;
  order:2;
  white-space:nowrap;
}

.mx-global-upsell__section-title{
  margin:0 !important;
}

.mx-global-upsell__selected{
  margin:14px 24px 0;
  padding:12px;
  border:1px solid #bbf7d0;
  border-radius:14px;
  background:#f0fdf4;
}

.mx-global-upsell__selected-title{
  margin-bottom:8px;
  color:#166534;
  font-size:13px;
  font-weight:900;
}

.mx-global-upsell__selected-list{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:8px;
}

.mx-global-upsell__selected-item{
  display:grid;
  grid-template-columns:34px minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  padding:7px 8px;
  border-radius:10px;
  background:#fff;
}

.mx-global-upsell__selected-item img,
.mx-global-upsell__selected-dot{
  width:34px;
  height:34px;
  border-radius:8px;
  background:#f8fafc;
  border:1px solid #e5e7eb;
}

.mx-global-upsell__selected-item img{
  object-fit:contain;
}

.mx-global-upsell__selected-dot{
  display:grid;
  place-items:center;
  color:#16a34a;
  font-weight:900;
}

.mx-global-upsell__selected-name{
  min-width:0;
  color:#111827;
  font-size:13px;
  font-weight:800;
  line-height:1.3;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.mx-global-upsell__selected-price{
  color:#111827;
  font-size:13px;
  font-weight:900;
  white-space:nowrap;
}

.mx-global-upsell__services-list{
  display:grid;
  gap:9px;
}

.mx-global-upsell-service{
  position:relative;
  display:grid;
  grid-template-columns:24px minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  padding:12px;
  border:1px solid #e5e7eb;
  border-radius:14px;
  background:#fff;
  cursor:pointer;
  box-shadow:0 4px 14px rgba(15,23,42,.04);
}

.mx-global-upsell-service.is-loading{
  opacity:.7;
  cursor:wait;
}

.mx-global-upsell-service.is-added{
  border-color:#86efac;
  background:#f0fdf4;
}

.mx-global-upsell-service__input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.mx-global-upsell-service__check{
  width:22px;
  height:22px;
  border:1px solid #aab1b8;
  border-radius:6px;
  background:#fff;
  display:grid;
  place-items:center;
}

.mx-global-upsell-service__check svg{
  width:14px;
  height:14px;
  fill:#fff;
  opacity:0;
}

.mx-global-upsell-service__input:checked + .mx-global-upsell-service__check{
  background:#68b800;
  border-color:#68b800;
}

.mx-global-upsell-service__input:checked + .mx-global-upsell-service__check svg{
  opacity:1;
}

.mx-global-upsell-service__content{
  display:grid;
  gap:3px;
  min-width:0;
}

.mx-global-upsell-service__title{
  color:#111827;
  font-size:14px;
  line-height:1.3;
  font-weight:900;
}

.mx-global-upsell-service__desc{
  color:#6b7280;
  font-size:12px;
  line-height:1.35;
}

.mx-global-upsell-service__price{
  color:#111827;
  font-size:14px;
  font-weight:900;
  white-space:nowrap;
}

@media (max-width:768px){
  .mx-global-upsell__selected{
    margin:12px 16px 0;
  }

  .mx-global-upsell__section-head{
    flex-direction:column;
    align-items:flex-start;
    gap:7px;
  }

  .mx-global-upsell__section-kicker{
    order:0;
  }

  .mx-global-upsell-service{
    grid-template-columns:24px minmax(0,1fr);
  }

  .mx-global-upsell-service__price{
    grid-column:2;
  }
}

/* Selected accessories list */
.mx-global-upsell__selected{
  margin:14px 0;
  padding:12px;
  border:1px solid #dbeafe;
  background:#eff6ff;
  border-radius:14px;
}
.mx-global-upsell__selected-title{
  margin-bottom:8px;
  font-size:13px;
  font-weight:900;
  color:#1e3a8a;
}
.mx-global-upsell__selected-list{
  display:grid;
  gap:8px;
  margin:0;
  padding:0;
  list-style:none;
}
.mx-global-upsell__selected-item{
  display:grid;
  grid-template-columns:40px minmax(0,1fr) 22px;
  gap:10px;
  align-items:center;
  padding:8px;
  border-radius:10px;
  background:#fff;
}
.mx-global-upsell__selected-media{
  width:40px;
  height:40px;
  display:grid;
  place-items:center;
  border-radius:8px;
  overflow:hidden;
  background:#f8fafc;
}
.mx-global-upsell__selected-media img{
  width:100%;
  height:100%;
  object-fit:contain;
}
.mx-global-upsell__selected-info{
  min-width:0;
  display:grid;
  gap:2px;
}
.mx-global-upsell__selected-info strong{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:13px;
  color:#111827;
}
.mx-global-upsell__selected-info small{
  color:#4b5563;
  font-weight:800;
}
.mx-global-upsell__selected-check{
  width:22px;
  height:22px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:#16a34a;
  color:#fff;
  font-size:12px;
  font-weight:900;
}