* {
  box-sizing: border-box;
}

:root {
  --step_gap: 30px !important;
  --sub_step_gap: 15px !important;
  --padding: 30px !important;
  --step_gap-tablet: 10px !important;
  --padding-tablet: 20px !important;
  --progress_bar: background: rgba(120,120,128,0.16) !important;
}



/* Wrapper */
.msfb-form-wrapper {
  max-width: 700px !important;
  width: 100% !important;
  margin: 0 auto !important;
}

/* Container */
.msfb-form {
  display: flex !important;
  flex-direction: column !important;
  gap: var(--step-gap) !important;
  border-radius: 8px !important;
}

.msfb-form-top{
  display: flex;
  flex-direction: column;
  gap: var(--step_gap-tablet);
}

/* Step container */
.msfb-step {
  display: flex;
  flex-direction: column;
  gap: var(--step_gap);
  padding: var(--padding);  
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25) !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* Hidden steps (not visible) */
.msfb-step[style*="display: none"] {
  opacity: 0;
  transform: translateY(-10px);
}

/* Entering state for navigation */
.msfb-step.msfb-step-entering {
  opacity: 1 !important; 
  transform: translateY(0) !important;
}

.msfb-step.msfb-step-exiting {
    opacity: 0 !important;
    transform: translateY(-10px) !important;
}


/* Ensure the first step on load doesn’t animate */
.msfb-step[data-step-id]:first-child {
  transition: none !important;
  opacity: 1 !important;
  transform: none !important;
}

.msfb-step h2 {
  margin: 0 auto !important;
  font-size: 36px !important;
  font-weight: 500 !important;
}

.msfb-step p {
  margin: 0 auto !important;
  font-size: 20px !important;
  font-weight: 400 !important;
}

.msfb-step-content {
  display: flex !important;
  flex-direction: column !important;
}

.msfb-step span {
  font-size: 16px !important;
}

.msfb-sub-steps {
  display: flex !important;
  flex-direction: column !important;
  gap: var(--step_gap) !important;
}

.msfb-sub-step {
  display: flex !important;
  flex-direction: column !important;
  gap: var(--sub_step_gap) !important;
}

.msfb-sub-step p {
  margin: 0 !important;
  font-size: 16px !important;
  font-weight: 400 !important;
}

.msfb-step-navigation {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: var(--step_gap) !important;
}

.msfb-prev-step,
.msfb-next-step {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 10px !important;
  border: none !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  box-shadow: inset 0px -5px 5px rgba(0, 0, 0, 0.1) !important;
  transition: transform 0.2s, box-shadow 0.2s !important;
}

.msfb-form button[type="submit"] {
  padding: 10px 20px !important;
  width: 100% !important;
  border: none !important;
  border-radius: 4px !important;
  cursor: pointer !important;
}

.msfb-prev-step:hover,
.msfb-next-step:hover,
.msfb-form button[type="submit"]:hover {
  border: none !important;
  outline: none !important;
  background-color: var(--btn_color_hover) !important;
  transform: translateY(-2.5px) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

/*disabled buttons */
.msfb-prev-step.msfb-disabled,
.msfb-next-step.msfb-disabled {
  background-color: var(--btn_color) !important;
  color: #666666 !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
  box-shadow: none !important;
}

.msfb-prev-step.msfb-disabled:hover,
.msfb-next-step.msfb-disabled:hover {
  background-color: #cccccc;
}

.msfb-progress-bar {
  width: 100% !important;
  height: 10px !important;
  background: rgba(120, 120, 128, 0.16) !important;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.25) !important;
  border-radius: 25px !important;
  overflow: hidden !important; 
}

.msfb-progress-bar-fill {
  height: 100%;
  transition: width 0.3s ease;
  width: 0;
}

/* Card */
.msfb-card-options {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.msfb-card-option {
  flex: 1 1 120px;
  border: 2px solid transparent !important;
  border-radius: 12px !important;
  padding: 15px !important;
  text-align: center !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.msfb-card-option svg {
  width: 40px;
  height: 40px;
  fill: none;
  /* transition: filter 0.2s; */
}

.msfb-card-option input[type="radio"],
.msfb-card-option input[type="checkbox"] {
  display: none !important;
}

.msfb-card-option:has(input[type="radio"]:checked),
.msfb-card-option:has(input[type="checkbox"]:checked) {
  border: 2.5px solid var(--btn_color) !important;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--btn_color) 40%, transparent) !important;
  transform: translateY(-5px) !important;
  z-index: 1 !important;
}

.msfb-card-option:has(input[type="radio"]:checked) svg,
.msfb-card-option:has(input[type="checkbox"]:checked) svg {
  filter: drop-shadow(0 1px 2px color-mix(in srgb, var(--btn_color) 50%, transparent)); /* Shadow on SVG */
}

.msfb-card-option:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
}

.msfb-card-option {
  font-size: 16px;
  font-weight: 400;
  color: var(--card_text_color);
}

.msfb-card-option img.msfb-svg-icon {
  width: 65px;
  height: 65px;
}

