/* The native modal keeps focus and pointer input inside the cart. */
.cart-drawer {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  overflow: hidden;
  z-index: 150;
}
.cart-drawer[open] {
  display: flex;
  justify-content: flex-end;
}
.cart-drawer::backdrop {
  background: #10251bd1;
  animation: cart-fade 0.2s both;
}
.cart-drawer[open]:not(:modal) {
  background: #10251bd1;
}
.cart-drawer-shell {
  width: min(480px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  box-shadow: -12px 0 50px #0002;
  padding-top: env(safe-area-inset-top, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-left: env(safe-area-inset-left, 0px);
}
.cart-drawer[data-enhanced] .cart-drawer-shell {
  animation: cart-slide 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.cart-drawer.is-closing .cart-drawer-shell {
  animation: cart-slide-out 0.16s ease-in both;
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.drawer-header .eyebrow {
  font-size: 0.63rem;
  margin-bottom: 6px;
}
.drawer-header h2 {
  font:
    400 2rem Georgia,
    serif;
}
.drawer-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  flex-shrink: 0;
}
.drawer-close:hover {
  background: var(--soft);
}
.drawer-content,
.cart-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.drawer-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  padding: 0 24px 20px;
}
.drawer-intro {
  font-size: 0.8rem;
  color: var(--muted);
  padding-block: 18px 4px;
}
.drawer-line {
  display: flex;
  gap: 16px;
  padding-block: 22px;
  border-bottom: 1px solid var(--line);
}
.drawer-product-image {
  width: 72px;
  height: 84px;
  object-fit: cover;
  border-radius: 5px;
  flex-shrink: 0;
}
.drawer-image-placeholder {
  background: var(--soft);
  display: grid;
  place-items: center;
  font:
    italic 2rem Georgia,
    serif;
  color: var(--green);
}
.drawer-product {
  flex: 1;
  min-width: 0;
}
.drawer-product h3 {
  font:
    400 1.25rem Georgia,
    serif;
  overflow-wrap: anywhere;
}
.drawer-product > p {
  font-size: 0.77rem;
  color: var(--muted);
  margin-top: 5px;
}
.drawer-product .field-error {
  color: #8c2821;
}
.drawer-quantity {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.drawer-quantity input[type='number'] {
  width: 48px;
  min-height: 44px;
  padding: 7px 3px;
  text-align: center;
  background: transparent;
  border-color: var(--line);
  font-size: 0.9rem;
  -moz-appearance: textfield;
}
.drawer-quantity input::-webkit-inner-spin-button,
.drawer-quantity input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.drawer-step {
  display: none;
  min-width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  font-size: 1.15rem;
}
.cart-drawer[data-enhanced] .drawer-step {
  display: block;
}
.drawer-step:hover {
  background: var(--soft);
}
.drawer-update {
  font-size: 0.72rem;
  min-height: 44px;
  padding-inline: 5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  border: 0;
  background: transparent;
}
.drawer-line-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 3px;
}
.drawer-line-bottom strong {
  font-size: 0.96rem;
  white-space: nowrap;
}
.drawer-remove {
  font-size: 0.72rem;
  min-height: 44px;
  padding-inline: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  border: 0;
  background: transparent;
  color: var(--muted);
}
.drawer-pickup {
  padding-top: 20px;
}
.drawer-pickup .notice {
  margin-block: 0 12px;
  padding: 12px 14px;
  font-size: 0.78rem;
}
.drawer-pickup .notice ul {
  margin-top: 6px;
}
.drawer-pickup .btn {
  padding: 10px 14px;
  font-size: 0.8rem;
}
.drawer-pickup .pickup-summary {
  font-size: 0.8rem;
}
.drawer-pickup .pickup-summary h3 {
  font-size: 1.1rem;
}
.drawer-checkout {
  flex-shrink: 0;
  background: var(--white);
  border-top: 1px solid var(--line);
  padding: 14px 24px calc(12px + env(safe-area-inset-bottom, 0px));
}
.drawer-checkout .total-row {
  border: 0;
  margin: 0;
  padding: 0;
}
.drawer-checkout .total-row strong {
  font-size: 1.45rem;
}
.drawer-checkout > p {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 3px;
}
.drawer-checkout .btn {
  margin-top: 13px;
  justify-content: space-between;
}
.drawer-continue {
  display: block;
  min-height: 36px;
  text-align: center;
  padding-top: 11px;
  font-size: 0.76rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.drawer-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px 30px calc(32px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  overflow-y: auto;
}
.drawer-empty svg {
  color: #82927f;
  flex-shrink: 0;
}
.drawer-empty h3 {
  font:
    400 1.7rem Georgia,
    serif;
}
.drawer-empty p {
  max-width: 280px;
  font-size: 0.88rem;
  color: var(--muted);
}
.drawer-loading {
  padding: 36px 24px;
  color: var(--muted);
  font-size: 0.9rem;
}
.drawer-status {
  flex-shrink: 0;
  padding: 12px 24px;
  background: var(--soft);
  font-size: 0.8rem;
}
.drawer-status[data-error] {
  background: #f7eae3;
  color: #77261c;
}
.drawer-status button {
  margin-left: 8px;
  min-height: 36px;
  font-weight: 600;
  text-decoration: underline;
}
.drawer-content[aria-busy='true'] {
  opacity: 0.65;
}
.mobile-nav-link[aria-expanded='true'] {
  color: var(--green);
  background: var(--soft);
}
@keyframes cart-slide {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}
@keyframes cart-slide-out {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}
@keyframes cart-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (max-width: 350px) {
  .drawer-header {
    padding: 17px 16px;
  }
  .drawer-scroll {
    padding-inline: 16px;
  }
  .drawer-checkout {
    padding-inline: 16px;
  }
  .drawer-line {
    gap: 12px;
  }
  .drawer-product-image {
    width: 56px;
    height: 70px;
  }
  .drawer-update {
    flex-basis: 100%;
    text-align: left;
    min-height: 32px;
  }
}
@media (max-height: 540px) {
  .drawer-header {
    padding-block: 10px;
  }
  .drawer-header .eyebrow {
    display: none;
  }
  .drawer-header h2 {
    font-size: 1.5rem;
  }
  .drawer-checkout {
    padding-top: 8px;
    padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px));
  }
  .drawer-checkout > p,
  .drawer-continue {
    display: none;
  }
  .drawer-checkout .btn {
    margin-top: 6px;
    min-height: 44px;
    padding-block: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cart-drawer[data-enhanced] .cart-drawer-shell,
  .cart-drawer::backdrop,
  .cart-drawer.is-closing .cart-drawer-shell {
    animation: none;
  }
}
@media print {
  .cart-drawer {
    display: none !important;
  }
}
