/* ================================================
   SIDE CART — Caddy Professional Design System
   Design: Caddy v3.0.2  |  Code: Side Cart v4.0
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Caddy Design Tokens ── */
:root {
  --sc-width:               420px;
  --sc-primary:             #000000;
  --sc-primary-hover:       #313131;
  --sc-bg:                  #ffffff;
  --sc-text:                #000000;
  --sc-muted:               #777777;
  --sc-border:              #dedede;
  --sc-border-w:            1px;
  --sc-mint:                #12b97c;
  --sc-meter-color:         #37a7c1;
  --sc-meter-done:          #1dc487;
  --sc-link:                #000000;
  --sc-link-hover:          #313131;
  --sc-header-bg:           #ffffff;
  --sc-icon:                #000000;
  --sc-radius:              3px;
  --sc-btn-radius:          8px;
  --sc-thumb:               90px;
  --sc-shadow:              0 0 20px rgba(0,0,0,0.18);
  --sc-transition:          0.15s ease-out;
  --sc-count-bg:            #12b97c;
  --sc-count-text:          #ffffff;
  --sc-rec-bg:              #ffffff;
  --sc-rec-border:          #dedede;
}

/* ── Base Reset ── */
#side-cart-drawer,
#side-cart-drawer * {
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
#side-cart-drawer a,
#side-cart-drawer a:hover,
#side-cart-drawer a:visited {
  text-decoration: none;
}

/* ════════════════════
   OVERLAY
════════════════════ */
.sc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.565);
  z-index: 99998;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity var(--sc-transition), visibility var(--sc-transition);
}
.sc-overlay.is-open {
  opacity: 1;
  pointer-events: all;
  visibility: visible;
}

/* ════════════════════
   DRAWER
════════════════════ */
.sc-drawer {
  position: fixed;
  top: 0;
  right: -1000px;
  width: min(var(--sc-width), 100vw);
  height: 100%;
  background: var(--sc-bg);
  z-index: 99999;
  box-shadow: var(--sc-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: right var(--sc-transition);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  color: var(--sc-text);
  text-transform: none;
  line-height: 1.5;
  letter-spacing: 0;
}
.sc-drawer.is-open { right: 0; }

/* ════════════════════
   HEADER
════════════════════ */
.sc-header {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  min-height: 52px;
  background: var(--sc-header-bg);
  border-bottom: var(--sc-border-w) solid var(--sc-border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 999;
}
.sc-header-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: baseline;
  gap: 5px;
  pointer-events: none;
}
.sc-title-text {
  font-size: 1.05em;
  font-weight: 600;
  color: var(--sc-text);
  letter-spacing: -0.2px;
}
.sc-item-count {
  font-size: 0.88em;
  font-weight: 400;
  color: var(--sc-muted);
}
.sc-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sc-text);
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.sc-close:hover { opacity: 0.5; }
.sc-close svg { width: 20px; height: 20px; display: block; }

/* ════════════════════
   FREE SHIPPING METER
════════════════════ */
.sc-shipping-bar {
  padding: 6px 20px 16px;
  background: var(--sc-bg);
  position: inherit !important;
  border-bottom: var(--sc-border-w) solid var(--sc-border);
  flex-shrink: 0;
}
.sc-shipping-text {
  font-size: 14px;
  color: var(--sc-muted);
  text-align: left;
  margin: 8px 0 6px;
  padding: 0;
  line-height: 1.5;
}
.sc-shipping-text strong { color: var(--sc-text); }
.sc-shipping-text.sc-reached { color: var(--sc-mint); }
.sc-progress-track {
  width: 100%;
  background: #f0efef;
  height: 8px;
  border-radius: 10px;
  overflow: hidden;
}
.sc-progress-fill {
  height: 100%;
  background: var(--sc-meter-color);
  background-image: linear-gradient(135deg,rgba(255,255,255,.22) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.22) 50%,rgba(255,255,255,.22) 75%,transparent 75%,transparent);
  background-size: 20px 20px;
  border-radius: 10px;
  transition: width 0.35s ease;
  animation: sc-meter-stripes 1.5s linear infinite reverse;
}
@keyframes sc-meter-stripes {
  0%   { background-position: 0 0; }
  100% { background-position: 20px 0; }
}

/* ════════════════════
   EMPTY STATE
════════════════════ */
.sc-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 25px;
  text-align: center;
  overflow-y: auto;
}
.sc-empty-state h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--sc-text);
  letter-spacing: -0.2px;
  margin: 0 0 8px;
}
.sc-cat-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 280px;
}
.sc-cat-btn {
  display: block;
  background: var(--sc-primary);
  color: #fff !important;
  text-decoration: none !important;
  padding: 12px 24px;
  border-radius: var(--sc-btn-radius);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  transition: background 0.2s, transform 0.15s;
  cursor: pointer;
}
.sc-cat-btn:hover {
  background: var(--sc-primary-hover);
  transform: translateY(-1px);
}

