/* =========================================================
   Pawsome — slide-out cart drawer
   ========================================================= */
.pw-cd { position: fixed; inset: 0; z-index: 110; visibility: hidden; transition: visibility 0s .5s; }
.pw-cd.is-open { visibility: visible; transition: none; }
.pw-cd__overlay { position: absolute; inset: 0; background: rgba(20, 29, 45, .45); backdrop-filter: blur(2px); opacity: 0; transition: opacity .4s; }
.pw-cd.is-open .pw-cd__overlay { opacity: 1; }
.pw-cd__panel {
	position: absolute; top: 0; right: 0; bottom: 0; width: min(100vw, 440px);
	display: flex; flex-direction: column; background: var(--pw-page);
	box-shadow: -30px 0 60px -30px rgba(20, 29, 45, .4);
	transform: translateX(100%); transition: transform .5s var(--pw-ease);
}
@media (min-width: 601px) { .pw-cd__panel { top: 10px; right: 10px; bottom: 10px; border-radius: 22px; overflow: hidden; transform: translateX(calc(100% + 20px)); } }
.pw-cd.is-open .pw-cd__panel { transform: none; }
.pw-cd__inner { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.pw-cd__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--pw-line); }
.pw-cd__head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 22px; }
.pw-cd__count { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--pw-dark); color: #fff; font: 700 13px var(--pw-font-body); }

