/**
 * @file
 * Styling for the "Calculate Your Fundraiser Profit" popup
 * (product_display profit calculator).
 */
.bfri-profit-calc {
  font-family: inherit;
}

.bfri-package-info {
  display: flex;
  align-items: center;
  gap: 10px;
  /* background: #eef5fb;
  border-radius: 6px;
  padding: 10px 12px; */
  margin-bottom: 14px;
}

.bfri-package-icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  /* background: #cfe3f5; */
  display: inline-block;
  position: relative;
  border-radius: 5px;
  background: #E1F9FF;
}

.bfri-package-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  background-image: url('../image/case-icon.png');
  width: 25px;
  height: 25px;
}

.bfri-package-text {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  line-height: 1.4;
}

.bfri-package-text strong {
  font-size: 13px;
}

.bfri-package-text span {
  color: #5a6a75;
  font-size: 12px;
}

.bfri-profit-calc .form-item label {
  font-weight: 600;
  font-size: 13px;
}

/* Two columns sharing rows (label / helper / stepper / error), so both
   steppers stay level when a helper line wraps or an error shows. */
.bfri-fields-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
  margin-bottom: 4px;
}

.bfri-fields-row .bfri-field-col {
  display: contents;
}

.bfri-fields-row .bfri-field-col:first-child > * {
  grid-column: 1;
}

.bfri-fields-row .bfri-field-col:last-child > * {
  grid-column: 2;
}

.bfri-fields-row .bfri-field-head {
  grid-row: 1;
}

.bfri-fields-row .bfri-field-help {
  grid-row: 2;
}

.bfri-fields-row .bfri-stepper {
  grid-row: 3;
}

.bfri-fields-row .form-item--error-message,
.bfri-fields-row .bfri-field-col > strong.error {
  grid-row: 4;
}

.bfri-fields-row .bfri-field-col .form-item {
  margin: 0;
}

.bfri-fields-row .bfri-field-col .mb-3 {
  margin-bottom: 0 !important;
}

.bfri-field-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}

/* "Required" indicator: red, regular weight. */
.bfri-required-mark {
  color: #d41717;
  font-weight: normal;
}

/* Label + info tooltip row for Group Size / Goal Per Seller (Figma). */
.bfri-field-head {
  display: flex;
  align-items: center;
  gap: 5px;
}

.bfri-field-head .bfri-field-label {
  margin-bottom: 0;
  font-weight: 700;
  font-size: 14px;
  color: #464443;
}

/* Helper line under the label, e.g. "Number of Participants". */
.bfri-field-help {
  display: block;
  font-size: 13px;
  line-height: 21.43px;
  color: #464443;
  opacity: 0.3;
  margin-bottom: 4px;
}

/* Info icon; its description shows in .bfri-tooltip-content on hover
   or keyboard focus (same look as the theme's .tooltip-main tooltips). */
.bfri-tooltip {
  position: relative;
  display: inline-flex;
}

.bfri-info-icon {
  display: inline-flex;
  padding: 0;
  border: 0;
  background: none;
  line-height: 0;
  cursor: help;
}

.bfri-info-icon img {
  display: block;
}

.bfri-tooltip-content {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: max-content;
  max-width: 220px;
  padding: 6px 10px;
  background-color: #f38c0d;
  color: #fff;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  text-align: center;
  transition: opacity 0.15s ease;
}

.bfri-tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid #f38c0d;
}

/* Keep the tooltip inside the calculator: open towards the centre. */
.bfri-field-col:first-child .bfri-tooltip-content {
  left: -12px;
  transform: none;
}

.bfri-field-col:first-child .bfri-tooltip-content::after {
  left: 20px;
}

.bfri-field-col:last-child .bfri-tooltip-content {
  left: auto;
  right: -12px;
  transform: none;
}

.bfri-field-col:last-child .bfri-tooltip-content::after {
  left: auto;
  right: 15px;
  transform: none;
}

.bfri-tooltip:hover .bfri-tooltip-content,
.bfri-tooltip:focus-within .bfri-tooltip-content {
  visibility: visible;
  opacity: 1;
}

