/* ===== NCL Cart Drawer - Shopify Style ===== */
:root {
  --ncl-drawer-width: 440px;
  --ncl-drawer-bg: #fff;
  --ncl-drawer-overlay: rgba(0, 0, 0, 0.45);
  --ncl-drawer-border: #e5e5e5;
  --ncl-drawer-text: #1a1a1a;
  --ncl-drawer-text-light: #717171;
  --ncl-drawer-accent: #1a1a1a;
  --ncl-drawer-success: #2e7d32;
}

/* ===== Overlay ===== */
.ncl-cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: var(--ncl-drawer-overlay);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ncl-cart-drawer.open .ncl-cart-drawer-overlay {
  opacity: 1;
  visibility: visible;
}

/* ===== Panel ===== */
.ncl-cart-drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--ncl-drawer-width);
  height: 100%;
  background: var(--ncl-drawer-bg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
}

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

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

.ncl-drawer-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ncl-drawer-bag-icon {
  flex-shrink: 0;
}

.ncl-cart-drawer-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ncl-drawer-text);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ncl-drawer-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ncl-drawer-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  background: var(--ncl-drawer-text);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  padding: 0 5px;
}

.ncl-cart-drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--ncl-drawer-text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.ncl-cart-drawer-close:hover {
  opacity: 0.6;
}

/* ===== Unified Promotion Bar ===== */
.ncl-drawer-promos {
  padding: 14px 20px;
  border-bottom: 1px solid var(--ncl-drawer-border);
  flex-shrink: 0;
}

/* Header text */
.ncl-promo-header {
  font-size: 12px;
  font-weight: 500;
  color: var(--ncl-drawer-text);
  margin-bottom: 12px;
  text-align: center;
}

.ncl-promo-header strong {
  font-weight: 700;
}

/* Bar wrapper */
.ncl-promo-bar-wrap {
  height: 32px;
  display: flex;
  align-items: center;
  margin: 0 14px 12px; /* side margin = half milestone width */
}

.ncl-promo-track {
  width: 100%;
  height: 4px;
  background: #e0e0e0;
  border-radius: 20px;
  position: relative;
}

.ncl-promo-fill {
  height: 100%;
  background: var(--ncl-drawer-success);
  border-radius: 20px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Milestone icon circles — positioned on the track */
.ncl-promo-milestone {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.ncl-promo-milestone svg {
  color: #bbb;
}

.ncl-promo-milestone.reached {
  border-color: var(--ncl-drawer-success);
}

.ncl-promo-milestone.reached svg {
  color: var(--ncl-drawer-success);
}



/* ===== Products Body ===== */
.ncl-cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  scrollbar-width: thin;
}

.ncl-cart-drawer-body::-webkit-scrollbar {
  width: 4px;
}

.ncl-cart-drawer-body::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

/* ===== Product Item ===== */
.ncl-drawer-item {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ncl-drawer-border);
  position: relative;
}

.ncl-drawer-item-img {
  width: 80px;
  height: 100px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #f5f5f5;
}

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

.ncl-drawer-item-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ncl-drawer-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.ncl-drawer-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ncl-drawer-text);
  text-decoration: none;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ncl-drawer-item-name:hover {
  text-decoration: underline;
  color: var(--ncl-drawer-text);
}

.ncl-drawer-item-attr {
  font-size: 12px;
  color: var(--ncl-drawer-text-light);
  line-height: 1.4;
}

.ncl-drawer-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6px;
}

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

/* Remove button */
.ncl-drawer-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: var(--ncl-drawer-text-light);
  transition: color 0.2s;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.ncl-drawer-item-remove:hover {
  color: var(--ncl-drawer-text);
}

/* ===== Quantity Controls ===== */
.ncl-drawer-item-qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--ncl-drawer-border);
  border-radius: 4px;
}

.ncl-qty-btn {
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ncl-drawer-text);
  transition: background 0.15s;
  user-select: none;
}

.ncl-qty-btn:hover:not(:disabled) {
  background: #f5f5f5;
}

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

.ncl-qty-value {
  width: 32px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  border-left: 1px solid var(--ncl-drawer-border);
  border-right: 1px solid var(--ncl-drawer-border);
  line-height: 30px;
}

/* ===== Empty State ===== */
.ncl-drawer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
}

.ncl-drawer-empty p {
  font-size: 15px;
  color: var(--ncl-drawer-text-light);
  margin: 16px 0 24px;
}

