/* ─── Variables ─────────────────────────────────────────────────────── */
:root {
  --asc-green:      #7fa15a;
  --asc-green-dark: #729151;
  --asc-black:      #282727;
  --asc-text:       #555;
  --asc-muted:      #999;
  --asc-border:     #f0f0f0;
  --asc-white:      #ffffff;
  --asc-width:      420px;
  --asc-radius:     4px;
  --asc-speed:      0.35s;
  --asc-ease:       cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Overlay ───────────────────────────────────────────────────────── */
.asc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 28, 28, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--asc-speed) var(--asc-ease),
              visibility var(--asc-speed) var(--asc-ease);
}
.asc-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* ─── Drawer ────────────────────────────────────────────────────────── */
.asc-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--asc-width);
  max-width: 100vw;
  height: 100%;
  background: var(--asc-white);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--asc-speed) var(--asc-ease);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
  font-family: "edmondsans", sans-serif;
}
.asc-drawer.is-open {
  transform: translateX(0);
}

/* ─── Header ────────────────────────────────────────────────────────── */
.asc-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid var(--asc-border);
  flex-shrink: 0;
}
.asc-drawer__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--asc-black);
}
.asc-drawer__title-icon {
  color: var(--asc-green);
  font-size: 18px;
}
.asc-drawer__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--asc-green);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  line-height: 1;
}
.asc-close {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--asc-text);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  transition: background 0.2s, color 0.2s;
}
.asc-close:hover {
  background: var(--asc-border);
  color: var(--asc-black);
}

/* ─── Body (scrollable) ─────────────────────────────────────────────── */
.asc-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--asc-border) transparent;
}
.asc-drawer__body::-webkit-scrollbar { width: 4px; }
.asc-drawer__body::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

/* ─── Item ──────────────────────────────────────────────────────────── */
.asc-item {
  display: flex;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--asc-border);
  transition: background 0.15s;
  animation: asc-fade-in 0.25s ease;
}
.asc-item:last-child { border-bottom: none; }
.asc-item:hover { background: #fafafa; }

@keyframes asc-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.asc-item__image {
  flex-shrink: 0;
  width: 80px;
  height: 90px;
  border-radius: var(--asc-radius);
  overflow: hidden;
  background: #f7f7f7;
}
.asc-item__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.asc-item__image:hover img { transform: scale(1.04); }

.asc-item__details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}
.asc-item__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.asc-item__name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--asc-black);
  text-decoration: none;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}
.asc-item__name:hover { color: var(--asc-green); }

.asc-item__remove {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--asc-muted);
  font-size: 14px;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
  transition: color 0.2s;
}
.asc-item__remove:hover { color: #e55; }

.asc-item__meta {
  font-size: 11.5px;
  color: var(--asc-muted);
  margin-top: 3px;
}
.asc-item__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

/* ─── Qty stepper ───────────────────────────────────────────────────── */
.asc-qty {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--asc-border);
  border-radius: 20px;
  overflow: hidden;
}
.asc-qty__btn {
  background: none;
  border: none;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 16px;
  color: var(--asc-text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
  line-height: 1;
}
.asc-qty__btn:hover { background: var(--asc-green); color: #fff; }
.asc-qty__num {
  min-width: 28px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--asc-black);
}

/* ─── Price ─────────────────────────────────────────────────────────── */
.asc-item__price {
  font-size: 14px;
  font-weight: 700;
  color: var(--asc-black);
}
.asc-item__price ins { text-decoration: none; }
.asc-item__price del { color: var(--asc-muted); font-size: 12px; font-weight: 400; margin-right: 4px; }

/* ─── Footer ────────────────────────────────────────────────────────── */
.asc-drawer__footer {
  padding: 24px 28px 32px;
  border-top: 1px solid var(--asc-border);
  flex-shrink: 0;
  background: var(--asc-white);
}
.asc-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.asc-subtotal__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--asc-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.asc-subtotal__price {
  font-size: 20px;
  font-weight: 700;
  color: var(--asc-black);
}
.asc-footer-note {
  font-size: 11.5px;
  color: var(--asc-muted);
  text-align: center;
  margin-bottom: 18px;
}

/* ─── Buttons ───────────────────────────────────────────────────────── */
.asc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 20px;
  border-radius: var(--asc-radius);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.22s, color 0.22s, border-color 0.22s, transform 0.15s;
  font-family: "edmondsans", sans-serif;
  margin-bottom: 10px;
}
.asc-btn:last-child { margin-bottom: 0; }
.asc-btn:active { transform: scale(0.98); }

.asc-btn--primary {
  background: var(--asc-green);
  color: #fff;
  border: 2px solid var(--asc-green);
}
.asc-btn--primary:hover {
  background: var(--asc-green-dark);
  border-color: var(--asc-green-dark);
  color: #fff;
}
.asc-btn--outline {
  background: transparent;
  color: var(--asc-black);
  border: 2px solid var(--asc-border);
}
.asc-btn--outline:hover {
  border-color: var(--asc-black);
  color: var(--asc-black);
}

/* ─── Empty state ───────────────────────────────────────────────────── */
.asc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 10px 0 4px;
}
.asc-empty__icon {
  font-size: 48px;
  color: var(--asc-border);
  line-height: 1;
}
.asc-empty__text {
  font-size: 14px;
  color: var(--asc-muted);
  margin: 0;
}

/* ─── Loading spinner ───────────────────────────────────────────────── */
.asc-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.asc-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--asc-border);
  border-top-color: var(--asc-green);
  border-radius: 50%;
  animation: asc-spin 0.7s linear infinite;
}
@keyframes asc-spin { to { transform: rotate(360deg); } }

/* ─── Badge on cart icon ────────────────────────────────────────────── */
.shopping-cart-icon .icon a span {
  transition: transform 0.2s, background 0.2s;
}
.asc-cart-bump .shopping-cart-icon .icon a span {
  animation: asc-bump 0.35s ease;
}
@keyframes asc-bump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.5); }
  100% { transform: scale(1); }
}

/* ─── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .asc-drawer {
    width: 100vw;
  }
  .asc-item { padding: 16px 20px; }
  .asc-drawer__header { padding: 18px 20px; }
  .asc-drawer__footer { padding: 20px 20px 28px; }
}
