/* Double class for specificity — overrides any page-level overrides */
/* Default: product page — full width block */
.insurance-widget.insurance-widget {
  font-family: inherit;
  border: 2px solid #333;
  border-radius: 6px;
  background: #f2f2f2;
  width: 100%;
  max-width: 100%;
  margin-top: 15px;
  display: block;
  position: relative;
  box-sizing: border-box;
}

/* Product page context — match button width and alignment */
.cart-insurance-widget .insurance-widget.insurance-widget {
  width: 269px;
  margin: 13px 0 0 auto;
  clear: both;
  height: 50px;
  border: none;
  background: none;
  padding: 0;
}

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

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

/* Cart context — fixed width same as product page */
.product-item-details .cart-insurance-widget .insurance-widget.insurance-widget {
  width: 269px;
  margin-left: 0;
}

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

/* Hide accordion elements */
.cart-insurance-widget .insurance-widget__options {
  display: none !important;
}

.cart-insurance-widget .insurance-widget__arrow {
  display: none !important;
}

/* Trigger button — yellow badge LEFT, text RIGHT */
.cart-insurance-widget .insurance-widget.insurance-widget .insurance-widget__header {
  display: inline-flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border: 1.5px solid #333;
  border-radius: 6px;
  background: #f2f2f2;
  cursor: pointer;
  height: 100%;
  transition: border-color 0.2s;
  box-shadow: none;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.cart-insurance-widget .insurance-widget.insurance-widget .insurance-widget__header:hover {
  border-color: #000;
}

/* Badge — yellow left block (star icon comes from JS only, no ::before) */
.cart-insurance-widget .insurance-widget__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: #FFCB05;
  color: #000;
  font-size: 9px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1;
  flex: 1;
  transition: background 0.2s;
}

.cart-insurance-widget .insurance-widget__header:hover .insurance-widget__badge {
  background: #e6b800;
}

.cart-insurance-widget .insurance-widget__header:hover {
  border-color: #ffcb05 !important;
}

/* Inner row */
.cart-insurance-widget .insurance-widget__header-left {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  flex: 1;
}

/* Title text */
.cart-insurance-widget .insurance-widget__title {
  color: #2c2c2c;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
}

/* — SELECTED STATE — */

/* Hide badge when selection is made */
.cart-insurance-widget .insurance-widget.has-selection .insurance-widget__badge {
  display: none;
}

/* Full rounded corners when badge is gone — keep card style (border + bg stay) */
.cart-insurance-widget .insurance-widget.has-selection .insurance-widget__header {
  border-radius: 6px !important;
  overflow: hidden;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Yellow underline slides in on hover — no layout shift */
.cart-insurance-widget .insurance-widget.has-selection .insurance-widget__header::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);
}

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

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

/* Shield icon — hidden by default, shown after selection */
.cart-insurance-widget .insurance-widget__header-shield {
  display: none;
  flex-shrink: 0;
  color: #FFCB05;
  font-size: 20px;
  margin-right: 6px;
}

.cart-insurance-widget .insurance-widget.has-selection .insurance-widget__header-shield {
  display: inline-block;
}

/* Bold plan name */
.cart-insurance-widget .insurance-widget__title strong {
  font-weight: 600;
}

/* Clear × button */
.cart-insurance-widget .insurance-widget__clear {
  display: none;
}

.cart-insurance-widget .insurance-widget.has-selection .insurance-widget__clear {
  display: flex;
  width: 20px;
  height: 20px;
  background: transparent;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: #888;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.cart-insurance-widget .insurance-widget.has-selection .insurance-widget__clear:hover {
  background: #ffcb05;
  border-color: #ffcb05;
  color: #333;
}

/* Options — hidden when closed, merged with header when open */
.insurance-widget.insurance-widget .insurance-widget__options {
  background: #f2f2f2;
  border: none;
  border-radius: 0 0 6px 6px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.insurance-widget.is-open.insurance-widget .insurance-widget__options {
  max-height: 400px;
}

/* Header - clickable accordion trigger */
/* Double class for specificity — overrides page inline styles */
.insurance-widget.insurance-widget .insurance-widget__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 10px;
  height: 24px;
  cursor: pointer;
  user-select: none;
  border: none;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.insurance-widget.is-open.insurance-widget .insurance-widget__header {
  border-bottom: 2px solid #333;
}

.insurance-widget.insurance-widget .insurance-widget__header:hover {
  background: transparent;
}

/* Shield icon in header - only visible when selection is made */
.insurance-widget__header-shield {
  display: none;
  flex-shrink: 0;
}

.insurance-widget.has-selection .insurance-widget__header-shield {
  display: block;
}

.insurance-widget__header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-grow: 1;
  min-width: 0;
}

.insurance-widget .insurance-widget__header .insurance-widget__title {
  font-size: 14px;
  font-family: "Inter-Regular", sans-serif;
  font-weight: 400;
  color: #333;
}

/* Clear button - only visible when something is selected */
.insurance-widget__clear {
  display: none;
  background: transparent;
  border: 1.5px solid #333;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  color: #333;
  width: 20px;
  height: 20px;
  padding: 0;
  flex-shrink: 0;
  transition: all .5s;
}

.insurance-widget__clear:hover {
  background: #e6b800;
  border-color: #ffcb05;
}

.insurance-widget.has-selection .insurance-widget__clear {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Chevron arrow SVG */
.insurance-widget__arrow {
  display: block;
  flex-shrink: 0;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px;
  min-height: 20px;
  transition: transform 0.25s;
}

.insurance-widget.is-open .insurance-widget__arrow {
  transform: rotate(180deg);
}

/* Single option row */
.insurance-widget__option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 2px solid #333;
  transition: background 0.15s;
}

.insurance-widget__option:last-child {
  border-bottom: none;
}

.insurance-widget__option:hover {
  background: #fafafa;
}

.insurance-widget__option.is-selected {
  background: #fffbe6;
}

/* Radio = shield with check */
.insurance-widget__radio {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 1px;
}

.insurance-widget__radio svg {
  width: 24px;
  height: 24px;
}

/* Unselected: grey outline shield */
.insurance-widget__radio .shield-empty {
  display: block;
}

.insurance-widget__radio .shield-checked {
  display: none;
}

/* Selected: yellow filled shield with check */
.insurance-widget__option.is-selected .shield-empty {
  display: none;
}

.insurance-widget__option.is-selected .shield-checked {
  display: block;
}

/* Option text content */
.insurance-widget__option-content {
  flex-grow: 1;
  min-width: 0;
}

.insurance-widget__option-name {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}

.insurance-widget__option-duration {
  font-size: 12px;
  font-weight: 400;
  color: #333;
  margin-left: 4px;
}

.insurance-widget__option-desc {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
  line-height: 1.4;
}

/* Price on the right */
.insurance-widget__option-price {
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
}

.insurance-widget__price-value {
  font-size: 15px;
  font-weight: 700;
  color: #333;
}

.insurance-widget__price-currency {
  font-size: 12px;
  font-weight: 600;
  color: #333;
}

.insurance-widget__price-period {
  font-size: 11px;
  color: #888;
  display: block;
  text-align: right;
}

