.hidden {
  display: none !important;
}

/* Spinner styles for spinner used in some Ajax requests */
.sl-chwazi-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 5px;
  border: 2px solid #ffce34;
  border-radius: 50%;
  border-top: 2px solid transparent;
  animation: sl-chwazi-spin 0.6s linear infinite;
}

@keyframes sl-chwazi-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* The switch - the box around the slider */
.lpac-dps-switch {
  position: relative;
  display: inline-block;
  width: 80px;
  height: 34px;
}

/* Hide default HTML checkbox */
.lpac-dps-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.lpac-dps-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

.lpac-dps-slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

input:checked + .lpac-dps-slider {
  background-color: #2196f3;
}

input:focus + .lpac-dps-slider {
  box-shadow: 0 0 1px #2196f3;
}

input:checked + .lpac-dps-slider:before {
  -webkit-transform: translateX(45px);
  -ms-transform: translateX(45px);
  transform: translateX(45px);
}

/* Rounded sliders */
.lpac-dps-slider.round {
  border-radius: 34px;
}

.lpac-dps-slider.round:before {
  border-radius: 50%;
}

/* Make sure timeslots and location input fields have proper height. */
select#lpac_dps_pickup_time,
select#lpac_dps_delivery_time,
select#lpac_dps_pickup_location,
select#lpac_dps_delivery_location,
#lpac_dps_pickup_date_field input,
#lpac_dps_delivery_date_field input {
  height: auto !important;
  visibility: initial !important;
}

/* Express checkout buttons disabled until the required Chwazi fields are filled in. */
.chwazi-express-checkout-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chwazi-express-checkout-disabled * {
  pointer-events: none !important;
}

.chwazi-express-checkout-notice {
  margin-bottom: 0.5em;
  text-align: center;
  font-size: 0.9em;
}

/*
 * Keep Chwazi's calendars at 7 days per row.
 * flatpickr wraps the days with flexbox, so when a theme or another plugin makes a day even 1px narrower,
 * 8 days fit in a row and every date sits under the wrong weekday. A 7 column grid can't wrap that way.
 * The chwazi-calendar class is added in assets/public/js/shared/calendar.js.
 */
.flatpickr-calendar.chwazi-calendar .dayContainer {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  justify-items: center;
}

/* flatpickr's 14.2857% width would be measured against one grid cell here, so fill the cell instead. */
.flatpickr-calendar.chwazi-calendar .flatpickr-day {
  width: 100%;
  max-width: 39px;
}