/* ════════════════════
   CART ITEMS
════════════════════ */
/* Combined scroll wrapper for cart items + suggestions */
.sc-scroll-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.2) transparent;
}
.sc-scroll-wrap::-webkit-scrollbar { width: 4px; }
.sc-scroll-wrap::-webkit-scrollbar-track { background: transparent; }
.sc-scroll-wrap::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 4px; }

.sc-items-wrap {
  padding: 0;
}
.sc-items-wrap.has-items { /* layout now handled by sc-scroll-wrap */ }

.sc-cart-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin: 0 20px;
  padding: 16px 0;
  border-top: var(--sc-border-w) solid var(--sc-border);
  position: relative;
  animation: sc-slidein 0.26s ease both;
}
.sc-cart-item:first-child { border-top: 0; }

@keyframes sc-slidein {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.sc-item-highlight { animation: sc-highlight-flash 2s ease forwards !important; }
@keyframes sc-highlight-flash {
  0%   { background: rgba(18,185,124,.1); }
  70%  { background: rgba(18,185,124,.1); }
  100% { background: transparent; }
}

.sc-item-img {
  flex: none;
  width: var(--sc-thumb);
  height: var(--sc-thumb);
  object-fit: cover;
  border-radius: var(--sc-radius);
  background: #f5f5f5;
  display: block;
}

.sc-item-info { flex: 1; min-width: 0; }

.sc-item-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--sc-link);
  display: block;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  letter-spacing: -0.1px;
}
.sc-item-meta {
  font-size: 13px;
  color: var(--sc-muted);
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

/* Qty controls */
.sc-qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-top: 4px;
}
.sc-qty-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sc-text);
  transition: background 0.12s;
  line-height: 1;
}

.sc-remove-btn {
  padding: 6px 8px;
  color: var(--sc-muted);
  border: none;
}
.sc-remove-btn:hover { color: #b81c23; }
.sc-remove-btn svg { width: 14px; height: 14px; display: block; }

.sc-qty-minus {
  height: 30px;
  width: 30px;
  border: 1px solid var(--sc-border);
  border-right: none;
  border-radius: var(--sc-radius) 0 0 var(--sc-radius);
  font-size: 16px;
  color: var(--sc-text);
  cursor: pointer;
  background: none;
  padding: 0;
  transition: background 0.12s;
}
.sc-qty-minus:hover { background: #f5f5f5; }

.sc-qty-num {
  width: 32px;
  height: 30px;
  text-align: center;
  font-size: 13px;
  font-weight: 400;
  color: var(--sc-text);
  user-select: none;
  border-top: 1px solid var(--sc-border);
  border-bottom: 1px solid var(--sc-border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
}

.sc-qty-plus {
  height: 30px;
  width: 30px;
  border: 1px solid var(--sc-border);
  border-left: none;
  border-radius: 0 var(--sc-radius) var(--sc-radius) 0;
  cursor: pointer;
  background: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.sc-qty-plus:hover { background: #f5f5f5; }
.sc-qty-plus svg { width: 10px; height: 10px; display: block; }

.sc-item-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--sc-text);
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
  white-space: nowrap;
}

/* ── Cart item tier-discount display ── */
.sc-item-price-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
}
.sc-item-price-wrap .sc-item-price {
  margin-top: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--sc-text);
}
.sc-item-original-price,
.sc-item-original-price span,
.sc-item-original-price bdi {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #9aabb8 !important;
  text-decoration: line-through !important;
  white-space: nowrap;
}
.sc-item-discount-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #5a7a3a;
  background: #e8f0d8;
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
span.woocommerce-Price-amount.amount {
  font-size: inherit;
  font-weight: inherit;
  vertical-align: bottom;
}

/* ════════════════════
   SUGGESTIONS
════════════════════ */
#sc-suggest-section {
  padding: 16px 20px;
  flex-shrink: 0;
  border-top: var(--sc-border-w) solid var(--sc-border);
  background: #f9f9f9;
}
#sc-suggest-section.sc-suggest-empty {
  flex: 1;
  background: var(--sc-bg);
}
#sc-suggest-section::-webkit-scrollbar { width: 4px; }

.sc-suggest-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--sc-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
}
.sc-suggest-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--sc-rec-bg);
  border: var(--sc-border-w) solid var(--sc-rec-border);
  border-radius: var(--sc-radius);
  padding: 12px;
  margin-bottom: 10px;
  animation: sc-slidein 0.26s ease both;
}
.sc-suggest-item:last-child { margin-bottom: 0; }
.sc-suggest-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--sc-radius);
  background: #f5f5f5;
  flex-shrink: 0;
}
.sc-suggest-info { flex: 1; min-width: 0; }
.sc-suggest-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--sc-link);
  display: block;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-suggest-meta {
  font-size: 12px;
  color: var(--sc-muted);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-suggest-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--sc-text);
  display: block;
}