.bfri-profit-calc .description {
  font-size: 11px;
  color: #7a8894;
}

/* Inline "increase quantity" validation (BFRI-1354): replaces a
   blocking alert() that fired on every keystroke. Hidden by default;
   js/profitcalculate.js toggles .is-visible once Group Size and Goal
   Per Seller are both filled in but still below the order minimum. */
.bfri-quantity-warning {
  display: none;
  color: #d41717;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  margin: -4px 0 12px;
}

.bfri-quantity-warning.is-visible {
  display: block;
}

/* Field-level "This field is required." message (clientside_validation),
   shown below the Group Size / Goal Per Seller stepper. Only wrapped in
   .form-item--error-message on some pages, so target the message itself. */
.bfri-profit-calc .bfri-field-col strong.error {
  display: block;
  margin-top: 4px;
  color: #d41717;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
}

.bfri-estimate-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px auto 12px;
  width: 250px;
}

.bfri-estimate-divider::before,
.bfri-estimate-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #0B5C70;
}

.bfri-estimate-divider span {
  padding: 0 10px;
  color: #0B5C70;
  font-family: Helvetica;
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  line-height: 20px; /* 125% */
  text-transform: uppercase;
}

.bfri-estimate-card {
  float: left;
  width: 48%;
  box-sizing: border-box;
  margin: 0 2% 12px 0;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #0b5c70;
  /* background: #fff; */
}

.bfri-estimate-card.bfri-calculated-profit {
  margin-right: 0;
}

.bfri-card-label {
  background: #0b5c70;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: center;
  padding: 8px 10px;
  border-radius: 5px;
}

.bfri-calculated-profit .bfri-card-label {
  background: #0b5c70;
}

.bfri-card-content {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 16px 10px;
  gap: 15px;
}

.bfri-card-value {
  text-align: center;
  padding: 0;
  font-size: 26px;
  font-weight: 700;
  color: #0b5c70;
  flex: 0 0 auto;
  font-family: skolar-latin, serif;
}

.bfri-card-value small {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #1a2b33;
  text-transform: capitalize;
  margin-top: 2px;
  font-family: skolar-latin, serif;
}

.bfri-card-subtext {
  text-align: left;
  font-size: 14px;
  color: #1a2b33;
  padding: 0;
  flex: 0 0 75px;
  line-height: 1.3;
  border-left: 1px solid #E8E8E8;
  padding-left: 15px;
  font-family: skolar-latin, serif;
}

.bfri-card-subtext span {
  font-size: 18px;
  font-weight: 700;
  color: #0b5c70;
  display: block;
  margin-bottom: 2px;
  font-family: skolar-latin, serif;
}

.bfri-card-content.bfri-single-value {
  justify-content: center;
}

.bfri-card-content.bfri-single-value .bfri-card-value {
  font-size: 30px;
}

.bfri-card-content.bfri-single-value .bfri-card-value small {
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
}

.bfri-calculated-profit {
  text-align: center;
}

.bfri-calculated-profit .bfri-card-label {
  background: #E1F9FF;
  color: #0b5c70;
  /* border-bottom: 2px solid #f5921e; */
}

.block.calculate__profit .form-item-profit {
  padding: 27px 0;
  background: #0b5c70;
  border-radius: 5px;
}

#page-wrapper .bfri-profit-calc form .form-control[readonly] {
  color: #FFF;
  text-align: center;
  font-family: skolar-latin, serif;
  font-size: 26px !important;
  font-style: normal;
  font-weight: 700;
  line-height: 26.4px; /* 101.538% */
}

.block.calculate__profit {
  margin: 0 !important;
}

.bfri-calculated-profit .form-item {
  margin: 0;
  background: #0b5c70;
  padding: 20px 10px;
}

.bfri-calculated-profit label {
  display: none;
}

.bfri-calculated-profit input#edit-profit {
  border: none;
  background: transparent;
  text-align: center;
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  width: 100%;
  padding: 0;
  font-family: skolar-latin, serif;
  /* This is a readonly, non-editable output, not a real input (BFRI-1354:
     it was still showing a blinking text caret when clicked/tabbed to). */
  caret-color: transparent;
}

