/* ==========================================================================
   BM Cart Upsell – matches Dahls Gravering prototype
   ========================================================================== */

:root {
  --bmu-green: #0d8a5e;
  --bmu-green-hover: #0a7550;
  --bmu-green-light: #e8f5ef;
  --bmu-text: #1a1a1a;
  --bmu-text-secondary: #5a5a5a;
  --bmu-text-muted: #888;
  --bmu-border: #e5e5e5;
  --bmu-white: #ffffff;
  --bmu-express-orange: #e8740c;
  --bmu-express-bg: #fff8f0;
  --bmu-radius: 10px;
  --bmu-radius-sm: 8px;
}

/* ── Cart page section ── */
.upsell-section {
  margin-top: 20px;
}

.upsell-heading {
  font-size: 14px;
  font-weight: 600;
  color: var(--bmu-text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.upsell-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

/* ── Checkout section ── */
.upsell-checkout-section {
  margin-bottom: 20px;
}

.upsell-checkout-heading {
  font-size: 13px;
  font-weight: 600;
  color: var(--bmu-text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.upsell-checkout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

/* ── Upsell Card ── */
.upsell-card {
  background: var(--bmu-white);
  border: 2px solid var(--bmu-border);
  border-radius: var(--bmu-radius);
  padding: 18px 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  user-select: none;
}

.upsell-card:hover {
  border-color: #0d8a5e;
  box-shadow: 0 4px 16px rgba(13, 138, 94, 0.1);
  transform: translateY(-2px);
}

.upsell-card.active {
  border-color: #0d8a5e;
  background: var(--bmu-green-light);
}

.upsell-card.active .upsell-check {
  background: #0d8a5e;
  border-color: #0d8a5e;
}

.upsell-card.active .upsell-check svg {
  opacity: 1;
}

/* ── Pre-selected (checkout, from cart) ── */
.upsell-card.pre-selected {
  border-color: #0d8a5e;
  background: var(--bmu-green-light);
}

.upsell-card.pre-selected .upsell-check {
  background: #0d8a5e;
  border-color: #0d8a5e;
}

.upsell-card.pre-selected .upsell-check svg {
  opacity: 1;
}


/* ── Checkbox ── */
.upsell-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  border: 2px solid var(--bmu-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  background: white;
}

.upsell-check svg {
  width: 12px;
  height: 12px;
  color: white;
  opacity: 0;
  transition: opacity 0.2s;
}

/* ── Icon ── */
.upsell-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 20px;
}

.upsell-icon img {
  max-width: 100%;
  max-height: 100%;
}

/* ── Body ── */
.upsell-body {
  flex: 1;
  min-width: 0;
}

.upsell-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--bmu-text);
  margin-bottom: 4px;
  line-height: 1.3;
  padding-right: 28px;
}

.upsell-desc {
  font-size: 12.5px;
  color: var(--bmu-text-secondary);
  line-height: 1.45;
  margin-bottom: 12px;
  flex: 1;
}

.upsell-price-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.upsell-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--bmu-text);
}

/* ── Pre-selected badge ── */
.pre-selected-badge {
  display: none;
  align-items: center;
  gap: 4px;
  background: #0d8a5e;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
  width: fit-content;
}

/* ── Express variant ── */
.upsell-card.express .upsell-icon {
  background: var(--bmu-express-bg);
  color: var(--bmu-express-orange);
}

.upsell-card.express .upsell-tag {
  display: inline-block;
  background: var(--bmu-express-bg);
  color: var(--bmu-express-orange);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

/* ── Gift wrap variant ── */
.upsell-card.giftwrap .upsell-icon {
  background: #fef0f5;
  color: #d4467a;
}

.preview-link {
  display: inline-block;
  margin-top: 4px;
  color: #0d8a5e;
  font-weight: 600;
  font-size: 12px;
  text-decoration: none;
  transition: color 0.15s;
}

.preview-link:hover {
  color: var(--bmu-green-hover);
  text-decoration: underline;
}

/* ── Greeting card variant ── */
.upsell-card.greeting .upsell-icon {
  background: #eef0ff;
  color: #5b63d3;
}

.greeting-expanded {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--bmu-border);
}

.upsell-card.greeting.active .greeting-expanded,
.upsell-card.greeting.pre-selected .greeting-expanded {
  display: block;
}

.greeting-textarea {
  width: 100%;
  min-height: 68px;
  border: 1px solid var(--bmu-border);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  color: var(--bmu-text);
  resize: vertical;
  transition: border-color 0.2s;
  line-height: 1.4;
  box-sizing: border-box;
}

.greeting-textarea:focus {
  outline: none;
  border-color: #0d8a5e;
  box-shadow: 0 0 0 3px rgba(13, 138, 94, 0.08);
}

.greeting-textarea::placeholder {
  color: #bbb;
}

.greeting-charcount {
  font-size: 11px;
  color: var(--bmu-text-muted);
  text-align: right;
  margin-top: 4px;
}

/* ── Preview Modal ── */
.preview-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: bmuFadeIn 0.2s ease;
}

