/* ============================================================
   Storage Configure Product (#243, #244, #255, #266).
   Since #266 the page looks like the Hosting and VPS Configure Product
   pages: the same container, full-width title card, 18px section cards
   (shared cp-configure.css), centred billing tiles with a formatted
   price, blue help banner with a right-aligned link, Hosting-style Order
   Summary and a Continue button below the summary card. The skin is the
   Hosting Configure skin (cloudpedia_hosting_cart_configure.css) with the
   scope renamed to #order-standard_cart.cpsf; the Parent (cloudx_cart.css)
   loads on this stage again, exactly as on Hosting, so the Parent's own
   summary row and total styling applies and the rules below only refine it.

   Storage-specific parts that stay (#244 accessibility / responsive):
   keyboard-reachable billing radios with a focus ring, a visible focus
   ring on every control, readable validation errors, a visible loader
   overlay, a summary that is sticky below the portal header (pure CSS: the
   native standard_cart/js/scripts.js affix early-returns when
   #scrollingPanelContainer has float:none) and long unbroken values that
   wrap instead of widening a card.

   Sticky header measurements (#244):
     viewport >= 768px -> 83px tall
     viewport <= 767px -> 69px tall
   The offset is enabled only when header#header-top-sticky exists (with
   body.sticky-header-body as a no-:has() fallback) and defaults to zero.

   Specificity: the Parent answers with up to 5 IDs (Continue) and two IDs
   (#frmConfigureProduct boxes), so those overrides carry the same ID
   chain as the Hosting skin. No important-flag escape hatches. The few
   neutral greys the Hosting skin uses are scoped --cpsf-* properties
   (palette-contract definitions are exempt from the literal scan,
   ADR-0011); every other colour is a Palette token.
   ============================================================ */
#order-standard_cart.cpsf {
  --cpsf-line: #E5E7EB;
  --cpsf-line-field: #E4E8EF;
  --cpsf-line-hover: #C7D2E4;
  --cpsf-error-bg: #FEF2F2;
  --cpsf-error-border: #FCA5A5;
  --cpsf-error-text: #991B1B;
  /* Measured sticky header height, and the offset the summary uses.
     0px is the correct default for a non-sticky portal header. */
  --cpsf-header-h: 83px;
  --cpsf-sticky-top: 0px;
  background: var(--cp-surface);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--cp-gray-900);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0 auto;
  max-width: 1360px;
  padding: 22px 24px 40px;
  width: 100%;
}

@media (max-width: 767px) {
  #order-standard_cart.cpsf {
    --cpsf-header-h: 69px;
  }
}

/* Only when the admin enabled the sticky header does the summary need to
   clear it. header.tpl emits id="header-top-sticky" on the <header> AND
   class "sticky-header-body" on <body> under the same
   $cloudx_theme_settings.enable_sticky_header eq 'on' flag, and both live
   inside .cp-page-wrapper (a class, there is no #cp-page-wrapper id). The
   :has() gate is the precise one; the body-class gate covers browsers
   without :has(). When the header is off neither matches and the offset
   falls back to 0. */
.cp-page-wrapper:has(#header-top-sticky) #order-standard_cart.cpsf,
body.sticky-header-body #order-standard_cart.cpsf {
  --cpsf-sticky-top: calc(var(--cpsf-header-h) + 12px);
}

/* Full-bleed canvas behind the Parent box (same :has() device the catalog
   uses): no Parent body background peeks around the cards. */
#main-body.body-background-cloudx.in_shopping_cart:has(#order-standard_cart.cpsf) {
  background-color: var(--cp-surface);
}

/* Full-width content: drop the in-content category sidebar column. It is
   empty on the storage group, but the Parent still reserves 25% for it
   and floats .cart-body to 75%. The guest currency <form> lives in
   .sidebar-collapsed, not here. */
#order-standard_cart.cpsf .cart-sidebar {
  display: none;
}
#order-standard_cart.cpsf .cart-body {
  float: none;
  margin: 0;
  padding: 0;
  width: 100%;
}
/* Duplicate in-content category panels hidden (the global order menu
   already carries category navigation). The currency <form> is a sibling
   of those panels, so it survives for guest buyers below 1200px. */
