/* Floating cart and modal panel follow the existing burgundy/white theme. */
.s2-cart-toggle {
  position: fixed; right: 20px; top: 50%; z-index: 1030;
  display: flex; align-items: center; justify-content: center;
  width: 58px; height: 58px; padding: 0; transform: translateY(-50%);
  color: #830e02; background: #fff; border: 1px solid #dedede;
  border-radius: 50%; box-shadow: 0 2px 7px #0002; cursor: pointer;
}
.s2-cart-toggle[hidden], .s2-drawer-footer[hidden] { display: none !important; }
.s2-cart-toggle svg { width: 28px; height: 28px; flex: none; }
.s2-cart-toggle .s2-cart-count {
  position: absolute; top: -5px; right: -5px; min-width: 24px; height: 24px;
  padding: 0 6px; border: 2px solid #fff; font-size: 12px; line-height: 20px;
}
.s2-cart-toggle:hover { border-color: #830e02; color: #830e02; }
.s2-cart-toggle:focus-visible, .s2-cart-drawer button:focus-visible,
.s2-cart-drawer a:focus-visible, .s2-cart-drawer input:focus-visible {
  outline: 2px solid #830e02 !important; outline-offset: 3px;
}
html.s2-drawer-open { overflow: hidden; }
.s2-cart-drawer {
  position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0;
  width: 480px; max-width: 100%; height: 100vh; height: 100dvh; max-height: none;
  overflow: hidden; border: 0; border-left: 1px solid #e7e7e7;
  color: #222; background: #fff; font-family: inherit;
  transform: translateX(100%); opacity: 0;
  transition: transform .22s ease, opacity .22s ease;
}
.s2-cart-drawer[open] { display: flex; flex-direction: column; }
.s2-cart-drawer.is-open { transform: translateX(0); opacity: 1; }
.s2-cart-drawer::backdrop { background: rgba(20, 18, 17, .35); }
.s2-drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 22px; border-bottom: 1px solid #e7e7e7; flex: none;
}
.s2-cart-drawer .s2-drawer-title { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.4; }
.s2-drawer-close {
  display: flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  flex: none; padding: 0; border: 1px solid #dedede; border-radius: 4px;
  color: #830e02; background: #fff; cursor: pointer;
}
.s2-drawer-close svg { width: 20px; height: 20px; }
.s2-drawer-scroll { padding: 0 22px; overflow: auto; overscroll-behavior: contain; flex: 1; min-height: 0; }
.s2-drawer-feedback:not(:empty), .s2-drawer-warnings:not(:empty) {
  margin: 18px 0 0; padding: 12px 14px; border-left: 3px solid #830e02;
  background: #f8f4f2; font-size: 14px; line-height: 1.5;
}
.s2-cart-drawer .s2-cart-list { gap: 0; margin: 0; }
.s2-cart-drawer .s2-cart-line--drawer {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px 16px;
  align-items: start; padding: 24px 0; border: 0; border-bottom: 1px solid #e7e7e7;
  border-radius: 0; transition: background-color .2s ease;
}
.s2-cart-drawer .s2-cart-line--drawer.is-added { background: #faf3f0; }
.s2-cart-drawer .s2-cart-line__image { grid-row: 1 / 3; }
.s2-cart-drawer .s2-cart-line__image picture { display: block; }
.s2-cart-drawer .s2-cart-line__image img { display: block; width: 64px; height: 64px; object-fit: contain; }
.s2-drawer-service-icon {
  display: flex; align-items: center; justify-content: center; min-height: 64px;
  border: 1px solid #e7d9d5; border-radius: 4px; color: #830e02; font-size: 12px; background: #faf6f4;
}
.s2-cart-drawer .s2-cart-line__name { font-size: 16px; font-weight: 500; line-height: 1.45; color: #222; }
.s2-cart-drawer .s2-cart-line__name:hover { color: #830e02; }
.s2-cart-drawer .s2-cart-line__meta { margin-top: 5px; font-size: 13px; line-height: 1.5; }
.s2-drawer-line-controls { grid-column: 2; display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.s2-cart-drawer .s2-cart-line__quantity { display: flex; align-items: end; gap: 0; }
.s2-cart-drawer .s2-cart-line__quantity label { margin: 0; font-size: 11px; color: #777; font-weight: 400; line-height: 1.5; }
.s2-cart-drawer .s2-cart-line__quantity input {
  display: block; width: 64px; height: 36px; padding: 4px; border: 1px solid #ddd;
  border-radius: 0; background: #fff; font-family: inherit; font-size: 14px; text-align: center;
  appearance: textfield; -moz-appearance: textfield;
}
.s2-cart-drawer input::-webkit-inner-spin-button, .s2-cart-drawer input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.s2-quantity-step {
  width: 34px; height: 36px; padding: 0; border: 1px solid #ddd;
  background: #fff; color: #830e02; font-family: inherit; font-size: 19px; cursor: pointer;
}
.s2-quantity-step:first-child { border-right: 0; border-radius: 3px 0 0 3px; }
.s2-quantity-step:last-child { border-left: 0; border-radius: 0 3px 3px 0; }
.s2-quantity-step:disabled { color: #aaa; background: #fafafa; cursor: default; }
.s2-cart-drawer .s2-cart-remove { grid-column: auto; padding: 7px 0; font-family: inherit; font-size: 13px; }
.s2-drawer-footer { flex: none; padding: 20px 22px calc(20px + env(safe-area-inset-bottom)); border-top: 1px solid #dedede; background: #faf9f8; }
.s2-drawer-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; }
.s2-drawer-summary strong { font-weight: 600; }
.s2-cart-drawer .s2-drawer-note { margin: 8px 0 16px; color: #666; font-size: 13px; line-height: 1.5; }
.s2-drawer-footer .s2-button { width: 100%; }
.s2-drawer-empty { padding: 44px 0; text-align: center; }
.s2-cart-drawer .s2-drawer-empty h3 { margin: 0 0 12px; font-size: 20px; font-weight: 600; }
.s2-cart-drawer .s2-drawer-empty p { margin: 0 0 24px; color: #666; font-size: 15px; line-height: 1.6; }
.s2-drawer-services { display: block; margin-top: 18px; color: #830e02; font-size: 14px; }
@media (max-width: 600px) {
  .s2-cart-toggle { top: auto; bottom: calc(88px + env(safe-area-inset-bottom)); right: 12px; width: 54px; height: 54px; transform: none; }
  .s2-cart-drawer { width: 100%; }
  .s2-drawer-head { padding: 14px 16px; }
  .s2-drawer-scroll { padding: 0 16px; }
  .s2-drawer-footer { padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
  .s2-cart-drawer .s2-drawer-title { font-size: 20px; }
  .s2-cart-drawer .s2-cart-line--drawer { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .s2-cart-drawer, .s2-cart-drawer .s2-cart-line--drawer { transition: none; }
}

/* Confirmation stays visible while the cart list scrolls. */
.s2-cart-drawer > .s2-drawer-feedback:not(:empty) { flex: none; margin: 14px 22px 0; }
/* Service cart controls sit below their page card. */
:is(#content, .e1-overview-renderer) .e1-project-grid > li:has(> .s2-buy) { flex-direction: column; }
:is(#content, .e1-overview-renderer) .e1-project-grid > li > .s2-buy {
  margin: 0; border: 1px solid #dedede; border-top: 0; border-radius: 0 0 4px 4px;
}
@media (max-width: 600px) {
  .s2-cart-drawer > .s2-drawer-feedback:not(:empty) { margin: 12px 16px 0; }
}

:is(#content, .e1-overview-renderer) .e1-project-grid > li:has(> .s2-buy) > .e1-project-card { flex: 1; }
