/* GoGiftings Cart Drawer — cd-* scoped styles */

/* ── Header ────────────────────────────────────── */
.cd-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 14px;
  border-bottom: 1px solid #f2f2f2;
}

.cd-header .eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #e31e73;
  margin-bottom: 2px;
}

.cd-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #1a1a2e;
  line-height: 1.2;
}

.cd-header .addon-close {
  position: static !important;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── Price ─────────────────────────────────────── */
.cd-price {
  font-weight: 700;
  color: #e31e73;
}

/* ── Loading ───────────────────────────────────── */
.cart-drawer-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 24px;
  color: #888;
  font-size: 14px;
}

.cart-drawer-spinner {
  display: block;
  width: 32px;
  height: 32px;
  border: 3px solid #f0f0f0;
  border-top-color: #e31e73;
  border-radius: 50%;
  animation: cd-spin 0.7s linear infinite;
}

@keyframes cd-spin {
  to { transform: rotate(360deg); }
}

/* ── Error ─────────────────────────────────────── */
.cart-drawer-error {
  margin: 16px 24px;
  padding: 12px 16px;
  background: #fff0f3;
  color: #e31e73;
  border-radius: 10px;
  font-size: 13px;
}

/* ── Empty ─────────────────────────────────────── */
.cart-drawer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 24px;
  text-align: center;
}

.cart-drawer-empty > span {
  font-size: 52px;
  line-height: 1;
}

.cart-drawer-empty p {
  font-size: 15px;
  color: #888;
  margin: 0;
}

/* ── Items scrollable list ─────────────────────── */
.cd-items-list {
  overflow-y: auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  max-height: 44vh;
  flex: 1;
}

/* ── Item row ──────────────────────────────────── */
.cd-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid #f5f5f5;
}

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

/* Thumbnail */
.cd-item-img {
  flex-shrink: 0;
  width: 70px;
  height: 70px;
  border-radius: 10px;
  overflow: hidden;
  background: #f5f5f5;
  border: 1px solid #eee;
}

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

/* Info column */
.cd-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cd-item-name {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cd-item-variant {
  font-size: 11px;
  color: #aaa;
  margin: 0 0 4px;
}

.cd-item-unit-price {
  font-size: 12px;
  color: #aaa;
  margin: 0 0 8px;
}

.cd-item-unit-price .cd-price {
  font-size: 12px;
  color: #bbb;
  font-weight: 600;
}

/* Actions row */
.cd-item-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Qty stepper */
.cd-qty-ctrl {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid #e8e8e8;
  border-radius: 999px;
  overflow: hidden;
  background: #fafafa;
}

.cd-qty-btn {
  background: none;
  border: none;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  color: #555;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.cd-qty-btn:hover:not(:disabled) {
  background: #fce4ef;
  color: #e31e73;
}

.cd-qty-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.cd-qty-ctrl > span {
  min-width: 30px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #1a1a2e;
  display: block;
}

/* Line total */
.cd-item-line-total .cd-price {
  font-size: 13px;
  font-weight: 800;
  color: #1a1a2e;
}

/* Remove */
.cd-remove-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.4;
  padding: 0;
  line-height: 1;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
}

.cd-remove-btn:hover:not(:disabled) {
  opacity: 1;
}

.cd-remove-btn:disabled {
  cursor: not-allowed;
  opacity: 0.15;
}

/* ── Payment summary ───────────────────────────── */
.cd-summary {
  padding: 14px 24px;
  border-top: 1.5px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cd-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #666;
}

.cd-summary-promo strong {
  color: #2a9d5c;
}

.cd-summary-total {
  padding-top: 10px;
  border-top: 1.5px dashed #eee;
  font-size: 15px;
  font-weight: 800;
  color: #1a1a2e;
}

.cd-summary-total .cd-price {
  font-size: 16px;
  font-weight: 900;
  color: #e31e73;
}

/* ── Header Search Autocomplete (hs-*) ─────────── */
.hs-wrap {
  /* Transparent passthrough — inherits flex behaviour from .header-search-wrap */
  display: contents;
}

/* The inner anchor div gets all sizing */
.hs-wrap > div {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
}

.hs-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #f0f0f0;
  border-top-color: #e31e73;
  border-radius: 50%;
  animation: cd-spin 0.6s linear infinite;
  position: absolute;
  right: 44px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.hs-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  z-index: 9999;
  list-style: none;
  margin: 0;
  padding: 6px 0;
  overflow: hidden;
}

.hs-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  text-decoration: none;
  color: #1a1a2e;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.13s;
}

.hs-item:hover {
  background: #fce4ef;
  color: #e31e73;
}

.hs-item img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 8px;
  background: #f5f5f5;
  flex-shrink: 0;
}

.hs-item-footer {
  border-top: 1px solid #f5f5f5;
  margin-top: 4px;
}

.hs-item-footer a {
  display: block;
  padding: 9px 14px;
  font-size: 12px;
  color: #e31e73;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}

.hs-item-footer a:hover {
  background: #fff0f7;
}