#order-standard_cart.cpsf .sidebar-collapsed > .panel {
  display: none;
}

/* Title card: full width, aligned with the two columns below it. */
#order-standard_cart.cpsf .cpsf-title-card {
  background: var(--cp-surface);
  border: 1px solid var(--cpsf-line);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
  margin: 0 0 18px;
  min-width: 0;
  padding: 22px 24px;
}
#order-standard_cart.cpsf .cpsf-title {
  color: var(--cp-gray-900);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0;
}
#order-standard_cart.cpsf .cpsf-subtitle {
  color: var(--cp-gray-600);
  font-size: 15px;
  margin: 4px 0 0;
}

/* Two-column layout: main 2fr + summary 1fr. */
#order-standard_cart.cpsf .cpsf-layout {
  align-items: stretch;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  margin: 0;
}
#order-standard_cart.cpsf .cpsf-layout::before,
#order-standard_cart.cpsf .cpsf-layout::after {
  display: none;
}
#order-standard_cart.cpsf .cpsf-fields,
#order-standard_cart.cpsf #scrollingPanelContainer {
  float: none;
  margin: 0;
  min-width: 0;
  padding: 0;
  width: auto;
}
/* Sticky summary (#244): float:none keeps the native scroll affix parked. */
#order-standard_cart.cpsf #orderSummary {
  margin-top: 0;
  position: sticky;
  top: var(--cpsf-sticky-top);
}

/* Section cards (border, radius, shadow, margin, 18px card titles) live in
   the shared templates/cloudpedia/assets/css/cp-configure.css. The Product
   description stays in .product-info so the Parent's feature-list rules
   (check icons) keep matching. */
#order-standard_cart.cpsf #frmConfigureProduct .cpsf-product .product-info {
  color: var(--cp-gray-600);
  font-size: 14px;
}
#order-standard_cart.cpsf #frmConfigureProduct .product-info p {
  color: var(--cp-gray-600);
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
#order-standard_cart.cpsf #frmConfigureProduct .product-info p + p {
  margin-top: 3px;
}

/* Billing-cycle tiles: restyle the native li. The label wraps the native
   radio, which stays real, focusable and invisible (opacity 0, covering
   the tile) so Tab, arrows and Space work (#244). */
#order-standard_cart.cpsf ul.selectBillingCycleCloudCart {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}
#order-standard_cart.cpsf ul.selectBillingCycleCloudCart li {
  align-items: center;
  background: var(--cp-surface);
  border: 1px solid var(--cpsf-line-field);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
  min-height: 64px;
  padding: 10px 12px;
  position: relative;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
#order-standard_cart.cpsf ul.selectBillingCycleCloudCart li:hover {
  border-color: var(--cpsf-line-hover);
}
#order-standard_cart.cpsf ul.selectBillingCycleCloudCart li.active {
  background: var(--cp-primary-50);
  border-color: var(--cp-primary-300);
  box-shadow: 0 0 0 1px var(--cp-primary-300);
}
#order-standard_cart.cpsf ul.selectBillingCycleCloudCart .cpsf-cycle-tile {
  align-items: center;
  color: var(--cp-gray-900);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  font-weight: 400;
  gap: 2px;
  justify-content: center;
  margin: 0;
  width: 100%;
}
#order-standard_cart.cpsf ul.selectBillingCycleCloudCart input[type="radio"] {
  cursor: pointer;
  height: 100%;
  left: 0;
  margin: 0;
  opacity: 0;
  position: absolute;
  top: 0;
  width: 100%;
}
#order-standard_cart.cpsf ul.selectBillingCycleCloudCart li:focus-within {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
  outline: none;
}
#order-standard_cart.cpsf ul.selectBillingCycleCloudCart strong {
  color: var(--cp-gray-900);
  font-size: 15px;
  font-weight: 600;
}
#order-standard_cart.cpsf ul.selectBillingCycleCloudCart li.active strong {
  color: var(--cp-primary-500);
}
#order-standard_cart.cpsf ul.selectBillingCycleCloudCart span {
  color: var(--cp-gray-600);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
