:root {
  --cqo-navy: #101A22;
  --cqo-ink: #31505E;
  --cqo-blue: #0F5C7A;
  --cqo-red: #D8431F;
  --cqo-discount: #B02A38;
  --cqo-low-stock: #96690F;
  --cqo-line: #C7DFE7;
  --cqo-soft: #DEF1F7;
  --cqo-green: #0F5C7A;
}

.cqo-selector {
  position: relative;
  min-width: 0;
  margin: 20px 0;
  padding: 0;
  border: 0;
}

.cqo-selector legend {
  margin: 0 0 10px;
  color: var(--cqo-navy);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.cqo-dropdown-toggle {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  padding: 12px 15px;
  border: 1px solid #9EBAC4;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  color: var(--cqo-navy);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
  text-transform: none;
}

.cqo-dropdown-toggle:focus-visible,
.cqo-selector.is-open .cqo-dropdown-toggle {
  border-color: var(--cqo-navy);
  background: #fff;
  box-shadow: 0 0 0 1px var(--cqo-navy);
  color: var(--cqo-navy);
}

.cqo-dropdown-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cqo-dropdown-chevron {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-right: 2px solid currentcolor;
  border-bottom: 2px solid currentcolor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .16s ease;
}

.cqo-selector.is-open .cqo-dropdown-chevron {
  transform: translateY(3px) rotate(225deg);
}

.cqo-offer-list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  display: none;
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #A9BEC6;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(16, 26, 34, .16);
  scrollbar-color: #A9BEC6 transparent;
  scrollbar-width: thin;
}

.cqo-selector.is-open .cqo-offer-list {
  display: grid;
}

.cqo-offer {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 7px 9px;
  align-items: center;
  box-sizing: border-box;
  min-height: 66px;
  margin: 0;
  padding: 13px 12px;
  border: 1px solid var(--cqo-line);
  border-radius: 9px;
  background: #fff;
  box-shadow: none;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease;
}

.cqo-offer.is-highlighted {
  border-color: #31505E;
  background: #F8FBFC;
}

.cqo-offer.is-selected {
  border-color: var(--cqo-navy);
  background: #DEF1F7;
  box-shadow: inset 0 0 0 1px var(--cqo-navy);
}

.cqo-offer.is-disabled {
  opacity: .58;
  cursor: not-allowed;
}

.cqo-offer input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.cqo-radio {
  display: flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #31505E;
  border-radius: 50%;
  background: #fff;
}

.cqo-offer input:checked + .cqo-radio {
  border-color: var(--cqo-navy);
}

.cqo-offer input:checked + .cqo-radio::after {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cqo-navy);
  content: "";
}

.cqo-offer input:focus-visible + .cqo-radio {
  outline: 3px solid rgba(16, 26, 34, .2);
  outline-offset: 3px;
}

.cqo-offer-main {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 2px 7px;
  align-items: baseline;
}

.cqo-label {
  color: var(--cqo-navy);
  font-size: 14px;
  line-height: 1.3;
}

.cqo-units,
.cqo-unavailable {
  color: #31505E;
  font-size: 11px;
  line-height: 1.35;
}

.cqo-unavailable {
  flex-basis: 100%;
  color: #A93417;
}

.cqo-badge {
  position: static;
  align-self: center;
  padding: 4px 9px;
  border: 0;
  border-radius: 999px;
  background: var(--cqo-navy);
  box-shadow: 0 1px 4px rgba(16, 26, 34, .18);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .055em;
  line-height: 1;
  text-transform: uppercase;
}

.cqo-offer-price {
  display: block;
  white-space: nowrap;
}

.cqo-offer-price > strong {
  color: #0F5C7A;
  font-size: 17px;
  line-height: 1.1;
}

.cqo-saving {
  display: inline-flex;
  grid-column: 2 / -1;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  justify-self: start;
  margin-top: 2px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--cqo-discount);
  font-size: 11px;
  line-height: 1.2;
}

/* Keep the cart update action centered in the full-width action row. */
body.woocommerce-cart .woocommerce-cart-form tr:last-child,
body.woocommerce-cart .woocommerce-cart-form td.actions {
  width: 100%;
  text-align: center;
}

body.woocommerce-cart .woocommerce-cart-form button[name="update_cart"] {
  float: none !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin-right: auto !important;
  margin-left: auto !important;
}

.cqo-saving-label {
  padding: 4px 7px;
  border-radius: 4px;
  background: #FBEAEC;
  color: var(--cqo-discount);
  font-weight: 900;
}

.cqo-saving > strong {
  color: var(--cqo-discount);
  font-size: 13px;
}

.cqo-saving-percent {
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--cqo-discount);
  color: #fff;
  font-weight: 900;
}

.cqo-saving del {
  margin-left: 3px;
  color: #31505E;
  font-size: 11px;
}

.cqo-managed-quantity,
.product form.cart:has(.cqo-selector) > .quantity {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

.cqo-fixed-quantity {
  display: inline-flex;
  min-width: 32px;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--cqo-soft);
  color: var(--cqo-navy);
  font-weight: 800;
}

@media (max-width: 549px) {
  .cqo-offer {
    min-height: 60px;
    padding: 12px 11px;
  }

  .cqo-label {
    font-size: 13px;
  }

  .cqo-offer-price > strong {
    font-size: 16px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .cqo-dropdown-toggle:hover {
    border-color: var(--cqo-navy);
    background: #fff;
    box-shadow: 0 0 0 1px var(--cqo-navy);
    color: var(--cqo-navy);
  }

  .cqo-offer:hover {
    border-color: #31505E;
    background: #F8FBFC;
  }
}

@media (hover: none) {
  .cqo-offer:active {
    background: #DEF1F7;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cqo-dropdown-chevron {
    transition: none;
  }

  .cqo-offer {
    transition: none;
  }
}
