/* ================================================================
   AWUSYS — Digital Product Shopping Cart & Drawer Stylesheet
   ================================================================ */

/* ---- HEADER CART BUTTON ---- */
.nav-cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid rgba(108, 36, 240, .2);
  color: var(--text);
  cursor: pointer;
  transition: all .24s ease;
  margin-left: .25rem;
  padding: 0;
  text-decoration: none;
}
.nav-cart-btn:hover {
  background: var(--surface-hi);
  border-color: var(--violet);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(108, 36, 240, .2);
  color: var(--violet);
}
.nav-cart-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  stroke: currentColor;
}
.nav-cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(255, 122, 24, .45);
  transition: transform .25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-cart-badge.bump {
  transform: scale(1.35);
}
.nav-cart-badge.hidden {
  display: none;
}

/* ---- CART DRAWER OVERLAY ---- */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 20, .6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.cart-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ---- CART DRAWER PANEL ---- */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-left: 1px solid rgba(108, 36, 240, .2);
  box-shadow: -10px 0 35px rgba(0, 0, 0, .25);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(0.16, 1, 0.3, 1);
}
.cart-drawer.active {
  transform: translateX(0);
}

/* Drawer Header */
.cart-drawer-header {
  padding: 1.4rem 1.6rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-hi);
}
.cart-drawer-title-row {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.cart-drawer-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}
.cart-drawer-count {
  font-family: var(--font-mono);
  font-size: .75rem;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: rgba(108, 36, 240, .12);
  color: var(--violet);
  font-weight: 600;
}
.cart-drawer-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s ease;
  padding: 0;
}
.cart-drawer-close:hover {
  background: rgba(255, 255, 255, .1);
  color: var(--text);
  transform: rotate(90deg);
}
.cart-drawer-close svg {
  width: 20px;
  height: 20px;
}

/* Drawer Body */
.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.4rem 1.6rem;
}
.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.cart-item-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  transition: border-color .2s ease, background .2s ease;
}
.cart-item-row:hover {
  border-color: rgba(108, 36, 240, .3);
  background: rgba(108, 36, 240, .03);
}
.cart-item-thumb {
  width: 52px;
  height: 68px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(108, 36, 240, .1);
}
.cart-item-thumb-placeholder {
  width: 52px;
  height: 68px;
  border-radius: 6px;
  background: var(--grad);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.cart-item-thumb-placeholder svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
}
.cart-item-info {
  flex: 1;
  min-width: 0;
}
.cart-item-title {
  font-weight: 600;
  font-size: .95rem;
  color: var(--text);
  margin: 0 0 .2rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cart-item-title a {
  color: inherit;
  text-decoration: none;
}
.cart-item-title a:hover {
  color: var(--violet);
}
.cart-item-author {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--muted);
  margin: 0 0 .35rem;
}
.cart-item-price {
  font-family: var(--font-display);
  font-weight: 700;
  color: #dc2626 !important;
  font-size: .95rem;
}
.cart-item-remove {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: .4rem;
  border-radius: 6px;
  transition: all .2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-item-remove:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, .1);
}
.cart-item-remove svg {
  width: 16px;
  height: 16px;
}

/* Empty Cart State */
.cart-empty-state {
  text-align: center;
  padding: 3rem 1rem;
}
.cart-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(108, 36, 240, .08);
  border: 1px solid rgba(108, 36, 240, .2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
  color: var(--violet);
}
.cart-empty-icon svg {
  width: 32px;
  height: 32px;
}
.cart-empty-state h3 {
  font-size: 1.15rem;
  margin-bottom: .4rem;
  color: var(--text);
}
.cart-empty-state p {
  color: var(--muted);
  font-size: .9rem;
  max-width: 260px;
  margin: 0 auto 1.4rem;
}

/* Drawer Footer */
.cart-drawer-footer {
  padding: 1.4rem 1.6rem;
  border-top: 1px solid var(--line);
  background: var(--surface-hi);
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: .92rem;
  color: var(--muted);
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  padding-top: .4rem;
  border-top: 1px dashed var(--line);
}
.cart-total-val {
  font-family: var(--font-display);
  color: #dc2626 !important;
}
.cart-checkout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .85rem 1.2rem;
  font-weight: 700;
  background: #F09F2D !important;
  color: #000000 !important;
  border-radius: 10px;
  box-shadow: 0 4px 18px -4px rgba(240, 159, 45, .55);
  border: none;
  animation: pulse-amber 2.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  transition: all .25s ease;
}
.cart-checkout-btn:hover {
  background: #ffab38 !important;
  color: #000000 !important;
  box-shadow: 0 8px 28px -6px rgba(240, 159, 45, .75);
  transform: translateY(-1px);
  animation-play-state: paused;
}

@keyframes pulse-amber {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 18px -4px rgba(240, 159, 45, 0.55), 0 0 0 0 rgba(240, 159, 45, 0.6);
  }
  50% {
    transform: scale(1.025);
    box-shadow: 0 12px 36px -4px rgba(240, 159, 45, 0.8), 0 0 0 12px rgba(240, 159, 45, 0);
  }
}
.cart-clear-link {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: .8rem;
  cursor: pointer;
  text-align: center;
  transition: color .2s ease;
  padding: .2rem;
}
.cart-clear-link:hover {
  color: #ef4444;
  text-decoration: underline;
}

/* ---- TOAST NOTIFICATION ---- */
.cart-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--surface);
  border: 1px solid rgba(108, 36, 240, .35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  border-radius: 12px;
  padding: .85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  z-index: 10000;
  transform: translateY(120%);
  opacity: 0;
  transition: transform .3s cubic-bezier(0.16, 1, 0.3, 1), opacity .3s ease;
  pointer-events: none;
  font-size: .9rem;
  color: var(--text);
}
.cart-toast.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.cart-toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(16, 185, 129, .15);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cart-toast-icon svg {
  width: 16px;
  height: 16px;
}
.cart-toast-msg {
  font-weight: 500;
}

/* ---- BUTTON ADD TO CART STYLING ---- */
.btn-add-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .65rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  background: rgba(108, 36, 240, .1);
  color: var(--violet);
  border: 1px solid rgba(108, 36, 240, .25);
  cursor: pointer;
  transition: all .2s ease;
  text-decoration: none;
}
.btn-add-cart:hover {
  background: rgba(108, 36, 240, .18);
  border-color: rgba(108, 36, 240, .5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(108, 36, 240, .15);
  color: var(--violet);
}
.btn-add-cart svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}
.btn-add-cart.in-cart {
  background: rgba(16, 185, 129, .12);
  color: #10b981;
  border-color: rgba(16, 185, 129, .3);
}

/* Responsive */
@media (max-width: 480px) {
  .cart-drawer {
    max-width: 100%;
  }
  .cart-toast {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
}
