/* ==========================================================================
   HarNavCrafts — Cart Drawer
   Uses the same design tokens as style.css (Fraunces / Outfit, rose palette)
   ========================================================================== */

.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 20, 16, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility 0s linear .35s;
  z-index: 10000;
}

.cart-drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity .35s ease, visibility 0s linear 0s;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 100vw);
  background: var(--cream, #fbf7f2);
  box-shadow: -20px 0 60px rgba(28, 20, 16, 0.18);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .4s cubic-bezier(.22, .8, .3, 1);
}

.cart-drawer.is-open {
  transform: translateX(0);
}

/* ================= HEADER ================= */

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 24px 4px;
  flex-shrink: 0;
}

.cart-drawer-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--color-ink, #2c2420);
  margin: 0;
}

.cart-drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-ink, #2c2420);
  background: transparent;
  transition: background .2s ease, transform .2s ease;
  flex-shrink: 0;
}

.cart-drawer-close:hover {
  background: var(--color-rose-soft, #ffe3ea);
  transform: rotate(90deg);
}

.cart-drawer-close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ================= FREE SHIPPING BAR ================= */

.cart-drawer-shipping {
  padding: 0 24px 20px;
  flex-shrink: 0;
}

.cart-shipping-msg {
  font-size: 0.85rem;
  color: var(--color-ink, #2c2420);
  margin: 0 0 10px;
  line-height: 1.4;
}

.cart-shipping-msg strong {
  color: var(--color-rose-dark, #e05580);
  font-weight: 600;
}

.cart-shipping-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  /* background: var(--color-rose-soft, #ffe3ea); */
  background: #00800042;
  overflow: visible;
}

.cart-shipping-fill {
  height: 100%;
  border-radius: 999px;
  /* background: linear-gradient(90deg, var(--color-rose, #ee6f8f), var(--color-rose-dark, #e05580)); */
  background: green;
  transition: width .4s ease;
  width: 0%;
}

.cart-shipping-icon {
  position: absolute;
  top: 50%;
  transform: translate(-40%, -50%);
  left: 0%;
  width: 22px;
  height: 22px;
  color: var(--color-rose-dark, #e05580);
  transition: left .4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-shipping-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* ================= ITEMS LIST ================= */

.cart-drawer-items {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 4px 24px;
  display: flex;
  flex-direction: column;
}

.cart-drawer-items::-webkit-scrollbar {
  width: 6px;
}

.cart-drawer-items::-webkit-scrollbar-thumb {
  background: var(--color-rose-soft, #ffe3ea);
  border-radius: 999px;
}

.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border, #f6d9e1);
  align-items: flex-start;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-media {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--color-rose-soft, #ffe3ea);
  flex-shrink: 0;
}

.cart-item-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cart-item-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cart-item-name {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--color-ink, #2c2420);
  margin: 0;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cart-item-price {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--color-rose-dark, #e05580);
}

.cart-item-qty {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--color-border, #f6d9e1);
  border-radius: 999px;
  width: fit-content;
  overflow: hidden;
}

.cart-item-qty button {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--color-ink, #2c2420);
  background: transparent;
  line-height: 1;
  transition: background .2s ease;
}

.cart-item-qty button:hover:not(:disabled) {
  background: var(--color-rose-soft, #ffe3ea);
}

.cart-item-qty button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.cart-item-qty-value {
  width: 28px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-ink, #2c2420);
}

.cart-item-remove {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted, #2b2b2b);
  opacity: 0.55;
  flex-shrink: 0;
  transition: opacity .2s ease, color .2s ease, transform .2s ease;
}

.cart-item-remove:hover {
  opacity: 1;
  color: var(--color-rose-dark, #e05580);
  transform: scale(1.08);
}

.cart-item-remove svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cart-item.is-removing {
  animation: cart-item-remove .3s ease forwards;
}

@keyframes cart-item-remove {
  to {
    opacity: 0;
    transform: translateX(16px);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
  }
}

/* ================= EMPTY STATE ================= */

.cart-drawer-empty {
  flex: 1 1 auto;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  gap: 14px;
}

.cart-drawer.is-empty .cart-drawer-empty {
  display: flex;
}

.cart-drawer.is-empty .cart-drawer-items,
.cart-drawer.is-empty .cart-drawer-shipping,
.cart-drawer.is-empty .cart-drawer-summary {
  display: none;
}

.cart-drawer-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-rose-soft, #ffe3ea);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-rose-dark, #e05580);
}

.cart-drawer-empty-icon svg {
  width: 30px;
  height: 30px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

.cart-drawer-empty h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--color-ink, #2c2420);
  margin: 0;
}

.cart-drawer-empty p {
  font-size: 0.88rem;
  color: var(--ink-soft, #4a4038);
  margin: 0;
  max-width: 240px;
}

.cart-drawer-empty-btn {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  background: var(--color-rose, #ee6f8f);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  transition: background .2s ease, transform .2s ease;
}

.cart-drawer-empty-btn:hover {
  background: var(--color-rose-dark, #e05580);
  transform: translateY(-1px);
}

/* ================= SUMMARY / FOOTER ================= */

.cart-drawer-summary {
  flex-shrink: 0;
  padding: 18px 24px 18px;
  border-top: 1px solid var(--color-border, #f6d9e1);
}

.cart-drawer-subtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 0.95rem;
  color: var(--color-ink, #2c2420);
}

.cart-drawer-subtotal strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
}

.cart-drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-drawer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: background .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.cart-drawer-btn.view-cart {
  background: var(--color-rose, #ee6f8f);
  color: #fff;
  box-shadow: 0 8px 20px rgba(238, 111, 143, 0.28);
}

.cart-drawer-btn.view-cart:hover {
  background: var(--color-rose-dark, #e05580);
  transform: translateY(-1px);
}

.cart-drawer-btn.checkout {
  background: transparent;
  border: 1.5px solid var(--color-rose, #ee6f8f);
  color: var(--color-rose-dark, #e05580);
}

.cart-drawer-btn.checkout:hover {
  background: var(--color-rose-soft, #ffe3ea);
}

/* ================= TRUST BADGES ================= */

.cart-drawer-trust {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--color-border, #f6d9e1);
}

.cart-trust-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.cart-trust-item svg {
  width: 20px;
  height: 20px;
  stroke: var(--color-rose-dark, #e05580);
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cart-trust-item span {
  font-size: 0.68rem;
  color: var(--ink-soft, #4a4038);
  line-height: 1.25;
}

/* ================= BODY LOCK ================= */

body.cart-drawer-open {
  overflow: hidden;
}

/* ================= MOBILE RESPONSIVE ================= */

@media (max-width: 480px) {
  .cart-drawer {
    width: 86vw;
  }

  .cart-drawer-header {
    padding: 20px 18px 14px;
  }

  .cart-drawer-title {
    font-size: 1.3rem;
  }

  .cart-drawer-shipping,
  .cart-drawer-items {
    padding-left: 18px;
    padding-right: 18px;
  }

  .cart-drawer-summary {
    padding: 16px 18px 16px;
  }

  .cart-item {
    grid-template-columns: 60px 1fr auto;
    gap: 10px;
  }

  .cart-item-media {
    width: 60px;
    height: 60px;
  }

  .cart-trust-item span {
    font-size: 0.62rem;
  }
  .cart-drawer-close {
	  background: var(--color-rose-soft, #ffe3ea);
  }
}

@media (max-width: 360px) {
  .cart-drawer-trust {
    gap: 4px;
  }

  .cart-trust-item svg {
    width: 18px;
    height: 18px;
  }
}