/* The Parent floats and sizes the tiles; neutralise it, let text wrap. */
#order-standard_cart.cpsf #frmConfigureProduct ul.selectBillingCycleCloudCart li {
  float: none;
  margin: 0;
  max-width: none;
  min-width: 0;
  width: auto;
}
#order-standard_cart.cpsf #frmConfigureProduct ul.selectBillingCycleCloudCart li strong,
#order-standard_cart.cpsf #frmConfigureProduct ul.selectBillingCycleCloudCart li span {
  max-width: 100%;
  overflow-wrap: break-word;
}

/* Form controls: Bucket Name, selects, quantity. */
#order-standard_cart.cpsf .form-group {
  margin-bottom: 0;
}
#order-standard_cart.cpsf .form-group label {
  color: var(--cp-gray-900);
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
#order-standard_cart.cpsf .form-control {
  background: var(--cp-surface);
  border: 1px solid var(--cpsf-line-field);
  border-radius: 6px;
  box-shadow: none;
  color: var(--cp-gray-900);
  font-size: 15px;
  height: 40px;
  max-width: 100%;
}
#order-standard_cart.cpsf .form-control:hover {
  border-color: var(--cpsf-line-hover);
}
#order-standard_cart.cpsf .form-control:focus {
  border-color: var(--cp-primary-500);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
  outline: none;
}
#order-standard_cart.cpsf select.form-control {
  background-color: var(--cp-primary-50);
  cursor: pointer;
  max-width: 340px;
}
#order-standard_cart.cpsf .field-help-text {
  color: var(--cp-gray-600);
  font-size: 13px;
}
#order-standard_cart.cpsf .cpsf-form-note {
  color: var(--cp-gray-600);
  font-size: 13px;
  margin: 0 0 12px;
}
#order-standard_cart.cpsf #frmConfigureProduct .product-configurable-options .row,
#order-standard_cart.cpsf #frmConfigureProduct .field-container .row {
  margin: 0;
}

/* Long, unbroken values (product names, currency-formatted prices, bucket
   names, addon descriptions) wrap instead of widening a card (#244).
   break-word only breaks tokens that would overflow. */
#order-standard_cart.cpsf .cpcf-card,
#order-standard_cart.cpsf #orderSummary .summary-container {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Validation errors: the Parent injects the server's <li> markup and only
   toggles `display` on the container. Legibility and contrast only (#244). */
#order-standard_cart.cpsf #containerProductValidationErrors {
  background: var(--cpsf-error-bg);
  border: 1px solid var(--cpsf-error-border);
  border-left-width: 4px;
  border-radius: 8px;
  color: var(--cpsf-error-text);
  font-size: 13px;
  margin-bottom: 20px;
  padding: 12px 16px;
}
#order-standard_cart.cpsf #containerProductValidationErrors p {
  font-weight: 600;
  margin: 0 0 6px;
}
/* The theme's global reset strips list markers. */
#order-standard_cart.cpsf #containerProductValidationErrors ul {
  list-style: disc;
  margin: 0;
  padding-left: 20px;
}
#order-standard_cart.cpsf #containerProductValidationErrors li + li {
  margin-top: 2px;
}

/* Visible keyboard focus on every control (#244). */
#order-standard_cart.cpsf :focus-visible {
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
  outline: 2px solid var(--cp-primary-500);
  outline-offset: 2px;
}

/* Help banner: blue, native contact link kept, link right-aligned. */
#order-standard_cart.cpsf .alert-warning.info-text-sm {
  align-items: center;
  background: var(--cp-primary-50);
  border: 0;
  border-left: 3px solid var(--cp-primary-500);
  border-radius: 12px;
  color: var(--cp-gray-900);
  display: flex;
  font-size: 14px;
  gap: 10px;
  justify-content: space-between;
  margin: 0 0 20px;
  padding: 14px 18px;
}
#order-standard_cart.cpsf .alert-warning.info-text-sm > span {
  flex: 1 1 auto;
  min-width: 0;
}
#order-standard_cart.cpsf .alert-warning.info-text-sm .alert-link {
  background: var(--cp-primary-500);
  border-radius: 4px;
  color: #FFFFFF;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  text-decoration: none;
  white-space: nowrap;
}
#order-standard_cart.cpsf .alert-warning.info-text-sm .alert-link:hover {
  background: var(--cp-primary-600);
  text-decoration: none;
}