/* ── Suggestion discount price layout ── */
.sc-suggest-price-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 1px;
}
.sc-suggest-regular-price,
.sc-suggest-regular-price span,
.sc-suggest-regular-price bdi {
  font-size: 13px;
  font-weight: 500;
  color: #9aabb8 !important;
  text-decoration: line-through !important;
}
.sc-suggest-sale-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--sc-text);
}
.sc-suggest-discount-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #5a7a3a;
  background: #e8f0d8;
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.sc-add-btn {
  background: #efefef;
  color: var(--sc-text) !important;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 12px;
  border-radius: var(--sc-btn-radius);
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
  text-transform: capitalize;
  letter-spacing: 0;
  line-height: 1;
}
.sc-add-btn:hover:not(:disabled) { background: var(--sc-primary); color: #fff !important; }
.sc-add-btn:disabled { opacity: 0.5; pointer-events: none; }

.sc-variable-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--sc-primary);
  background: #f0f0f0;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.sc-spinner {
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid rgba(0,0,0,0.12);
  border-top-color: rgba(0,0,0,0.55);
  border-radius: 50%;
  animation: sc-spin 0.55s linear infinite;
  vertical-align: middle;
}
@keyframes sc-spin { to { transform: rotate(360deg); } }

/* ════════════════════
   FOOTER / CHECKOUT
════════════════════ */
.sc-footer {
  border-top: var(--sc-border-w) solid var(--sc-border);
  padding: 14px 20px 20px;
  flex-shrink: 0;
  background: var(--sc-bg);
  position: sticky;
  bottom: 0;
  z-index: 99;
}
.sc-discount-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.sc-discount-label,
.sc-discount-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--sc-mint);
}
.sc-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.sc-subtotal-row > span {
  font-size: 16px;
  font-weight: 700;
  color: var(--sc-text);
}
.sc-prices { display: flex; gap: 6px; align-items: center; }
.sc-original-price { font-size: 13px; text-decoration: line-through; color: var(--sc-muted); }
.sc-subtotal-price { font-size: 16px; font-weight: 700; color: var(--sc-text); }
.sc-discount-hint {
  font-size: 12px;
  color: var(--sc-muted);
  font-style: italic;
  margin: 2px 0 14px;
  line-height: 1.4;
}

/* ── Applied coupon rows + free shipping + total ── */
.sc-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.sc-coupon-row .sc-coupon-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--sc-text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.sc-coupon-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--sc-text);
  background: #f0f0f0;
  border: 1px solid var(--sc-border);
  border-radius: 20px;
  padding: 2px 9px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.sc-coupon-amount {
  font-size: 13px;
  font-weight: 600;
  color: var(--sc-mint);
}
.sc-free-ship-row > span { font-size: 13px; font-weight: 500; color: var(--sc-text); }
.sc-free-ship-val { font-size: 13px; font-weight: 700; color: var(--sc-mint); }
.sc-total-row {
  border-top: var(--sc-border-w) solid var(--sc-border);
  padding-top: 8px;
  margin-top: 4px;
  margin-bottom: 10px;
}
.sc-total-row > strong:first-child { font-size: 16px; font-weight: 700; color: var(--sc-text); }
.sc-cart-total-val { font-size: 16px; font-weight: 700; color: var(--sc-text); }

/* Caddy .cc-button-primary */
.sc-checkout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  background: var(--sc-primary);
  color: #fff !important;
  text-decoration: none !important;
  font-family: inherit;
  font-size: 1em;
  font-weight: 700;
  line-height: 1;
  padding: 16px 20px 17px;
  border-radius: var(--sc-btn-radius);
  letter-spacing: 0;
  transition: background 0.25s, padding-left 0.25s;
  cursor: pointer;
  text-align: center;
  border: none;
}
.sc-checkout-btn:hover {
  background: var(--sc-primary-hover);
  padding-left: 8px;
}
.sc-checkout-btn svg,
.sc-checkout-btn img {
  width: auto;
  height: 15px;
  display: block;
  flex-shrink: 0;
  color: #fff;
}

/* ════════════════════
   SKELETON LOADER
════════════════════ */
.sc-skeleton-row {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px 20px;
  border-top: var(--sc-border-w) solid var(--sc-border);
}
.sc-skeleton-row:first-child { border-top: 0; }
.sc-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: sc-shimmer 1.3s infinite;
  border-radius: var(--sc-radius);
}
@keyframes sc-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ════════════════════
   TRIGGER BUTTON
════════════════════ */
.sc-trigger-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--sc-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sc-trigger-count {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--sc-count-bg);
  color: var(--sc-count-text);
  font-size: 10px;
  font-weight: 700;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ════════════════════
   RESPONSIVE
════════════════════ */
@media (max-width: 480px) {
  :root { --sc-width: 100vw; }
  .sc-empty-state { padding: 25px 16px; }
}

/* ── Counter pop animation (jab product add ho) ── */
@keyframes sc-count-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.45); }
  100% { transform: scale(1); }
}
.sc-trigger-count.sc-count-pop {
  animation: sc-count-pop 0.28s ease;
}
