/* PCBMart Slide-Out Cart Drawer Styles */
:root {
  --drawer-brand: #F10042;
  --drawer-brand-hover: #d4003a;
  --drawer-surface: #ffffff;
  --drawer-text: #0f172a;
  --drawer-muted: #64748b;
  --drawer-border: #e2e8f0;
  --drawer-bg-light: #f8fafc;
}

/* Backdrop */
.pcbmart-cart-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pcbmart-cart-backdrop.open {
  opacity: 1;
  visibility: visible;
}

/* Drawer Container */
.pcbmart-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 440px;
  height: 100vh;
  background: var(--drawer-surface);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(15, 23, 42, 0.15);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--drawer-text);
  box-sizing: border-box;
}

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

/* Drawer Header */
.cart-drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--drawer-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.cart-drawer-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-drawer-title-wrap h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--drawer-text);
}

.cart-drawer-count-chip {
  background: #fff1f3;
  color: var(--drawer-brand);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #ffe4e8;
}

.cart-drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--drawer-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.cart-drawer-close:hover {
  background: #f1f5f9;
  color: var(--drawer-text);
}

/* Free Shipping & Assurance Strip */
.cart-drawer-shipping-strip {
  background: #ecfdf5;
  border-bottom: 1px solid #d1fae5;
  padding: 10px 20px;
  font-size: 12px;
  color: #065f46;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-drawer-shipping-strip .material-symbols-outlined {
  font-size: 16px;
  color: #059669;
}

/* Scrollable Items Container */
.cart-drawer-items-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Empty State */
.cart-drawer-empty {
  text-align: center;
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--drawer-muted);
}

.cart-drawer-empty .empty-icon {
  font-size: 48px;
  color: #cbd5e1;
}

.cart-drawer-empty h4 {
  margin: 0;
  font-size: 16px;
  color: var(--drawer-text);
  font-weight: 700;
}

.cart-drawer-empty p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.cart-drawer-empty .btn-browse-pcbs {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--drawer-brand);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s;
}

.cart-drawer-empty .btn-browse-pcbs:hover {
  background: var(--drawer-brand-hover);
}

/* Item Card */
.cart-drawer-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--drawer-border);
  border-radius: 12px;
  position: relative;
  transition: all 0.2s;
}

.cart-drawer-item.loading {
  opacity: 0.5;
  pointer-events: none;
}

.cart-drawer-item-img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid #f1f5f9;
}

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

.cart-drawer-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.cart-drawer-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--drawer-text);
  line-height: 1.35;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.cart-drawer-item-title:hover {
  color: var(--drawer-brand);
}

.cart-drawer-item-meta {
  font-size: 11px;
  color: var(--drawer-muted);
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cart-item-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-condition-new {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #d1fae5;
}

.badge-condition-refurb {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #dbeafe;
}

.cart-drawer-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-drawer-item-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--drawer-text);
}

/* Quantity Adjuster */
.cart-drawer-qty-group {
  display: inline-flex;
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--drawer-border);
  border-radius: 6px;
  overflow: hidden;
}

.cart-drawer-qty-btn {
  background: none;
  border: none;
  width: 26px;
  height: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--drawer-text);
  transition: background 0.15s;
}

.cart-drawer-qty-btn:hover {
  background: #e2e8f0;
}

.cart-drawer-qty-val {
  min-width: 24px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  font-family: monospace;
}

.cart-drawer-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.cart-drawer-item-remove:hover {
  color: #ef4444;
}

/* Drawer Footer */
.cart-drawer-footer {
  padding: 18px 20px;
  border-top: 1px solid var(--drawer-border);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.04);
}

.cart-drawer-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--drawer-muted);
}

.cart-drawer-summary-row.total-row {
  font-size: 16px;
  font-weight: 800;
  color: var(--drawer-text);
  padding-top: 6px;
  border-top: 1px dashed var(--drawer-border);
}

.cart-drawer-summary-row .amount-highlight {
  font-size: 18px;
  color: var(--drawer-brand);
}

.cart-drawer-btn-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: var(--drawer-brand);
  color: #ffffff;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(241, 0, 66, 0.25);
  transition: all 0.2s;
  box-sizing: border-box;
}

.cart-drawer-btn-checkout:hover {
  background: var(--drawer-brand-hover);
  transform: translateY(-1px);
}

.cart-drawer-btn-viewcart {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--drawer-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.cart-drawer-btn-viewcart:hover {
  color: var(--drawer-text);
  text-decoration: underline;
}

.cart-drawer-trust-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 11px;
  color: #94a3b8;
  padding-top: 4px;
}