/* Order Summary card + dynamic totals container. */
#order-standard_cart.cpsf #orderSummary .order-summary {
  background: var(--cp-surface);
  border: 1px solid var(--cpsf-line);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
  padding: 20px 22px;
  position: relative;
}
#order-standard_cart.cpsf #orderSummary .order-summary h2 {
  color: var(--cp-gray-900);
  font-size: 21px;
  font-weight: 700;
  margin: 0 0 8px;
}
#order-standard_cart.cpsf #orderSummary .summary-container {
  color: var(--cp-gray-600);
  font-size: 13.5px;
}
#order-standard_cart.cpsf #orderSummary .summary-container [class*="total"],
#order-standard_cart.cpsf #orderSummary .summary-container strong {
  color: var(--cp-gray-900);
  font-variant-numeric: tabular-nums;
}
/* Loading state (#244): the Parent collapses the spinner to zero height,
   so recalculation showed nothing. Overlaid on the card corner so showing
   it never reflows the totals. */
#order-standard_cart.cpsf #orderSummaryLoader {
  background: var(--cp-surface);
  border: 1px solid var(--cpsf-line);
  border-radius: 8px;
  color: var(--cp-primary-500);
  font-size: 18px;
  height: auto;
  line-height: 1;
  padding: 6px 8px;
  position: absolute;
  right: 12px;
  text-align: center;
  top: 12px;
}

/* Continue sits below the summary card at normal size. */
#order-standard_cart.cpsf #btnCompleteProductConfig {
  align-items: center;
  background: var(--cp-primary-500);
  border: 1px solid var(--cp-primary-500);
  border-radius: 6px;
  display: inline-flex;
  font-size: 15px;
  font-weight: 600;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
  min-height: 44px;
  width: 100%;
}
#order-standard_cart.cpsf #btnCompleteProductConfig:active {
  transform: translateY(1px);
}

/* The Parent answers Continue, the summary box and the summary rows with
   up to 5 IDs (pink #FC5185 Continue, 35%-capped amounts), so the Child
   out-specifies with the same ID chain as Hosting. */
#order-standard_cart.cpsf #frmConfigureProduct #scrollingPanelContainer #orderSummary button#btnCompleteProductConfig {
  background-color: var(--cp-primary-500);
  border-color: var(--cp-primary-500);
  border-radius: 6px;
  color: #FFFFFF;
}
#order-standard_cart.cpsf #frmConfigureProduct #scrollingPanelContainer #orderSummary button#btnCompleteProductConfig:hover,
#order-standard_cart.cpsf #frmConfigureProduct #scrollingPanelContainer #orderSummary button#btnCompleteProductConfig:focus {
  background-color: var(--cp-primary-600);
  border-color: var(--cp-primary-600);
  color: #FFFFFF;
}
#order-standard_cart.cpsf #frmConfigureProduct #scrollingPanelContainer div#orderSummary {
  background: transparent;
  box-shadow: none;
  padding: 0;
}
/* Rows: label left, amount right. A long amount drops under its label
   rather than widen the column (#244). */
#order-standard_cart.cpsf #frmConfigureProduct #scrollingPanelContainer .order-summary .clearfix {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
}
#order-standard_cart.cpsf #frmConfigureProduct #scrollingPanelContainer div#orderSummary .order-summary .summary-container span.pull-left.float-left {
  flex: 1 1 auto;
  margin: 0;
  max-width: none;
  min-width: 0;
  width: auto;
}
#order-standard_cart.cpsf #frmConfigureProduct #scrollingPanelContainer div#orderSummary .order-summary .summary-container span.pull-right.float-right {
  flex: 0 1 auto;
  margin-left: auto;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
  white-space: normal;
  width: auto;
}