/* quantity */
.msfb-quantity-options {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 15px !important;
  width: 100% !important; /* Ensure full width */
  margin: 0 !important; /* Prevent margin issues */
  
}

.msfb-quantity-option {
  flex: 1 1 120px;
  max-height: 150px;
  border-radius: 12px;
  padding: 8px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background-color: var(--card_bg);
  min-width: 0;
}

.msfb-quantity-option img {
  width: 40px;
  height: 40px;
}

.msfb-quantity-option label {
  font-size: 16px;
  font-weight: 400;
  color: var(--card_text_color);
  white-space: nowrap; /* Prevent label wrapping */
  overflow: hidden; /* Hide overflow */
  text-overflow: ellipsis; /* Add ellipsis for long labels */
  width: 100%; /* Ensure label fits container */
}

.msfb-step input[type="text"],
.msfb-step input[type="email"],
.msfb-step input[type="tel"],
.msfb-step input[type="number"],
.msfb-step select,
.msfb-step textarea {
  width: 100% !important;
  color: #000 !important;
  font-size: 16px !important;
  font-family: inherit !important;
  background-color: var(--input_color) !important;
  box-shadow: inset 0 0.75px 0.75px 0 rgba(0, 0, 0, 0.2) !important;
}

.msfb-step textarea {
  resize: none;
}

.msfb-step input {
  border-radius: 10px !important;
  padding: 15px !important;
  border: none !important;
}

.msfb-step input[type="number"] {
  height: 35px !important;
  border-radius: 10px !important;
  padding: 20px !important;
  border: none !important;
  background-color: #f8f8f8;
  box-shadow:none !important;
}

.msfb-step textarea {
  border-radius: 10px;
  padding: 20px;
  border: none;
  line-height: 2;
}

.msfb-step input:focus,
.msfb-step textarea:focus {
  outline: none;
}

/* quantity counter */
.msfb-number-input-wrapper {
  display: flex !important;
  align-items: center !important;
  background: #f8f8f8 !important;
  border-radius: 10px !important;
  width: 100% !important;
  overflow: hidden !important;
  box-shadow: inset 0 1px 1px 0 rgba(0, 0, 0, 0.2) !important;
  padding: 2px !important;
}

.msfb-number-input-wrapper input[type="number"] {
  height: 35px !important;
  border: none !important;
  background: transparent !important;
  text-align: center !important;
  padding: 0 !important;
  -moz-appearance: textfield !important;
}

.msfb-number-input-wrapper input[type="number"]::-webkit-inner-spin-button,
.msfb-number-input-wrapper input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

.msfb-number-input-wrapper button {
  width: 35px !important;
  height: 35px !important;
  border-radius: 12px !important;
  border: none !important;
  outline: none !important;
  color: #333 !important;
  font-size: 16px !important;
  font-weight: bold !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background 0.2s ease !important;
  background: #f8f8f8 !important;
}

/* Ensure wrapper fits within quantity option */
.msfb-quantity-option {
  gap: 5px; /* Adjust spacing if needed */
}

/* personal info */
.msfb-personal-info {
  display: flex !important;
  flex-direction: column !important;
  gap: var(--sub_step_gap) !important;
}

.msfb-name-email-group {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  gap: var(--sub_step_gap) !important;
}

.msfb-name-email-group label {
  width: 100%;
}

.msfb-name-other-group {
  display: flex !important;
  flex-direction: column !important;
  gap: var(--sub_step_gap) !important;
}

.msfb-name-other-group label {
  width: 100%;
}

/* Adress */
.msfb-address-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.msfb-map-container {
  height: 175px;
  width: 100%;
  border-radius: 12px;
}

/* Slider */
.msfb-slider {
  display: flex !important;
  flex-direction: column !important;
  gap: var(--sub_step_gap) !important;
}

.msfb-slider label {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
}

.msfb-slider span {
  font-size: 16px;
  font-weight: 400;
  color: #333;
}

.msfb-slider input[type="range"] {
  -webkit-appearance: none !important; /* Remove default Webkit styles */
  appearance: none !important;
  width: 100% !important;
  height: 5px !important;
  background: rgba(
    120,
    120,
    128,
    0.16
  ) !important;
  border-radius: 25px !important;
  outline: none !important;
  cursor: pointer !important;
  padding: 0 !important;
  box-shadow: inset 0 0.5px 0.5px rgba(0, 0, 0, 0.25) !important;
}

/* Track (Webkit: Chrome, Safari, Edge) */
.msfb-slider input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 10px;
  background: rgba(120, 120, 128, 0.16);
  border-radius: 25px;
}

/* Track (Firefox) */
.msfb-slider input[type="range"]::-moz-range-track {
  width: 100%;
  height: 10px;
  background: rgba(120, 120, 128, 0.16);
  border-radius: 25px;
}

/* Fill (Webkit) */
.msfb-slider input[type="range"]::-webkit-slider-runnable-track {
  background: linear-gradient(
    to right,
    #1674bc 0%,
    #1674bc var(--webkit-slider-value),
    rgba(120, 120, 128, 0.16) var(--webkit-slider-value),
    rgba(120, 120, 128, 0.16) 100%
  );
}

