/* The mini basket drawer (a <dialog> sliding in from the right), its lines, and the quantity stepper
   shared with the product page. */

@layer components {
  .utility__badge--basket { background: var(--bp-marigold-400); color: var(--bp-on-accent); }

  .drawer {
    margin: 0 0 0 auto;
    width: min(100%, 420px);
    max-width: none;
    height: 100dvh;
    max-height: none;
    padding: 0;
    border: 0;
    background: var(--bp-paper);
    color: var(--bp-ink);
    box-shadow: var(--shadow-lg);
  }

  .drawer::backdrop { background: var(--bp-scrim); }
  .drawer[open] { animation: drawer-in 220ms var(--ease); }

  @keyframes drawer-in {
    from { transform: translateX(100%); }
    to { transform: none; }
  }

  .drawer__panel { display: flex; flex-direction: column; height: 100%; }

  .drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 18px 20px;
    border-bottom: 1px solid var(--bp-line);
    background: var(--bp-surface);
  }

  .drawer__title { font-size: var(--fs-xl); }
  .drawer__count { font-family: var(--font-body); font-size: 15px; color: var(--bp-ink-2); }

  .drawer__added {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--bp-leaf-50);
    color: var(--bp-leaf-700);
    font-size: var(--fs-sm);
    font-weight: 600;
  }

  .drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: var(--space-2) 20px; }

  .drawer__foot {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--bp-line);
    background: var(--bp-surface);
  }

  .drawer__subtotal { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
  .drawer__subtotal-amount { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 400; color: var(--bp-brand-800); }
  .drawer__note { font-size: 13px; color: var(--bp-ink-2); }

  .basket-lines { list-style: none; margin: 0; padding: 0; }

  .basket-line { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--bp-line); }

  .basket-line__media {
    display: grid;
    place-items: center;
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    overflow: hidden;
    border-radius: var(--radius-md);
  }

  .basket-line__media img { width: 100%; height: 100%; object-fit: cover; }
  .basket-line__monogram { font-family: var(--font-display); font-size: 28px; color: var(--bp-brand-800); opacity: .35; }

  .basket-line__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
  .basket-line__top { display: flex; justify-content: space-between; gap: 10px; }
  .basket-line__title { font-weight: 600; font-size: var(--fs-sm); line-height: 1.35; color: var(--bp-ink); text-decoration: none; }
  .basket-line__title:hover { color: var(--bp-brand-600); text-decoration: underline; }

  .basket-line__remove {
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--bp-ink-2);
    cursor: pointer;
  }

  .basket-line__remove:hover { background: var(--bp-danger-50); color: var(--bp-danger); }
  .basket-line__remove .icon { font-size: 20px; }

  .basket-line__bottom { display: flex; justify-content: space-between; align-items: center; }
  .basket-line__total { font-weight: 700; color: var(--bp-brand-800); }
  .basket-line__capped { font-size: 12px; color: var(--bp-marigold-800); }

  .basket-empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); padding: var(--space-12) 0; text-align: center; color: var(--bp-ink-2); }

  .basket-empty__icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 46% 54% 50% 50% / 55% 45% 55% 45%;
    background: var(--bp-brand-50);
    color: var(--bp-brand-600);
  }

  .basket-empty__icon .icon { font-size: 32px; }

  /* Quantity stepper: − [n] + */
  .qty-stepper {
    display: inline-flex;
    align-items: center;
    height: 48px;
    border: 1px solid var(--bp-line-strong);
    border-radius: var(--radius-pill);
    background: var(--bp-surface);
  }

  .qty-stepper__button {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--bp-ink);
    cursor: pointer;
  }

  .qty-stepper__button:hover:not(:disabled) { background: var(--bp-brand-50); color: var(--bp-brand-600); }
  .qty-stepper__button:disabled { opacity: .4; cursor: not-allowed; }
  .qty-stepper__button .icon { font-size: 20px; }

  .qty-stepper__value,
  .qty-stepper__input {
    min-width: 32px;
    width: 3ch;
    border: 0;
    background: transparent;
    font-weight: 600;
    text-align: center;
    appearance: textfield;
  }

  .qty-stepper__input::-webkit-inner-spin-button,
  .qty-stepper__input::-webkit-outer-spin-button { appearance: none; margin: 0; }

  .qty-stepper--sm { height: 36px; }
  .qty-stepper--sm .qty-stepper__button { width: 34px; height: 34px; }
  .qty-stepper--sm .qty-stepper__button .icon { font-size: 18px; }
}
