/* ===== CART DRAWER ===== */

.tm-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.tm-drawer-open .tm-drawer-overlay {
  opacity: 1;
  pointer-events: auto;
}

.tm-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: var(--wp--preset--color--bg);
  z-index: 101;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

/* Header */
.tm-drawer-header {
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--wp--preset--color--border);
  flex-shrink: 0;
}

.tm-drawer-title {
  font-family: var(--wp--preset--font-family--cormorant);
  font-size: 22px;
  font-weight: 500;
  color: var(--wp--preset--color--text);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.tm-drawer-count {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 13px;
  font-weight: 400;
  color: var(--wp--preset--color--text-muted);
}

.tm-drawer-close {
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wp--preset--color--text-muted);
  transition: color 0.2s ease;
  padding: 0;
}

.tm-drawer-close:hover {
  color: var(--wp--preset--color--text);
}

/* Body */
.tm-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px;
  -webkit-overflow-scrolling: touch;
}

/* Shipping progress */
.tm-shipping-progress {
  background: var(--wp--preset--color--bg-alt);
  padding: 12px 16px;
  margin: 0 -24px 16px;
  font-size: 12px;
  font-family: var(--wp--preset--font-family--inter);
  color: var(--wp--preset--color--text-body);
}

.tm-shipping-success {
  color: var(--wp--preset--color--success);
  font-weight: 500;
}

.tm-shipping-progress-bar {
  height: 3px;
  background: var(--wp--preset--color--border);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.tm-shipping-progress-fill {
  height: 100%;
  background: var(--wp--preset--color--success);
  transition: width 0.4s ease;
  border-radius: 2px;
}

/* Cart lines */
.tm-cart-line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--wp--preset--color--border);
  align-items: start;
}

.tm-cart-line-img {
  width: 64px;
  height: 64px;
  background: var(--wp--preset--color--bg-alt);
  overflow: hidden;
  flex-shrink: 0;
}

.tm-cart-line-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tm-cart-line-info {
  min-width: 0;
}

.tm-cart-line-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  line-height: 1.3;
}

.tm-cart-line-name a {
  color: var(--wp--preset--color--text);
  text-decoration: none;
}

.tm-cart-line-name a:hover {
  color: var(--wp--preset--color--accent);
}

.tm-cart-line-price {
  color: var(--wp--preset--color--accent);
  font-weight: 600;
  font-size: 14px;
  font-feature-settings: 'tnum' 1;
  margin-bottom: 8px;
}

.tm-qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--wp--preset--color--border);
  height: 28px;
}

.tm-qty-stepper button {
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--wp--preset--color--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  padding: 0;
  line-height: 1;
}

.tm-qty-stepper button:hover {
  color: var(--wp--preset--color--text);
}

.tm-qty-stepper input {
  width: 36px;
  height: 28px;
  border: none;
  border-left: 1px solid var(--wp--preset--color--border);
  border-right: 1px solid var(--wp--preset--color--border);
  text-align: center;
  font-size: 13px;
  font-family: var(--wp--preset--font-family--inter);
  background: none;
  -moz-appearance: textfield;
}

.tm-qty-stepper input::-webkit-outer-spin-button,
.tm-qty-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.tm-cart-line-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--wp--preset--color--text-light);
  padding: 4px;
  transition: color 0.2s ease;
  margin-top: 2px;
}

.tm-cart-line-remove:hover {
  color: var(--wp--preset--color--accent);
}

/* Empty state */
.tm-drawer-empty {
  text-align: center;
  padding: 64px 24px;
}

.tm-drawer-empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  opacity: 0.4;
  color: var(--wp--preset--color--text-muted);
}

.tm-drawer-empty-title {
  font-family: var(--wp--preset--font-family--cormorant);
  font-size: 22px;
  font-weight: 500;
  color: var(--wp--preset--color--text);
  margin-bottom: 8px;
}

.tm-drawer-empty-text {
  font-size: 14px;
  color: var(--wp--preset--color--text-muted);
  margin-bottom: 28px;
}

/* Footer */
.tm-drawer-footer {
  border-top: 1px solid var(--wp--preset--color--border);
  padding: 16px 24px 20px;
  background: var(--wp--preset--color--bg);
  flex-shrink: 0;
}

.tm-drawer-totals {
  margin-bottom: 14px;
}

.tm-drawer-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 13px;
  color: var(--wp--preset--color--text-body);
}

.tm-drawer-total-row.grand {
  font-size: 16px;
  font-weight: 600;
  border-top: 1px solid var(--wp--preset--color--border);
  padding-top: 10px;
  margin-top: 6px;
}

.tm-drawer-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  background: var(--wp--preset--color--accent);
  color: #fff;
  border: none;
  font-family: var(--wp--preset--font-family--inter);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease;
}

.tm-drawer-cta:hover {
  background: var(--wp--preset--color--accent-dark);
  color: #fff;
}

.tm-drawer-trust {
  text-align: center;
  font-size: 11px;
  color: var(--wp--preset--color--text-light);
  margin-top: 10px;
  letter-spacing: 0.02em;
}

@media (max-width: 768px) {
  .tm-drawer {
    width: 100vw;
  }
}
