/* Cart Drawer — scoped .tc-cart-drawer */

.tc-cart-drawer[hidden] {
  display: none !important;
}

.tc-cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 10060;
}

.tc-cart-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.42);
}

.tc-cart-drawer__shell {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(460px, 100%);
  height: 100%;
  background: #fff;
  color: var(--ink, #111);
  box-shadow: -8px 0 28px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.22s ease;
}

.tc-cart-drawer.is-open .tc-cart-drawer__shell {
  transform: translateX(0);
}

.tc-cart-drawer__panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.tc-cart-drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line, #e8e8e8);
}

.tc-cart-drawer__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.2;
}

.tc-cart-drawer__count {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted, #666);
}

.tc-cart-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line, #e8e8e8);
  border-radius: 999px;
  background: #fff;
  color: var(--ink, #111);
  cursor: pointer;
  flex: 0 0 auto;
}

.tc-cart-drawer__close:hover {
  border-color: var(--red, #0b8796);
  color: var(--red, #0b8796);
}

.tc-cart-drawer__body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 12px 16px 20px;
  -webkit-overflow-scrolling: touch;
}

.tc-cart-drawer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tc-cart-drawer__item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line, #e8e8e8);
}

.tc-cart-drawer__item.is-busy {
  opacity: 0.55;
  pointer-events: none;
}

.tc-cart-drawer__thumb {
  width: 72px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--soft, #f8f7f5);
}

.tc-cart-drawer__thumb a,
.tc-cart-drawer__thumb img,
.tc-cart-drawer__thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tc-cart-drawer__item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.tc-cart-drawer__name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink, #111);
  text-decoration: none;
}

.tc-cart-drawer__name:hover {
  color: var(--red, #0b8796);
}

.tc-cart-drawer__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted, #666);
  cursor: pointer;
  flex: 0 0 auto;
}

.tc-cart-drawer__remove:hover {
  color: var(--red, #0b8796);
  background: rgba(11, 135, 150, 0.06);
}

.tc-cart-drawer__attrs {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted, #666);
}

.tc-cart-drawer__attrs span {
  font-weight: 700;
  color: var(--ink, #111);
}

.tc-cart-drawer__item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.tc-cart-drawer__price {
  font-size: 14px;
  font-weight: 800;
  color: var(--red, #0b8796);
}

.tc-cart-drawer__qty {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--line, #e8e8e8);
  border-radius: 999px;
  overflow: hidden;
}

.tc-cart-drawer__qty-btn {
  width: 34px;
  height: 34px;
  border: 0;
  background: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.tc-cart-drawer__qty-val,
.tc-cart-drawer__qty-static {
  min-width: 28px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.tc-cart-drawer__empty {
  padding: 48px 12px;
  text-align: center;
}

.tc-cart-drawer__empty-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 800;
}

.tc-cart-drawer__empty-text {
  margin: 0 0 20px;
  color: var(--muted, #666);
  font-size: 14px;
}

.tc-cart-drawer__footer {
  flex: 0 0 auto;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line, #e8e8e8);
  background: #fff;
}

.tc-cart-drawer__subtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 700;
}

.tc-cart-drawer__subtotal strong {
  font-size: 1.15rem;
  color: var(--red, #0b8796);
}

.tc-cart-drawer__note {
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted, #666);
}

.tc-cart-drawer__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  margin-bottom: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  box-sizing: border-box;
}

.tc-cart-drawer__btn--primary {
  border: 0;
  background: var(--red, #0b8796);
  color: #fff;
  cursor: pointer;
}

.tc-cart-drawer__btn--primary:hover {
  background: var(--red-dk, #075b66);
  color: #fff;
}

.tc-cart-drawer__btn--ghost {
  border: 1.5px solid var(--line, #e8e8e8);
  background: #fff;
  color: var(--ink, #111);
}

.tc-cart-drawer__btn--ghost:hover {
  border-color: var(--red, #0b8796);
  color: var(--red, #0b8796);
}

.tc-cart-drawer__continue {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px;
  border: 0;
  background: none;
  color: var(--muted, #666);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.tc-cart-drawer__continue:hover {
  color: var(--red, #0b8796);
}

body.tc-cart-drawer-lock {
  overflow: hidden;
}

/* Hide legacy dropdown panel (header toggle opens drawer). */
.tc-header-cart .tc-mini-cart-dropdown {
  display: none !important;
}

@media (max-width: 768px) {
  .tc-cart-drawer__shell {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(94vh, 100%);
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }

  .tc-cart-drawer.is-open .tc-cart-drawer__shell {
    transform: translateY(0);
  }
}