.bfri-estimate-note {
  clear: both;
  padding: 8px 10px;
  font-size: 11px;
  color: #5a6a75;
  margin: 4px 0 16px;
  border-radius: 5px;
  border: 1px solid #A9CFD9;
  background: #E1F9FF;
}

.bfri-case-quantity {
  /* Independently cleared (BFRI-1354): previously relied on the sibling
     .bfri-estimate-note's clear:both to drop below the floated
     .bfri-estimate-card pair above it. Discount Card/Scratch Card
     products skip that note entirely (it doesn't apply to them - see
     is_card_product in CalculateProfitForm), so this row rendered
     beside the floated cards instead of below them, squeezing "Add
     Cases to Cart" into a sliver and wrapping its text vertically. */
  clear: both;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.bfri-case-quantity label {
  font-weight: 600;
  font-size: 13px;
  margin-right: auto;
}

.bfri-stepper {
  display: flex;
  align-items: center;
  border: 1px solid #d7e0e6;
  border-radius: 4px;
  overflow: hidden;
}

.bfri-stepper button {
  border: none;
  background: #f3f6f8;
  width: 30px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
}

.bfri-stepper input {
  width: 60px;
  border: none;
  border-left: 1px solid #d7e0e6;
  border-right: 1px solid #d7e0e6;
  text-align: center;
  height: 36px;
  background: #fff;
}

/* Group Size / Goal Per Seller fill their column instead of the fixed
   60px used by the compact Case Quantity stepper (BFRI-1354: the fixed
   width was clipping the placeholder text - "Number of Participants" /
   "Products Sold/Participant" - so it was never fully visible). */
.bfri-fields-row .bfri-stepper input {
  width: auto;
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
  padding-left: 2px;
  font-size: 13px;
  border: 0;
  text-align: center;
}

.bfri-fields-row .bfri-stepper input:focus-visible, .bfri-fields-row .bfri-stepper input:focus {
  outline: 0;
}

.bfri-fields-row .bfri-stepper input#edit-participant-goal {
  text-align: center;
}

.bfri-fields-row .bfri-stepper input::placeholder {
  font-size: 12px;
  color: #9aa7b0;
  overflow: visible;
}

/* Hide native number-input spin arrows: they duplicate the custom +/-
   buttons (Task 7). */
.bfri-profit-calc input[type="number"]::-webkit-outer-spin-button,
.bfri-profit-calc input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.bfri-profit-calc input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.bfri-add-cases-to-cart {
  cursor: pointer;
  width: auto;
  margin-top: 10px;
  border-radius: 10px;
  background: #F38C0D;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.10), 0 4px 6px -4px rgba(0, 0, 0, 0.10);
  color: #FFF;
  text-align: center;
  font-family: "Helvetica";
  font-size: 18px;
  font-style: normal;
  font-weight: 700;
  line-height: 28px;
  text-transform: uppercase;
  padding: 8px 14px;
  border: 0;
  margin: 0 auto;
}

.bfri-add-cases-to-cart:hover {
  background: #db7f13;
}

.bfri-start-fundraiser-wrapper {
  clear: both;
  margin-top: 16px;
  text-align: center;
}
/*Overwrite color and border*/
.block.calculate__profit {background-color: #FFFFFF !important;}
.spb-popup-main-wrapper {border:none !important;}
.spb-popup-main-wrapper.spb_center {
  top: 30% !important;
}

.border__button a.calculate_your_profit {
  padding: 10px 50px;
  border: 1px solid #db7f13;
  border-radius: 5px;
  color: #0b5c70;
  text-decoration: none;
  margin-bottom: 10px;
}

.border__button a.calculate_your_profit:hover {
  background: #838388;
  color: #fff !important;
  border: 1px solid #838388;
}

@media (max-width: 767px) {
  .bfri-estimate-card {
    width: 100%;
    float: none;
  }

  .bfri-profit-calc {
    height: 510px;
    overflow: scroll;
  }

  .spb-controls {
    top: 10px !important;
    right: 10px !important;
  }

  .spb-popup-main-wrapper.spb_center {
  top: 15% !important;
}
}