/* Global storefront shopping cart (prefix: ld-cart-*) */
.ld-cart-fab {
  position: fixed;
  right: 20px;
  bottom: 164px;
  z-index: 9990;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #111827;
  color: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.24);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
  padding: 0;
}
.ld-cart-fab:hover {
  transform: translateY(-2px);
  background: #1f2937;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.3);
}
.ld-cart-fab.is-bump {
  animation: ldCartBump 0.35s ease;
}
@keyframes ldCartBump {
  0% { transform: scale(1); }
  45% { transform: scale(1.16); }
  100% { transform: scale(1); }
}
.ld-cart-fab-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  border: 2px solid #ffffff;
  box-sizing: border-box;
}
.ld-cart-fab-badge[hidden] {
  display: none;
}

.ld-cart-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  text-decoration: none;
}
.ld-cart-add-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
}
.ld-cart-add-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.ld-cart-detail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ld-cart-detail-btn:hover:not(:disabled) {
  background: #dbeafe;
  border-color: #1d4ed8;
}
.ld-cart-detail-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.ld-cart-buy-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
@media (min-width: 769px) {
  .fixed-purchase-bar .purchase-content {
    max-width: 1440px;
    padding: 0 10px;
    box-sizing: border-box;
  }
}
.ld-cart-detail-btn--pill {
  height: 50px;
  padding: 0 22px;
  border-radius: 25px;
  font-size: 16px;
  white-space: nowrap;
}
.ld-cart-buy-group--simple {
  float: right;
  flex-wrap: nowrap;
}
.ld-cart-buy-group--simple .btn-group-show {
  float: none !important;
  margin: 0 !important;
}
.ld-cart-detail-btn--simple {
  height: 45px;
  padding: 0 20px;
  border-radius: 50px;
  font-size: 15px;
  white-space: nowrap;
}
.tokyo-qty-actions .ld-cart-detail-btn {
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  white-space: nowrap;
}
@media (max-width: 768px) {
  .ld-cart-buy-group {
    gap: 8px;
  }
  .ld-cart-detail-btn--pill {
    height: 45px;
    padding: 0 14px;
    font-size: 14px;
  }
  .ld-cart-detail-btn--simple {
    height: 45px;
    padding: 0 14px;
    font-size: 14px;
  }
}

.ld-cart-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9995;
  background: rgba(15, 23, 42, 0.48);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.ld-cart-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.ld-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 9996;
  width: min(440px, 100vw);
  background: #ffffff;
  color: #111827;
  box-shadow: -12px 0 36px rgba(15, 23, 42, 0.22);
  transform: translateX(100%);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  box-sizing: border-box;
}
.ld-cart-drawer.is-open {
  transform: translateX(0);
}
.ld-cart-drawer *, .ld-cart-modal * {
  box-sizing: border-box;
}

.ld-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}
.ld-cart-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}
.ld-cart-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ld-cart-text-btn {
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
}
.ld-cart-text-btn:hover {
  color: #ef4444;
}
.ld-cart-close {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #374151;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.ld-cart-close:hover {
  background: #f3f4f6;
}

.ld-cart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  color: #4b5563;
}
.ld-cart-check-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.ld-cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  background: #f8fafc;
}
.ld-cart-empty {
  text-align: center;
  padding: 56px 20px;
  color: #9ca3af;
  font-size: 14px;
}
.ld-cart-item {
  display: flex;
  gap: 10px;
  padding: 12px;
  margin-bottom: 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}
.ld-cart-item.is-invalid {
  background: #fef2f2;
  border-color: #fecaca;
}
.ld-cart-item-check {
  padding-top: 2px;
}
.ld-cart-item-main {
  flex: 1;
  min-width: 0;
}
.ld-cart-item-name {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: #111827;
  text-decoration: none;
  line-height: 1.4;
  word-break: break-word;
}
.ld-cart-item-name:hover {
  color: #2563eb;
}
.ld-cart-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.ld-cart-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11.5px;
  background: #eff6ff;
  color: #1d4ed8;
}
.ld-cart-tag--stock {
  background: #f3f4f6;
  color: #4b5563;
}
.ld-cart-tag--err {
  background: #fee2e2;
  color: #b91c1c;
}
.ld-cart-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}
.ld-cart-price {
  font-size: 14px;
  font-weight: 700;
  color: #ef4444;
}
.ld-cart-price s {
  color: #9ca3af;
  font-weight: 400;
  font-size: 12px;
  margin-right: 4px;
}
.ld-cart-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}
.ld-cart-stepper button {
  width: 26px;
  height: 26px;
  border: none;
  background: #f9fafb;
  color: #374151;
  font-size: 14px;
  cursor: pointer;
}
.ld-cart-stepper button:hover:not(:disabled) {
  background: #e5e7eb;
}
.ld-cart-stepper input {
  width: 42px;
  height: 26px;
  border: none;
  border-left: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  text-align: center;
  font-size: 13px;
  color: #111827;
  outline: none;
}
.ld-cart-del {
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 12px;
  cursor: pointer;
  padding: 4px;
}
.ld-cart-del:hover {
  color: #ef4444;
}

.ld-cart-footer {
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 12px 16px 14px;
}
.ld-cart-field {
  margin-bottom: 9px;
}
.ld-cart-field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}
.ld-cart-input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 13px;
  color: #111827;
  background: #ffffff;
  outline: none;
}
.ld-cart-input:focus {
  border-color: #2563eb;
}
.ld-cart-captcha-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ld-cart-captcha-row img {
  height: 34px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  cursor: pointer;
}
.ld-cart-pay-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 112px;
  overflow-y: auto;
}
.ld-cart-pay-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  background: #ffffff;
  color: #1f2937;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}
.ld-cart-pay-btn.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}
.ld-cart-pay-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.ld-cart-pay-fee {
  font-size: 11px;
  color: #d97706;
  white-space: nowrap;
}
.ld-cart-alert {
  padding: 7px 10px;
  margin-bottom: 8px;
  border-radius: 6px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.4;
}
.ld-cart-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}
.ld-cart-total-box {
  font-size: 12px;
  color: #6b7280;
}
.ld-cart-total-num {
  font-size: 18px;
  font-weight: 800;
  color: #ef4444;
  margin-left: 4px;
}
.ld-cart-checkout-btn {
  height: 38px;
  padding: 0 20px;
  border-radius: 8px;
  border: none;
  background: #2563eb;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.ld-cart-checkout-btn:hover:not(:disabled) {
  background: #1d4ed8;
}
.ld-cart-checkout-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.ld-cart-modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(15, 23, 42, 0.52);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ld-cart-modal-wrap.is-open {
  display: flex;
}
.ld-cart-modal {
  width: min(440px, 100%);
  max-height: 84vh;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.ld-cart-modal-body {
  padding: 14px 16px;
  overflow-y: auto;
  flex: 1;
}
.ld-cart-sku-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.ld-cart-sku-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.ld-cart-sku-opt.is-active {
  border-color: #2563eb;
  background: #eff6ff;
}
.ld-cart-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.ld-cart-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  z-index: 9999;
  background: #111827;
  color: #ffffff;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ld-cart-toast.is-show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.ld-cart-toast-link {
  color: #60a5fa;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}

@media (max-width: 768px) {
  .ld-cart-fab {
    right: 20px;
    bottom: 156px;
    width: 48px;
    height: 48px;
  }
  .ld-cart-drawer {
    width: 100vw;
  }
}
