/* -----------------------------------------------------------------------------
   Header mini-cart (.open-side-cart, markup in header.php and the cart fragment in
   functions.php) in the Kundenportal v2 look. Loaded on every page after style.css;
   everything is scoped to .open-side-cart, so only the popup changes.
   Show/hide stays with the existing scripts (inline style display:none/block).
----------------------------------------------------------------------------- */
.open-side-cart {
  --sc-navy: #102948;
  --sc-navy-hover: #1a3a62;
  --sc-ice: #d2e1f4;
  --sc-ice-50: #f3f7fc;
  --sc-accent: #0b5cb5;
  --sc-border: #e1e6ee;
  --sc-text: #1e2635;
  --sc-muted: #677285;
  --sc-ring: 0 0 0 3px rgba(11, 92, 181, 0.28);
  width: 400px;
  min-width: 0;
  max-width: calc(100vw - 32px);
  margin-top: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--sc-border);
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(17, 24, 39, 0.04), 0 18px 40px -12px rgba(17, 24, 39, 0.22);
  color: var(--sc-text);
  text-align: left;
}
.open-side-cart *, .open-side-cart *::before, .open-side-cart *::after { box-sizing: border-box; }
.open-side-cart .cart_area { padding: 0; }

/* Head: "Warenkorb - n" + link to the cart */
.open-side-cart .cart_count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--sc-border);
}
.open-side-cart .cart_count > span {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--sc-navy);
  letter-spacing: normal;
}
.open-side-cart .cart_count .buttons { margin: 0; }
.open-side-cart .cart_count .buttons a,
.open-side-cart .cart_count .buttons a:hover {
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--sc-accent);
  background: none;
  text-decoration: none !important;
  letter-spacing: normal;
  line-height: 1.4;
}
.open-side-cart .cart_count .buttons a:hover { text-decoration: underline !important; }

/* Item list */
.open-side-cart ul.cart_list.product_list_widget {
  height: auto;
  max-height: min(340px, 50vh);
  overflow-y: auto;
  margin: 0;
  padding: 8px 12px;
  list-style: none;
}
.open-side-cart .cart_list.product_list_widget li {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 !important;
  padding: 10px 40px 10px 8px !important;
  border: 0;
  border-radius: 9px;
  background: none;
  transition: background 0.15s;
}
.open-side-cart .cart_list.product_list_widget li + li { border-top: 1px solid var(--sc-border); border-radius: 0; }
.open-side-cart .cart_list.product_list_widget li::before { content: none; }
.open-side-cart .cart_list.product_list_widget li:hover { background: var(--sc-ice-50); }
.open-side-cart .cart_list.product_list_widget li.empty {
  display: block;
  padding: 28px 12px !important;
  text-align: center;
  color: var(--sc-muted);
  font-size: 15px;
}
.open-side-cart .cart_list.product_list_widget li.empty:hover { background: none; }

.open-side-cart a.pro_link {
  display: grid !important;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-width: 0;
  text-decoration: none;
}
.open-side-cart .pro_link figure {
  width: 56px;
  height: 56px;
  margin: 0;
  overflow: hidden;
  border-radius: 9px;
  border: 1px solid var(--sc-border);
  background: var(--sc-ice-50);
}
.open-side-cart .pro_link figure img,
.open-side-cart.open-side-cart ul.cart_list li img {
  float: none;
  width: 100%;
  min-width: 0;
  height: 100% !important;
  margin: 0;
  object-fit: cover;
  display: block;
}
.open-side-cart .cart_list.product_list_widget a.pro_link .pro_title {
  font-size: 15px;
  font-weight: 600 !important;
  line-height: 1.35;
  color: var(--sc-navy);
  overflow-wrap: anywhere;
  hyphens: auto;
}
.open-side-cart .price_pro {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  margin-left: 0;
  white-space: nowrap;
  text-align: right;
}
.open-side-cart .price_pro > span:not(.woocommerce-Price-amount) {
  font-size: 12px;
  font-weight: 600;
  color: var(--sc-muted);
  background: #f4f6fa;
  border: 1px solid var(--sc-border);
  border-radius: 999px;
  padding: 0 8px;
  line-height: 20px;
}
.open-side-cart span.woocommerce-Price-amount.amount {
  display: inline;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: normal;
  color: var(--sc-navy);
}
.open-side-cart .pro_link:hover .pro_title { color: var(--sc-accent); }
.open-side-cart .pro_link:focus-visible { outline: none; box-shadow: var(--sc-ring); border-radius: 9px; }

/* Variation data (wc get_item_data) under an item */
.open-side-cart .cart_list dl.variation { margin: 4px 0 0 70px; font-size: 13px; color: var(--sc-muted); }

/* Remove (x): quiet round icon button on the right */
.open-side-cart .cart_list li a.remove,
.woocommerce .open-side-cart .cart_list li a.remove {
  position: absolute;
  top: 50%;
  right: 6px;
  left: auto;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  background: transparent !important;
  color: var(--sc-muted) !important;
  font-size: 20px;
  font-weight: 400 !important;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.open-side-cart .cart_list li a.remove:hover,
.woocommerce .open-side-cart .cart_list li a.remove:hover {
  background: #fdecec !important;
  color: #b42020 !important;
}

/* Footer: total + checkout button */
.open-side-cart .sub_ttl_btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 16px 20px;
  border-top: 1px solid var(--sc-border);
  background: var(--sc-ice-50);
}
.open-side-cart .sub_ttl_btn .total {
  display: flex;
  flex-direction: column;
  margin: 0;
  line-height: 1.25;
}
.open-side-cart .sub_ttl_btn strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--sc-muted);
  letter-spacing: normal;
}
.open-side-cart .sub_ttl_btn .total span.woocommerce-Price-amount.amount { font-size: 20px; }
.open-side-cart .sub_ttl_btn small { font-size: 12px; color: var(--sc-muted); }
.open-side-cart .sub_ttl_btn .buttons { margin: 0; }
.open-side-cart .sub_ttl_btn .buttons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: 9px;
  background: var(--sc-navy);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: normal;
  box-shadow: 0 1px 2px rgba(16, 41, 72, 0.18), 0 8px 18px -8px rgba(16, 41, 72, 0.5);
  transition: background 0.15s;
}
.open-side-cart .sub_ttl_btn .buttons a::after { content: '\2192'; font-weight: 400; }
.open-side-cart .sub_ttl_btn .buttons a:hover { background: var(--sc-navy-hover); color: #fff; }
.open-side-cart .sub_ttl_btn .buttons a:focus-visible { outline: none; box-shadow: var(--sc-ring); }

/* Below the desktop navbar the popup sits in the opened burger menu (style.css: position static) */
@media (max-width: 991px) {
  .open-side-cart {
    width: 100%;
    max-width: none;
    margin-top: 16px;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05), 0 2px 6px -1px rgba(17, 24, 39, 0.06);
  }
}
@media (max-width: 480px) {
  .open-side-cart .cart_count, .open-side-cart .sub_ttl_btn { padding: 14px 16px; }
  .open-side-cart ul.cart_list.product_list_widget { padding: 6px 8px; }
  .open-side-cart a.pro_link { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; }
  .open-side-cart .pro_link figure { width: 48px; height: 48px; }
  .open-side-cart .cart_list dl.variation { margin-left: 60px; }
}
