/* iWerkstatt Sidecart — compact, local and framework-free. */
:root {
  --iwsc-green: var(--iw-green, #90c541);
  --iwsc-green-dark: var(--iw-green-dark, #6f9f2f);
  --iwsc-soft: var(--iw-green-soft, #f5f8ff);
  --iwsc-bg: rgba(250, 252, 250, .97);
  --iwsc-text: var(--iw-text, #1d1d1f);
  --iwsc-muted: var(--iw-muted, #68686d);
  --iwsc-border: rgba(144, 197, 65, .13);
  --iwsc-font: var(--iw-font, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif);
  --iwsc-shadow: -16px 0 48px rgba(18, 36, 18, .14);
}

.iwsc-root, .iwsc-root * { box-sizing: border-box; }
.iwsc-root { font-family: var(--iwsc-font); color: var(--iwsc-text); font-size: 15px; }

.iwsc-trigger {
  position: fixed;
  z-index: 2147483645;
  right: 22px;
  bottom: 22px;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin: 0;
  padding: 0;
  color: #fff;
  background: var(--iwsc-green);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 12px 28px rgba(144, 197, 65, .22);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.iwsc-trigger:hover { background: var(--iwsc-green-dark); box-shadow: 0 15px 32px rgba(144, 197, 65, .28); transform: translateY(-2px); }
.iwsc-trigger:focus-visible { outline: 3px solid rgba(144,197,65,.25); outline-offset: 4px; }
.iwsc-trigger svg { width: 34px; height: 34px; }
.iwsc-trigger-count {
  position: absolute;
  top: -3px;
  left: -3px;
  display: grid;
  place-items: center;
  min-width: 25px;
  height: 25px;
  padding: 0 6px;
  color: var(--iwsc-green);
  background: #f2f2f2;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  transition: opacity .16s ease, transform .16s ease;
}
.iwsc-trigger-count.is-empty { opacity: 0; transform: scale(.75); }

.iwsc-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  background: rgba(15, 17, 15, .34);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .18s ease;
}
.iwsc-overlay[hidden] { display: block; visibility: hidden; pointer-events: none; }

.iwsc-drawer {
  position: fixed;
  z-index: 2147483647;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(480px, 100vw);
  height: 100dvh;
  max-height: 100dvh;
  color: var(--iwsc-text);
  background: var(--iwsc-bg);
  border-left: 1px solid rgba(255,255,255,.78);
  box-shadow: var(--iwsc-shadow);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  outline: none;
  opacity: 0;
  transform: translate3d(36px, 0, 0);
  visibility: hidden;
  pointer-events: none;
  transition: transform .22s cubic-bezier(.2,.72,.2,1), opacity .16s ease, visibility 0s linear .22s;
}
.iwsc-root.is-open .iwsc-overlay { opacity: 1; visibility: visible; pointer-events: auto; }
.iwsc-root.is-open .iwsc-drawer {
  opacity: 1;
  transform: translate3d(0,0,0);
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}
body.iwsc-lock { overflow: hidden !important; }

.iwsc-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 14px 18px 14px 20px;
  background: rgba(250,252,250,.86);
  border-bottom: 1px solid var(--iwsc-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.iwsc-header h2 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: 0; line-height: 1.2; }
.iwsc-close, .iwsc-remove {
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  color: var(--iwsc-text);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.iwsc-close { width: 38px; height: 38px; border-radius: 50%; }
.iwsc-close:hover { background: rgba(144,197,65,.07); }
.iwsc-close svg { width: 24px; height: 24px; }

.iwsc-content { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; overflow: hidden; }
.iwsc-items {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 18px 28px;
  scrollbar-width: thin;
  scrollbar-color: rgba(144,197,65,.3) transparent;
}
.iwsc-item {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0,1fr);
  gap: 14px;
  padding: 8px 0 18px;
  border-bottom: 1px solid rgba(144,197,65,.09);
}
.iwsc-item + .iwsc-item { padding-top: 18px; }
.iwsc-item:last-child { border-bottom: 0; }
.iwsc-remove {
  position: absolute;
  z-index: 2;
  top: 0;
  left: -8px;
  width: 25px;
  height: 25px;
  color: #4b4d52;
  background: #ececf2;
  border-radius: 50%;
  transition: color .15s ease, background .15s ease, transform .15s ease;
}
.iwsc-remove:hover { color: #fff; background: #b42318; transform: scale(1.04); }
.iwsc-remove svg { width: 14px; height: 14px; }
.iwsc-thumb {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  padding: 7px;
  overflow: hidden;
  background: rgba(255,255,255,.84);
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 50%;
}
.iwsc-thumb img { display: block; width: 100%; height: 100%; margin: 0; object-fit: contain; }
.iwsc-item-main { min-width: 0; padding-top: 2px; }
.iwsc-item-heading { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: start; }
.iwsc-item-name { color: var(--iwsc-text); font-size: 15px; font-weight: 650; line-height: 1.3; letter-spacing: 0; text-decoration: none; }
.iwsc-item-name:hover { color: var(--iwsc-green); }
.iwsc-item-price { white-space: nowrap; color: var(--iwsc-text); font-size: 15px; font-weight: 560; letter-spacing: 0; }
.iwsc-delivery { margin: 6px 0 0; color: var(--iwsc-muted); font-size: 12px; line-height: 1.4; letter-spacing: 0; }
.iwsc-item-meta { margin-top: 6px; color: var(--iwsc-muted); font-size: 12px; line-height: 1.4; }
.iwsc-item-meta dl { margin: 0; }
.iwsc-item-meta dt, .iwsc-item-meta dd { display: inline; margin: 0; }
.iwsc-item-meta dt::after { content: ": "; }
.iwsc-item-meta dd::after { content: " · "; }
.iwsc-item-meta dd:last-child::after { content: ""; }
.iwsc-item-meta p { display: inline; margin: 0; }

.iwsc-quantity { display: inline-grid; grid-template-columns: 30px 40px 30px; align-items: center; margin-top: 10px; overflow: hidden; border: 1px solid var(--iwsc-border); border-radius: 999px; background: rgba(255,255,255,.82); }
.iwsc-quantity button, .iwsc-quantity input { width: 100%; height: 30px; margin: 0; padding: 0; color: var(--iwsc-text); background: transparent; border: 0; text-align: center; font: inherit; }
.iwsc-quantity button { cursor: pointer; font-size: 17px; }
.iwsc-quantity button:hover { background: var(--iwsc-soft); color: var(--iwsc-green); }
.iwsc-quantity input { appearance: textfield; font-size: 12px; font-weight: 650; }
.iwsc-quantity input::-webkit-inner-spin-button, .iwsc-quantity input::-webkit-outer-spin-button { appearance: none; margin: 0; }

.iwsc-footer {
  flex: 0 0 auto;
  padding: 0 20px 18px;
  background: rgba(250,252,250,.92);
  border-top: 1px solid var(--iwsc-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.iwsc-coupon { margin: 0 -20px 16px; border-bottom: 1px solid var(--iwsc-border); }
.iwsc-coupon summary { position: relative; display: flex; align-items: center; min-height: 50px; padding: 0 52px 0 20px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 620; letter-spacing: 0; }
.iwsc-coupon summary::-webkit-details-marker { display: none; }
.iwsc-coupon summary span::before, .iwsc-coupon summary span::after { content: ""; position: absolute; right: 22px; top: 50%; width: 11px; height: 1.5px; background: currentColor; transition: transform .18s ease; }
.iwsc-coupon summary span::before { transform: rotate(45deg) translateX(-3px); }
.iwsc-coupon summary span::after { transform: rotate(-45deg) translateX(3px); }
.iwsc-coupon[open] summary span::before { transform: rotate(-45deg) translateX(-3px); }
.iwsc-coupon[open] summary span::after { transform: rotate(45deg) translateX(3px); }
.iwsc-coupon-form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding: 0 20px 14px; }
.iwsc-coupon-form input { min-width: 0; height: 40px; padding: 0 12px; color: var(--iwsc-text); background: #fff; border: 1px solid rgba(29,29,31,.2); border-radius: 10px; font: inherit; font-size: 13px; }
.iwsc-coupon-form button { height: 40px; padding: 0 14px; color: #fff; background: var(--iwsc-green); border: 0; border-radius: 10px; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.iwsc-notices { margin-bottom: 10px; color: #8a1c14; font-size: 12px; }
.iwsc-notices:empty { display: none; }
.iwsc-notices ul, .iwsc-notices .woocommerce-error, .iwsc-notices .woocommerce-message, .iwsc-notices .woocommerce-info { margin: 0; padding: 9px 11px; background: rgba(255,255,255,.78); border: 1px solid currentColor; border-radius: 9px; list-style: none; }
.iwsc-total-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-size: 16px; font-weight: 650; letter-spacing: 0; }
.iwsc-total-row strong { font-size: 19px; font-weight: 720; }
.iwsc-tax-note { margin: 4px 0 13px; color: var(--iwsc-muted); font-size: 11px; letter-spacing: 0; }
.iwsc-checkout { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 10px 16px; color: #fff !important; background: var(--iwsc-green); border-radius: 999px; font-size: 15px; font-weight: 600; letter-spacing: 0; text-decoration: none !important; transition: transform .16s ease, background .16s ease, box-shadow .16s ease; }
.iwsc-checkout:hover { color: #fff !important; background: var(--iwsc-green-dark); box-shadow: 0 9px 20px rgba(144,197,65,.20); transform: translateY(-1px); }
.iwsc-checkout svg { width: 22px; height: 22px; }
.iwsc-continue { display: block; width: 100%; margin: 9px 0 0; padding: 0; color: var(--iwsc-muted); background: transparent; border: 0; font: inherit; font-size: 13px; letter-spacing: 0; cursor: pointer; }
.iwsc-continue:hover { color: var(--iwsc-green); }

.iwsc-empty { flex: 1 1 auto; display: grid; place-items: center; align-content: center; padding: 38px 24px; text-align: center; }
.iwsc-empty-icon { display: grid; place-items: center; width: 78px; height: 78px; color: var(--iwsc-green); background: rgba(255,255,255,.76); border-radius: 50%; box-shadow: 0 12px 30px rgba(144,197,65,.10); }
.iwsc-empty-icon svg { width: 38px; height: 38px; }
.iwsc-empty h3 { margin: 18px 0 6px; font-size: 20px; }
.iwsc-empty p { margin: 0 0 18px; color: var(--iwsc-muted); font-size: 14px; }
.iwsc-empty-button { min-height: 44px; padding: 0 20px; color: #fff; background: var(--iwsc-green); border: 0; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; }

.iwsc-root.is-busy .iwsc-content { opacity: .6; pointer-events: none; }
.iwsc-root.is-busy .iwsc-trigger { pointer-events: none; }

@media (max-width: 782px) {
  .iwsc-root { font-size: 14px; }
  .iwsc-trigger { right: 16px; bottom: calc(90px + env(safe-area-inset-bottom)); width: 58px; height: 58px; }
  .iwsc-trigger:hover { transform: none; }
  .iwsc-trigger svg { width: 30px; height: 30px; }
  .iwsc-trigger-count { top: -4px; left: -4px; min-width: 23px; height: 23px; font-size: 11px; }
  .iwsc-drawer { width: 100vw; border-left: 0; transform: translate3d(26px,0,0); }
  .iwsc-header { min-height: 62px; padding: 12px 14px 12px 16px; }
  .iwsc-header h2 { font-size: 18px; }
  .iwsc-close { width: 36px; height: 36px; }
  .iwsc-items { padding: 14px 14px 24px; }
  .iwsc-item { grid-template-columns: 66px minmax(0,1fr); gap: 11px; padding-bottom: 16px; }
  .iwsc-thumb { width: 66px; height: 66px; padding: 6px; }
  .iwsc-remove { left: -5px; width: 23px; height: 23px; }
  .iwsc-item-heading { gap: 8px; }
  .iwsc-item-name { font-size: 14px; }
  .iwsc-item-price { font-size: 14px; }
  .iwsc-delivery, .iwsc-item-meta { font-size: 11px; }
  .iwsc-footer { padding: 0 16px calc(16px + env(safe-area-inset-bottom)); }
  .iwsc-coupon { margin: 0 -16px 14px; }
  .iwsc-coupon summary { min-height: 48px; padding-left: 16px; font-size: 13px; }
  .iwsc-coupon-form { padding: 0 16px 14px; }
  .iwsc-total-row { font-size: 15px; }
  .iwsc-total-row strong { font-size: 18px; }
  .iwsc-checkout { min-height: 46px; font-size: 14px; }
  .iwsc-continue { font-size: 12px; }
  body:has(.iw-mobile-nav-container) .iwsc-trigger { display: none; }
}

body.admin-bar .iwsc-trigger { bottom: 22px; }

@media (prefers-reduced-motion: reduce) {
  .iwsc-drawer, .iwsc-overlay, .iwsc-trigger, .iwsc-remove, .iwsc-checkout { transition: none !important; }
}

/* Hide the temporary Gemini mobile navigation while the full-screen cart is open. */
body.iwsc-lock .iw-mobile-nav-wrapper { opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; }

/*
 * Keep PayPal Pay-Later messaging and similar embedded payment widgets below
 * the Sidecart while it is open. Some PayPal iframes create an exceptionally
 * high stacking layer; this temporary stacking context lets the Sidecart
 * overlay blur them instead of allowing the text to float above the drawer.
 */
body.iwsc-lock #ppcp-messages,
body.iwsc-lock #ppcp-messages-container,
body.iwsc-lock [id^="ppcp-messages"],
body.iwsc-lock .ppcp-messages,
body.iwsc-lock .ppcp-messages-container,
body.iwsc-lock .ppcp-pay-later-message,
body.iwsc-lock .paypal-messages,
body.iwsc-lock [data-pp-message] {
  position: relative !important;
  z-index: 0 !important;
  isolation: isolate !important;
  pointer-events: none !important;
}
