/* ── KORPA 3: Option 3 — Yellow CTA button ── */

/* Product page context — full width */
.cart-insurance-widget .insurance-widget.insurance-widget {
  width: 100%;
  margin: 13px 0 0 0;
  clear: both;
  height: 50px;
}

/* Product page: CTA fills the 50px height */
.cart-insurance-widget .insurance-widget.insurance-widget .insurance-cta {
  height: 100%;
}

@media only screen and (max-width: 768px) {
  .cart-insurance-widget .insurance-widget.insurance-widget {
    width: 100%;
  }
}

/* Cart page context - override product page 100% width */
.cart.item .cart-insurance-widget .insurance-widget.insurance-widget {
  width: auto;
}

@media only screen and (max-width: 768px) {
  .cart.item .cart-insurance-widget .insurance-widget.insurance-widget {
    max-width: 100%;
  }

  .cart.item .cart-insurance-widget .cta-content {
    padding: 0 8px;
    min-width: 0;
    flex: 1 1 0;
    overflow: hidden;
  }

  .cart.item .cart-insurance-widget .insurance-widget.has-selection .cta-label,
  .cart.item .cart-insurance-widget .insurance-widget.has-selection .cta-badge {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
  }

  .cart.item .cart-insurance-widget .cta-button {
    width: 56px;
  }
}

/* Cart context container in cart items */
.product-item-details .cart-insurance-widget .insurance-widget.insurance-widget {
  border: none;
  background: none;
  margin: 6px 0 0 0;
  padding: 0;
}

.product-item-details .cart-insurance-widget .insurance-cta {
  height: 40px;
}

/* ── TRIGGER ── */

.insurance-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 40px;
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid #e0e0e0;
  border-radius: 6px;
  background: #f2f2f2;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Open Sans", Roboto, sans-serif;
  overflow: hidden;
  user-select: none;
}

.insurance-cta:hover {
  border-color: #FFCB05;
}

.cta-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 12px;
  align-items: flex-start;
  justify-content: center;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.cta-label {
  font-size: 13px;
  color: #2c2c2c;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.cta-badge {
  font-size: 10px;
  color: #999;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.cta-right {
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  height: 100%;
}

.cta-button {
  background: #FFCB05;
  color: #000;
  font-size: 13px;
  font-weight: 600;
  width: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  height: 100%;
}

.insurance-cta:hover:not(:has(.cta-clear:hover)) .cta-button {
  background: #FFD633;
}

/* Clear button — collapsed until selected */
.cta-clear {
  display: flex;
  width: 0;
  overflow: hidden;
  background: transparent;
  border-left: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: transparent;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

/* ── SELECTED STATE ── */

.insurance-widget.has-selection .insurance-cta {
  border-color: #FFCB05;
  position: relative;
}

/* Yellow underline slides in on hover — only when selected */
.insurance-widget.has-selection .insurance-cta::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #FFCB05;
  transform: scaleX(0);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.insurance-widget.has-selection .insurance-cta:hover {
  border-color: #e0e0e0 !important;
}

.insurance-widget.has-selection .insurance-cta:hover::after {
  transform: scaleX(1);
}

.insurance-widget.has-selection .cta-button {
  background: #f2f2f2;
  color: #333;
}

.insurance-widget.has-selection .insurance-cta:hover:not(:has(.cta-clear:hover)) .cta-button {
  background: #e8e8e8;
}

.insurance-widget.has-selection .cta-clear {
  width: 32px;
  overflow: visible;
  background: #e8e8e8;
  border-left: 1px solid #ccc;
  color: #888;
}

.insurance-widget.has-selection .cta-clear:hover {
  background: #FFCB05;
  border-left-color: #FFCB05;
  color: #333;
}
