@import url('./global.css');

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 1500;
}

.overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(430px, 94vw);
  background: #0f0f0f;
  border-left: 1px solid var(--color-line);
  box-shadow: -22px 0 48px rgba(0, 0, 0, 0.4);
  z-index: 1600;
  transform: translateX(105%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.cart-sidebar.open {
  transform: translateX(0);
}

.cart-head,
.cart-foot {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-body {
  flex: 1;
  overflow: auto;
  padding: 1rem 1.1rem;
}

.line-item {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 0.7rem;
  align-items: start;
  padding: 0.6rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
}

.line-item img {
  width: 70px;
  height: 94px;
  object-fit: cover;
  border-radius: 10px;
}

.qty-wrap {
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.qty-val {
  min-width: 24px;
  text-align: center;
  font-size: 0.82rem;
  align-self: center;
}

.remove-btn,
.close-btn {
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 1.1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.92rem;
  margin-top: 0.5rem;
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(120deg, #a3842f, #e6cd88);
  transition: width 0.25s ease;
}

.cart-page {
  padding: 3rem 0 4rem;
}

.cart-page-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.2rem;
}

.cart-list,
.cart-summary {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: linear-gradient(160deg, #111111, #151515);
  padding: 1rem;
}

.empty-state {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  color: #d7d7d7;
}

@media (max-width: 1024px) {
  .cart-page-grid {
    grid-template-columns: 1fr;
  }
}

:root[data-theme='light'] .cart-sidebar,
:root[data-theme='light'] .cart-list,
:root[data-theme='light'] .cart-summary,
:root[data-theme='light'] .line-item {
  background: #fff;
  color: #111;
}

:root[data-theme='light'] .qty-btn,
:root[data-theme='light'] .remove-btn,
:root[data-theme='light'] .close-btn {
  color: #111;
}