/* Free shipping progress */
.pw-ship { padding: 16px 20px 18px; background: color-mix(in srgb, var(--pw-accent) 9%, #fff); }
.pw-ship p { margin: 0 0 12px; font-size: 14px; text-align: center; }
.pw-ship p .amount { color: var(--pw-accent); }
.pw-ship__bar { position: relative; height: 8px; border-radius: 999px; background: rgba(20, 29, 45, .1); }
.pw-ship__bar > span {
	position: absolute; left: 0; top: 0; bottom: 0; width: var(--pct); border-radius: inherit;
	background: linear-gradient(90deg, var(--pw-accent), color-mix(in srgb, var(--pw-accent) 70%, #fff));
	background-size: 30px 100%;
	transition: width .8s var(--pw-ease);
	animation: pw-grow .9s var(--pw-ease) backwards;
}
.pw-ship__bar > span::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: repeating-linear-gradient(-45deg, transparent 0 8px, rgba(255, 255, 255, .25) 8px 16px); animation: pw-stripes 1s linear infinite; }
.pw-ship__bar .pw-ico { position: absolute; right: -14px; top: 50%; width: 28px; height: 28px; padding: 5px; margin-top: -14px; border-radius: 50%; background: #fff; color: var(--pw-accent); box-shadow: 0 4px 10px -4px rgba(20, 29, 45, .4); }
.pw-ship.is-done .pw-ico { animation: pw-drive-loop 1.6s ease-in-out infinite; }
@keyframes pw-grow { from { width: 0; } }
@keyframes pw-stripes { to { background-position: 22px 0; } }
@keyframes pw-drive-loop { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-4px) rotate(-4deg); } }

/* Items */
.pw-cd__items { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 6px 20px; overscroll-behavior: contain; }
.pw-cd__item { position: relative; display: grid; grid-template-columns: 84px 1fr; gap: 14px; padding: 16px 30px 16px 0; border-bottom: 1px solid var(--pw-line); animation: pw-item-in .5s var(--pw-ease) backwards; }
.pw-cd.is-open .pw-cd__item:nth-child(1) { animation-delay: .12s; } .pw-cd.is-open .pw-cd__item:nth-child(2) { animation-delay: .18s; }
.pw-cd.is-open .pw-cd__item:nth-child(3) { animation-delay: .24s; } .pw-cd.is-open .pw-cd__item:nth-child(4) { animation-delay: .3s; }
@keyframes pw-item-in { from { opacity: 0; transform: translateX(24px); } }
.pw-cd__item.is-removing { animation: pw-item-out .35s var(--pw-ease) forwards; }
@keyframes pw-item-out { to { opacity: 0; transform: translateX(40px); } }
.pw-cd__thumb { display: block; border-radius: 12px; overflow: hidden; background: #f4f1ea; aspect-ratio: 1; }
.pw-cd__thumb img { width: 100%; height: 100%; object-fit: cover; }
.pw-cd__info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pw-cd__name { font-weight: 700; text-decoration: none; color: var(--pw-dark); line-height: 1.35; }
.pw-cd__name:hover { color: var(--pw-accent); }
.pw-cd__meta { font-size: 13px; color: var(--pw-muted); }
.pw-cd__meta dl { margin: 0; display: flex; flex-wrap: wrap; gap: 0 6px; }
.pw-cd__meta dt, .pw-cd__meta dd { margin: 0; }
.pw-cd__meta dd p { margin: 0; }
.pw-cd__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 6px; }
.pw-cd__price { font-weight: 700; }
.pw-cd__remove { position: absolute; top: 14px; right: 0; display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: var(--pw-muted); transition: background .2s, color .2s, transform .3s var(--pw-spring); }
.pw-cd__remove:hover { background: #fde8e4; color: #c92c42; transform: rotate(90deg); }
.pw-cd__remove .pw-ico { width: 16px; height: 16px; }

.pw-qty { display: inline-flex; align-items: center; height: 36px; border: 1.5px solid var(--pw-line); border-radius: 999px; background: #fff; }
.pw-qty button { width: 34px; height: 100%; border: 0; background: none; font-size: 18px; line-height: 1; color: var(--pw-dark); border-radius: 999px; transition: background .2s; }
.pw-qty button:hover { background: var(--pw-cream); }
.pw-qty input { width: 34px; border: 0; background: none; text-align: center; font: 600 15px var(--pw-font-body); -moz-appearance: textfield; }
.pw-qty input::-webkit-outer-spin-button, .pw-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pw-qty input:focus { outline: none; }

/* Footer */
.pw-cd__foot { padding: 18px 20px 20px; border-top: 1px solid var(--pw-line); background: #fff; }
.pw-cd__subtotal { display: flex; align-items: center; justify-content: space-between; font-size: 17px; }
.pw-cd__subtotal strong { font: 800 22px var(--pw-font-display); color: var(--pw-dark); }
.pw-cd__note { margin: 4px 0 16px; font-size: 13px; color: var(--pw-muted); }
.pw-cd__actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.pw-cd__actions .pw-btn { justify-content: center; padding: 14px 18px; }
.pw-btn--ghost { background: transparent; color: var(--pw-dark); box-shadow: inset 0 0 0 1.5px var(--pw-dark); }
.pw-btn--ghost::before { background: var(--pw-dark); }
.pw-btn--ghost:hover { color: #fff; }

/* Empty state */
.pw-cd__empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 32px 28px; text-align: center; }
.pw-cd__empty h3 { margin: 10px 0 0; font-size: 24px; }
.pw-cd__empty p { margin: 0 0 14px; color: var(--pw-muted); }
.pw-cd__empty-icon { display: grid; place-items: center; width: 88px; height: 88px; border-radius: 50%; background: var(--pw-cream); color: var(--pw-accent); animation: pw-bob 3s ease-in-out infinite; }
.pw-cd__empty-icon .pw-ico { width: 40px; height: 40px; }
.pw-cd__chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 22px; }
.pw-cd__chips a { padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--pw-line); text-decoration: none; font-weight: 600; font-size: 14px; transition: all .3s var(--pw-spring); }
.pw-cd__chips a:hover { background: var(--pw-accent); border-color: var(--pw-accent); color: #fff; transform: translateY(-2px); }

/* Loading veil */
.pw-cd__loading { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 252, 247, .6); opacity: 0; pointer-events: none; transition: opacity .25s; }
.pw-cd.is-loading .pw-cd__loading { opacity: 1; pointer-events: auto; }
.pw-cd__loading span { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--pw-line); border-top-color: var(--pw-accent); animation: pw-spin .7s linear infinite; }

/* Toast for errors */
.pw-toast { position: fixed; left: 50%; bottom: 24px; z-index: 200; max-width: min(92vw, 420px); padding: 14px 20px; border-radius: 14px; background: var(--pw-dark); color: #fff; font-weight: 600; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .6); transform: translate(-50%, 140%); transition: transform .45s var(--pw-spring); }
.pw-toast.is-show { transform: translate(-50%, 0); }