/* Fill (Firefox) */
.msfb-slider input[type="range"]::-moz-range-progress {
  height: 10px;
  background: #1674bc;
  border-radius: 25px 0 0 25px;
}

/* Thumb (Webkit) */
.msfb-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  margin-top: -7px;
}

/* Thumb (Firefox) */
.msfb-slider input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

/* Thumb hover effect */
.msfb-slider input[type="range"]::-webkit-slider-thumb:hover,
.msfb-slider input[type="range"]::-moz-range-thumb:hover {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

/* Output */
.msfb-slider output {
  font-size: 16px;
  color: #333;
  padding: 4px 8px;
  border-radius: 4px;
}

/* calendar */
.msfb-calendar-container {
  margin-top: 10px;
  max-width: 300px;
}

.msfb-calendar-container .flatpickr-calendar {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  border: 1px solid #ddd;
  background: #fff;
  display: block !important;
}

.flatpickr-calendar {
  width: 100% !important;
}

.flatpickr-current-month {
  width: 100% !important;
  left: 0 !important;
  padding: 0 !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
  padding: 0 !important;
  width: 40% !important;
}

.flatpickr-current-month .numInputWrapper {
  width: 40% !important;
  background-color: transparent !important;
}

.flatpickr-rContainer {
  width: 100% !important;
}

.flatpickr-days {
  width: 100% !important;
}

.flatpickr-day {
  width: 100% !important;
  max-width: 100% !important;
}

.flatpickr-day.selected{
  background-color: var(--btn_color) !important;
  border-color:var(--btn_color) !important;
}

.dayContainer {
  min-width: 100% !important;
  max-width: 100% !important;
}


/* Hide empty or whitespace-only p tags across the form */
.msfb-step p:empty,
.msfb-sub-step p:empty,
.msfb-step-content p:empty,
.msfb-address-info p:empty,
.msfb-step-navigation p:empty,
.msfb-quantity-option p:empty {
  display: none !important;
}

/* Additional rule to catch p tags with only whitespace or &nbsp; */
.msfb-step p:not(:empty),
.msfb-sub-step p:not(:empty),
.msfb-step-content p:not(:empty),
.msfb-address-info p:not(:empty),
.msfb-step-navigation p:not(:empty) {
  display: block;
}
.msfb-step p:not(:empty):where(:blank, :only-child:where(:blank)) {
  display: none;
}
.msfb-sub-step p:not(:empty):where(:blank, :only-child:where(:blank)) {
  display: none;
}
.msfb-step-content p:not(:empty):where(:blank, :only-child:where(:blank)) {
  display: none;
}
.msfb-address-info p:not(:empty):where(:blank, :only-child:where(:blank)) {
  display: none;
}
.msfb-step-navigation p:not(:empty):where(:blank, :only-child:where(:blank)) {
  display: none;
}

.msfb-card-header {
  display: flex;
  flex-direction: column; /* Arrange SVG and label side by side */
  align-items: center; /* Vertically center the SVG and label */
  gap: 10px; /* Space between SVG and label */
}

.msfb-card-header svg {
  width: 40px; /* Adjust SVG size as needed */
  height: 40px;
}

.msfb-card-header label {
  margin: 0; /* Remove default label margins */
  font-size: 16px; /* Adjust font size as needed */
}

@media (max-width: 810px) {
  .msfb-step {
    gap: var(--step_gap-tablet);
    padding: var(--padding-tablet);
  }

  .msfb-card-header {
    display: flex;
    flex-direction: column; /* Arrange SVG and label side by side */
    align-items: center; /* Vertically center the SVG and label */
    gap: 10px; /* Space between SVG and label */
  }

  .msfb-quantity-option {
    flex: 1 1 170px;
    max-height: 150px;
    border-radius: 12px;
    padding: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .msfb-quantity-option img {
    width: 40px;
    height: 40px;
  }

  .msfb-quantity-option label {
    font-size: 16px;
    font-weight: 400;
    color: var(--card_text_color);
  }
}

@media (max-width: 430px) {
  .msfb-step {
    gap: var(--sub_step_gap) !important;
    padding: 10px !important;
  }

  .msfb-quantity-options {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
    width: 100% !important; /* Ensure full width */
  }

  .msfb-quantity-option {
    flex: 1 1 calc(50% - 7.5px); /* Two columns, accounting for gap */
    max-height: 150px;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
  }

  .msfb-name-email-group{
    flex-direction: column !important;
  }

  .msfb-name-other-group{
    flex-direction: column !important;
  }

  .msfb-card-header {
    display: flex;
    flex-direction: row; 
    align-items: center;
    gap: 0px; 
  }

  .msfb-card-header label {
   font-size: 14px;
  }

  .msfb-quantity-option img {
    width: 40px;
    height: 40px;
  }

  .msfb-step h2 {
    font-size: 30px !important;
    text-align: center;
  }
  
  .msfb-step p {
    font-size: 18px !important;
  }
}

.msfb-success {
  background-color: #dff0d8;
  color: #3c763d;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 4px;
  text-align: center;
}
.msfb-error {
  background-color: #f2dede;
  color: #a94442;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 4px;
  text-align: center;
}