.ncl-btn-continue {
  display: inline-block;
  padding: 12px 28px;
  background: var(--ncl-drawer-accent);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: opacity 0.2s;
}

.ncl-btn-continue:hover {
  opacity: 0.85;
  color: #fff;
  text-decoration: none;
}

/* ===== Footer ===== */
.ncl-cart-drawer-footer {
  border-top: 1px solid var(--ncl-drawer-border);
  flex-shrink: 0;
  padding-bottom: 20px;
}

/* ===== Coupon Section ===== */
.ncl-drawer-coupon {
  border-bottom: 1px solid var(--ncl-drawer-border);
}

.ncl-drawer-coupon-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--ncl-drawer-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  user-select: none;
}

.ncl-drawer-coupon-arrow {
  transition: transform 0.3s;
}

.ncl-drawer-coupon.open .ncl-drawer-coupon-arrow {
  transform: rotate(180deg);
}

.ncl-drawer-coupon-body {
  padding: 0 20px 14px;
}

.ncl-drawer-coupon-body.ncl-hidden {
  display: none;
}

.ncl-drawer-coupon-input {
  display: flex;
  gap: 8px;
}

.ncl-drawer-coupon-input input {
  flex: 1;
  height: 40px;
  border: 1px solid var(--ncl-drawer-border);
  border-radius: 4px;
  padding: 0 12px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.ncl-drawer-coupon-input input:focus {
  border-color: var(--ncl-drawer-text);
}

.ncl-drawer-coupon-input button {
  height: 40px;
  padding: 0 16px;
  background: var(--ncl-drawer-accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.ncl-drawer-coupon-input button:hover:not(:disabled) {
  opacity: 0.85;
}

.ncl-drawer-coupon-input button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ncl-drawer-coupon-feedback {
  margin-top: 8px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 4px;
}

.ncl-drawer-coupon-feedback.ncl-hidden {
  display: none;
}

.ncl-drawer-coupon-feedback.success {
  color: var(--ncl-drawer-success);
  background: #e8f5e9;
}

.ncl-drawer-coupon-feedback.error {
  color: #c62828;
  background: #ffebee;
}

.ncl-drawer-coupon-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 10px;
  background: #f5f5f5;
  border-radius: 4px;
  font-size: 12px;
  color: var(--ncl-drawer-text);
}

.ncl-drawer-remove-coupon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--ncl-drawer-text-light);
  padding: 0 2px;
  line-height: 1;
}

.ncl-drawer-remove-coupon:hover {
  color: var(--ncl-drawer-text);
}

/* ===== Order Summary ===== */
.ncl-drawer-summary {
  padding: 16px 20px;
}

.ncl-drawer-summary-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ncl-drawer-text);
  margin-bottom: 10px;
}

.ncl-drawer-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ncl-drawer-text);
  padding: 3px 0;
}

.ncl-drawer-total {
  font-weight: 700;
  font-size: 15px;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid var(--ncl-drawer-border);
}

.ncl-drawer-tax-note {
  font-size: 11px;
  color: var(--ncl-drawer-text-light);
  padding-top: 4px;
}

.ncl-drawer-tax-note span {
  font-size: 11px;
}

/* ===== Checkout Button ===== */
.ncl-btn-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 40px);
  margin: 0 20px;
  padding: 14px;
  background: var(--ncl-drawer-accent);
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ncl-btn-checkout:hover {
  opacity: 0.85;
  color: #fff;
  text-decoration: none;
}

.ncl-btn-checkout svg {
  flex-shrink: 0;
}

/* ===== Payment Icons ===== */
.ncl-drawer-payment-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px 16px;
  flex-wrap: wrap;
}

.ncl-drawer-payment-icons img {
  height: 22px;
  width: auto;
  opacity: 0.7;
}

/* ===== Loading State ===== */
.ncl-drawer-item.ncl-updating {
  opacity: 0.5;
  pointer-events: none;
}

/* ===== Notification Toast ===== */
.ncl-drawer-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  background: var(--ncl-drawer-text);
  color: #fff;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.ncl-drawer-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Body Scroll Lock ===== */
body.ncl-drawer-open {
  overflow: hidden;
}

/* ===== Hide default PS modal ===== */
#blockcart-modal {
  display: none !important;
}

/* ===== Mobile ===== */
@media (max-width: 480px) {
  :root {
    --ncl-drawer-width: 100%;
  }

  .ncl-drawer-item-img {
    width: 68px;
    height: 85px;
  }
}