/* Parent accents the Hosting skin has to touch too (addons, ranged
   quantity sliders, iCheck radios and checkboxes). Two IDs plus classes
   beat the Parent's two-ID selector. */
#order-standard_cart.cpsf #frmConfigureProduct .product-info ul li b,
#order-standard_cart.cpsf #frmConfigureProduct .addon-products .panel-price {
  color: var(--cp-gray-900);
}
#order-standard_cart.cpsf #frmConfigureProduct .addon-products .panel-addon .panel-add {
  background-color: var(--cp-primary-500);
  border-color: var(--cp-primary-500);
  border-radius: 6px;
}
#order-standard_cart.cpsf #frmConfigureProduct .addon-promo-container .description p a {
  color: var(--cp-primary-500);
}
/* ion.rangeSlider (quantity options): the Parent tints the tooltips pink. */
#order-standard_cart.cpsf .irs-from,
#order-standard_cart.cpsf .irs-to,
#order-standard_cart.cpsf .irs-single,
#order-standard_cart.cpsf .irs-bar,
#order-standard_cart.cpsf .irs-bar-edge {
  background: var(--cp-primary-500);
}
#order-standard_cart.cpsf .irs-from::after,
#order-standard_cart.cpsf .irs-to::after,
#order-standard_cart.cpsf .irs-single::after {
  border-top-color: var(--cp-primary-500);
}
/* iCheck: kill the hue-rotated sprite (purple) and draw the control from
   tokens. State lives on the wrapper (.checked), never on the input. */
#order-standard_cart.cpsf .iradio_square-blue,
#order-standard_cart.cpsf .icheckbox_square-blue {
  background-color: var(--cp-surface);
  background-image: none;
  border: 2px solid var(--cp-gray-600);
  box-sizing: border-box;
  filter: none;
  height: 18px;
  position: relative;
  vertical-align: middle;
  width: 18px;
}
#order-standard_cart.cpsf .iradio_square-blue {
  border-radius: 50%;
}
#order-standard_cart.cpsf .icheckbox_square-blue {
  border-radius: 4px;
}
#order-standard_cart.cpsf .iradio_square-blue.hover,
#order-standard_cart.cpsf .icheckbox_square-blue.hover {
  border-color: var(--cp-primary-300);
}
#order-standard_cart.cpsf .iradio_square-blue.checked,
#order-standard_cart.cpsf .icheckbox_square-blue.checked {
  border-color: var(--cp-primary-500);
}
#order-standard_cart.cpsf .iradio_square-blue.checked::after {
  background: var(--cp-primary-500);
  border-radius: 50%;
  content: "";
  inset: 2px;
  position: absolute;
}
#order-standard_cart.cpsf .icheckbox_square-blue.checked::after {
  border-bottom: 2px solid var(--cp-primary-500);
  border-right: 2px solid var(--cp-primary-500);
  content: "";
  height: 8px;
  left: 4px;
  position: absolute;
  top: 0;
  transform: rotate(45deg);
  width: 4px;
}

/* Narrow viewports: stack the summary below the fields, no stickiness. */
@media (max-width: 880px) {
  #order-standard_cart.cpsf .cpsf-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  #order-standard_cart.cpsf #orderSummary {
    position: static;
  }
}
@media (max-width: 640px) {
  #order-standard_cart.cpsf {
    padding: 16px 14px 32px;
  }
  #order-standard_cart.cpsf .cpsf-title {
    font-size: 26px;
  }
  #order-standard_cart.cpsf ul.selectBillingCycleCloudCart {
    grid-template-columns: minmax(0, 1fr);
  }
  #order-standard_cart.cpsf select.form-control {
    max-width: none;
  }
  #order-standard_cart.cpsf .alert-warning.info-text-sm {
    align-items: stretch;
    flex-direction: column;
  }
  #order-standard_cart.cpsf .alert-warning.info-text-sm .alert-link {
    align-self: flex-start;
  }
}
@media (prefers-reduced-motion: reduce) {
  #order-standard_cart.cpsf ul.selectBillingCycleCloudCart li,
  #order-standard_cart.cpsf #btnCompleteProductConfig {
    transition: none;
  }
}
