/* ============================================================= */
/* Nieuwe winkelwagen-popup (#cart-popup) — huisstijl Decoprof    */
/* Los van de oude #add-cart-popup. Test: ?cartpopuptest=1        */
/* ============================================================= */

.cart-popup { display: none; }
.cart-popup.is-open { display: block; position: relative; z-index: 2147483647; }
body.cart-popup-open { overflow: hidden; }

.cart-popup__overlay {
  position: fixed; inset: 0; z-index: 2147483646;
  background: rgba(41, 56, 75, 0.6);
}

.cart-popup__dialog {
  position: fixed; z-index: 2147483647;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  background: #fff; border-radius: 10px;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 2px 40px 8px rgba(0, 0, 0, 0.12);
}

/* Sluitknop */
.cart-popup__x {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  background: #fff; border: 1px solid #ECECEC; border-radius: 50%;
  width: 36px; height: 36px; min-width: 0;
  flex: 0 0 auto; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background-color .15s ease;
}
.cart-popup__x:hover { background: #FAFAFA; }
.cart-popup__x i { font-style: normal; }
.cart-popup__x i::before { content: '\00D7'; font-size: 22px; line-height: 1; color: #29384B; }

/* ---------- Kop ---------- */
.cart-popup__head {
  flex: 0 0 auto;
  padding: 28px 28px 20px;
  border-bottom: 1px solid #ECECEC;
}
.cart-popup__title {
  color: #70C067; font-size: 16px; font-weight: 800;
  margin: 0 0 14px;
}
.cart-popup__chosen { display: flex; align-items: flex-start; gap: 16px; }
.cart-popup__chosen-img { flex: 0 0 72px; width: 72px; height: 72px; }
.cart-popup__chosen-img img { width: 100%; height: 100%; object-fit: contain; }
.cart-popup__chosen-info { min-width: 0; flex: 1 1 auto; }
.cart-popup__chosen-title {
  display: block; color: #29384B; font-size: 16px; font-weight: 800;
  line-height: 1.3; text-decoration: none;
}
.cart-popup__chosen-title:hover { text-decoration: underline; }

/* Toegevoegd-lijst bovenin */
.cart-popup__added-list {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid #ECECEC;
}
.cart-popup__added-title { color: #70C067; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.cart-popup__added-list ul { list-style: none; padding: 0; margin: 0; }
.cart-popup__added-list li { font-size: 13px; color: #29384B; padding: 2px 0; }
.cart-popup__active-color { margin-top: 6px; }
#cart-popup .cart-popup__active-color .active-color .inner {
  min-height: 0 !important;
  height: auto !important;
}
#cart-popup .cart-popup__active-color .active-color .color {
  height: auto !important;
}
.cart-popup .product-information--detailed {
  font-size: 12px; color: #898D93; margin-top: 4px; line-height: 1.3;
}

/* Bundelregels */
.cart-popup__bundle-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.cart-popup__bundle-plus { color: #898D93; font-weight: 700; }
.cart-popup__bundle-tile { display: flex; align-items: center; gap: 8px; }
.cart-popup__bundle-color { width: 18px; height: 18px; border-radius: 4px; border: 1px solid #ECECEC; flex: 0 0 auto; }
.cart-popup__bundle-title { font-size: 13px; color: #29384B; line-height: 1.3; }

/* ---------- Body (scroll) ---------- */
.cart-popup__body {
  flex: 1 1 auto; overflow-y: auto;
  padding: 20px 28px;
}
.cart-popup__section-title {
  color: #29384B; font-size: 16px; font-weight: 800; margin: 0 0 12px;
}
.cart-popup__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start;
}

/* Gerelateerde tegel */
.cart-popup-item {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid #ECECEC; border-radius: 8px;
  padding: 10px; transition: border-color .15s, background .15s;
}
.cart-popup-item.is-added { border-color: #70C067; background: #f3faf1; }
.cart-popup-item__img { flex: 0 0 64px; width: 64px; height: 64px; display: block; }
.cart-popup-item__img img { width: 100%; height: 100%; object-fit: contain; }
.cart-popup-item__body { flex: 1 1 auto; min-width: 0; }
.cart-popup-item__label {
  display: inline-block; color: #fff; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .02em;
  padding: 2px 8px; border-radius: 4px; margin-bottom: 4px;
}
.cart-popup-item__title {
  display: block; font-size: 13px; font-weight: 600; color: #29384B;
  line-height: 1.3; margin-bottom: 4px; text-decoration: none;
}
.cart-popup-item__title:hover { text-decoration: underline; }
.cart-popup-item__desc {
  font-size: 12px; color: #666666; line-height: 1.35;
  margin: 0 0 6px;
}
.cart-popup-item__price { font-size: 14px; font-weight: 700; color: #29384B; }
.cart-popup-item__variants { margin-top: 8px; }
.cart-popup-variant-select {
  width: 100%; max-width: 260px; height: 40px;
  padding: 0 10px;
  border: 1px solid #ECECEC; border-radius: 6px;
  background: #fff; color: #29384B;
  font-size: 13px; font-weight: 600; cursor: pointer;
  -webkit-appearance: menulist; -moz-appearance: menulist; appearance: auto;
}
.cart-popup-variant-select:focus { border-color: #70C067; outline: none; }
.cart-popup-item__buy { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.cart-popup-item__qty {
  height: 48px; padding: 0 10px; min-width: 60px;
  border: 1px solid #ECECEC; border-radius: 6px;
  background-color: #fff; color: #29384B; font-size: 14px; cursor: pointer;
  -webkit-appearance: menulist; -moz-appearance: menulist; appearance: auto;
  background-image: none;
}
}
.cart-popup-item__add {
  flex: 0 0 auto; width: 48px; height: 48px;
  padding: 0; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.cart-popup-item__add i { margin: 0; }
.cart-popup-item__added {
  color: #70C067; font-weight: 600; font-size: 12px; margin-top: 6px;
}

/* ---------- HelloRetail in het popup-kader ---------- */
/* Alles strikt binnen #cart-popup zodat de HR-zoekoverlay niet wordt geraakt. */
.cart-popup__hr { margin-top: 24px; }
#cart-popup .addwish-recom { padding: 0 !important; margin: 0 !important; background: #fff !important; }
#cart-popup .aw-title { font-size: 16px !important; font-weight: 800 !important; color: #29384B !important; }
#cart-popup .addwish-recom .swiper-button-prev,
#cart-popup .addwish-recom .swiper-button-next {
  color: #29384B !important; background-color: #fff !important;
  border: 1px solid #ECECEC !important; box-shadow: 0 2px 8px rgba(41,56,75,0.15) !important;
}

/* ---------- Sticky knoppen ---------- */
.cart-popup__foot {
  flex: 0 0 auto;
  padding: 16px 28px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #ECECEC; background: #fff;
  display: flex; gap: 10px;
}
.cart-popup__foot .button { flex: 1 1 0; }

/* ---------- Mobiel ---------- */
@media (max-width: 767px) {
  .cart-popup__overlay { z-index: 9999998; }
  .cart-popup__dialog {
    width: 100vw; height: 100vh; height: 100dvh;
    max-height: 100vh; max-height: 100dvh;
    top: 0; left: 0; transform: none; border-radius: 0;
    z-index: 2147483647;
  }
  .cart-popup__head { padding: 18px 16px 14px; }
  .cart-popup__title { position: sticky; top: 0; }
  .cart-popup__body { padding: 16px; }
  .cart-popup__grid { grid-template-columns: 1fr; }
  .cart-popup__foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .cart-popup__x { position: fixed; top: 12px; right: 12px; z-index: 10000; }
}