/* ── KORPA 4: Option 4 — Plan selector ── */

/* 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: selector fills the 50px height */
.cart-insurance-widget .walmart-plan-selector {
  height: 100%;
}

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

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

.product-item-details .cart-insurance-widget .walmart-plan-selector {
  min-width: 280px;
}

/* ── TRIGGER ── */

.walmart-plan-selector {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 10px 16px;
  border: 1.5px solid #e0e0e0;
  border-radius: 6px;
  background: #f2f2f2;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Open Sans", Roboto, sans-serif;
  box-sizing: border-box;
  user-select: none;
  gap: 16px;
  width: 100%;
}

.walmart-plan-selector:hover {
  border-color: #FFCB05;
}

.walmart-plan-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
}

.walmart-plan-badge {
  font-size: 18px;
  color: #FFCB05;
  line-height: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.badge-star {
  display: inline;
}

.badge-shield {
  display: none;
}

.walmart-plan-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  min-width: 0;
  overflow: hidden;
}

.walmart-plan-title {
  font-size: 14px;
  color: #2c2c2c;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.walmart-plan-sub {
  font-size: 12px;
  color: #666;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.walmart-plan-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.walmart-plan-cta {
  font-size: 13px;
  color: #2c2c2c;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.walmart-plan-selector:hover:not(:has(.walmart-clear:hover)) .walmart-plan-cta {
  text-decoration-color: #FFCB05;
  text-decoration-thickness: 3px;
}

/* Clear button — collapsed until selected */
.walmart-clear {
  display: flex;
  width: 0;
  height: 24px;
  overflow: hidden;
  background: transparent;
  border: none;
  border-radius: 4px;
  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 .walmart-plan-selector {
  border-color: #FFCB05;
  position: relative;
}

/* Yellow underline slides in on hover — only when selected */
.insurance-widget.has-selection .walmart-plan-selector::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 .walmart-plan-selector:hover {
  border-color: #e0e0e0 !important;
}

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

.insurance-widget.has-selection .badge-star {
  display: none;
}

.insurance-widget.has-selection .badge-shield {
  display: inline;
}

.insurance-widget.has-selection .walmart-plan-cta {
  color: #666;
  font-weight: 400;
}

.insurance-widget.has-selection .walmart-plan-selector:hover:not(:has(.walmart-clear:hover)) .walmart-plan-cta {
  text-decoration-color: #FFCB05;
  text-decoration-thickness: 3px;
  color: #444;
}

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

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