.preview-overlay.open {
  display: flex;
}

.preview-modal {
  background: var(--bmu-white);
  border-radius: 14px;
  padding: 20px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  position: relative;
  animation: bmuScaleIn 0.25s ease;
}

.preview-modal img {
  width: 100%;
  border-radius: 8px;
  display: block;
}

.preview-modal-caption {
  text-align: center;
  margin-top: 14px;
  font-size: 14px;
  color: var(--bmu-text-secondary);
  line-height: 1.4;
}

.preview-modal-caption strong {
  color: var(--bmu-text);
}

.preview-close {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bmu-white);
  border: 1px solid var(--bmu-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  color: var(--bmu-text-secondary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.15s;
}

.preview-close:hover {
  background: #fee;
  color: #c00;
}

/* ── Upsell summary lines in cart totals ── */
.bm-upsell-summary-line {

  position: relative;
}
.cart-item{
  background-color: #fff;
}

#checkout .cart-detailed-totals{

	background: #fff;
	border: 2px solid #eee;
	border-radius: 5px;
	padding: 20px;
}
.cart-summary-line.bm-upsell-summary-line .label {
  color: #0d8a5e;
  font-weight: 600;
  font-size: 14px;
}

.cart-summary-line.bm-upsell-summary-line .value {
  color: #0d8a5e;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.bm-upsell-line-check {
  font-size: 11px;
  font-weight: 700;
}

.bm-upsell-line-remove {
	/* position: absolute; */
	/* right: -2px; */
	/* top: 50%; */
	/* transform: translateY(-50%); */
	font-size: 12px;
	/* line-height: 1; */
	color: var(--bmu-text-muted);
	text-decoration: none;
	cursor: pointer;
	transition: color 0.15s;
	margin-left: 4px;
}

.bm-upsell-line-remove:hover {
  color: #c00;
}

/* ── Animations ── */
@keyframes bmuFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes bmuScaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes bmuFadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.upsell-card {
  animation: bmuFadeInUp 0.4s ease forwards;
}

.upsell-card:nth-child(1) { animation-delay: 0.05s; }
.upsell-card:nth-child(2) { animation-delay: 0.12s; }
.upsell-card:nth-child(3) { animation-delay: 0.19s; }
.upsell-card:nth-child(4) { animation-delay: 0.26s; }
.upsell-card:nth-child(5) { animation-delay: 0.33s; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .upsell-section { margin-top: 14px; }
  .upsell-heading { font-size: 12px; margin-bottom: 8px; }
  .upsell-grid,
  .upsell-checkout-grid { grid-template-columns: 1fr; gap: 8px; }

  .upsell-checkout-section { margin-bottom: 12px; }
  .upsell-checkout-heading { font-size: 11px; margin-bottom: 8px; letter-spacing: 0.6px; }

  .upsell-card {
    flex-direction: row;
    align-items: center;
    padding: 12px;
    gap: 12px;
  }

  .upsell-card .upsell-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .upsell-card .upsell-icon svg {
    width: 18px;
    height: 18px;
  }

  .upsell-card .upsell-check {
    position: static;
    order: 3;
    flex-shrink: 0;
  }

  .upsell-body .upsell-title {
    font-size: 13px;
    padding-right: 0;
    margin-bottom: 1px;
  }

  .upsell-body .upsell-desc {
    font-size: 11px;
    margin-bottom: 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .upsell-body .upsell-price-row { margin-top: 2px; }

  .upsell-body .upsell-price {
    font-size: 12px;
    color: var(--bmu-text-secondary);
  }

  .upsell-card .upsell-tag {
    font-size: 9px;
    padding: 1px 5px;
    margin-bottom: 2px;
  }

  .pre-selected-badge {
    font-size: 9px;
    padding: 1px 6px;
    margin-bottom: 2px;
    display: none;
  }

  /* Greeting expanded needs full width */
  .upsell-card.greeting { flex-wrap: wrap; }

  .greeting-expanded {
    width: 100%;
    margin-top: 8px;
    padding-top: 8px;
  }

  .greeting-textarea {
    min-height: 50px;
    font-size: 12px;
    padding: 8px 10px;
  }

  .greeting-charcount { font-size: 10px; }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .upsell-grid,
  .upsell-checkout-grid {
    grid-template-columns: 1fr 1fr;
  }

  .upsell-grid .upsell-card:last-child,
  .upsell-checkout-grid .upsell-card:last-child {
    grid-column: 1 / -1;
  }
}

.shipping-bar-track {
	flex: 1;
	height: 6px;
	background: #eee;
	border-radius: 3px;
	overflow: hidden;
}
.shipping-bar {
	padding: 14px 24px;
	border-top: 1px solid var(--border);
	display: flex;
	align-items: center;
	gap: 10px;
}
.shipping-bar-fill {
	height: 100%;
	width: 58%;
	background: #34c98b;
	border-radius: 3px;
	transition: width 0.5s ease;
}
.cart-container .product-price{
  width: 100%;
}