/* ===== Timezone picker ===== */

.booking__toolbar-timezone {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  min-width: 0;
  width: 100%;
}

.booking__toolbar-timezone .slots__timezone-picker {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  margin-left: auto;
  box-sizing: border-box;
}

#frame-1 .booking__toolbar-timezone {
  .slots__timezone {
    width: 100%;
    border: none;
    outline: none;
    font-weight: 500;
    font-size: 14px;
    color: var(--black);
    font-family: "Inter", sans-serif;
  }

  .slots__timezone-picker {
    position: relative;
    width: auto;
    max-width: 100%;
    overflow: visible;
    z-index: 0;
  }

  .slots__timezone-picker:has(.ant-select-open) {
    z-index: 30;
  }

  .slots__timezone-picker > .ant-select {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
  }

  .slots__timezone-picker .ant-select-selector {
    border: none !important;
    overflow: visible;
    padding: 0 0 0 26px !important;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    max-width: 100%;
    position: relative;
  }

  .slots__timezone-picker .ant-select-selector::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235C6166' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") no-repeat center / contain;
    pointer-events: none;
  }

  .slots__timezone-picker .ant-select-single .ant-select-selector .ant-select-selection-search {
    left: 26px !important;
    right: 0 !important;
  }

  .slots__timezone-picker .ant-select-single.ant-select-show-arrow .ant-select-selection-item,
  .slots__timezone-picker .ant-select-single.ant-select-show-arrow .ant-select-selection-placeholder {
    padding-left: 26px;
  }

  .slots__timezone-picker .ant-select-single.ant-select-show-arrow .ant-select-selection-item,
  .slots__timezone-picker .ant-select-single.ant-select-show-arrow .ant-select-selection-placeholder {
    padding-right: 0 !important;
  }

  .slots__timezone-picker .ant-select-selection-search-input {
    text-overflow: clip;
  }

  .slots__timezone-picker .slots__timezone-ant:not(.ant-select-open):not(.ant-select-focused) .ant-select-selector,
  .slots__timezone-picker .slots__timezone-ant:not(.ant-select-open):not(.ant-select-focused) .ant-select-selection-search-input {
    cursor: pointer;
  }

  .slots__timezone-picker .slots__timezone-ant.ant-select-open .ant-select-selection-search-input,
  .slots__timezone-picker .slots__timezone-ant.ant-select-focused .ant-select-selection-search-input {
    cursor: text;
  }

  .slots__timezone-picker .ant-select:not(.ant-select-disabled):hover .ant-select-selector,
  .slots__timezone-picker .ant-select-focused:not(.ant-select-disabled) .ant-select-selector,
  .slots__timezone-picker .ant-select.ant-select-open:not(.ant-select-disabled) .ant-select-selector {
    border-color: transparent !important;
    border-right-width: 0 !important;
    box-shadow: none !important;
  }

  .slots__timezone-picker .ant-select,
  .slots__timezone-picker .ant-select-selection-search-input,
  .slots__timezone-picker .ant-select-item,
  .slots__timezone-picker .ant-select-item-empty,
  .slots__timezone-picker .ant-select-item-option-content {
    font-family: "Inter", sans-serif;
    font-weight: 500;
    font-style: normal;
    font-size: 14px;
    line-height: 1.3;
    letter-spacing: 0;
    vertical-align: middle;
    color: var(--booking-timezone-text);
  }

  .slots__timezone-picker .ant-select-item.ant-select-item-option {
    padding: 12px 16px;
    min-height: 0;
    border-bottom: 1px solid var(--booking-timezone-option-border);
  }

  .slots__timezone-picker .ant-select-item.ant-select-item-option:last-child {
    border-bottom: none;
  }

  .slots__timezone-picker .ant-select-lg {
    font-size: 14px;
  }

  .slots__timezone-picker .ant-select-lg:not(.ant-select-customize-input) .ant-select-selector,
  .slots__timezone-picker .ant-select-lg:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-search-input,
  .slots__timezone-picker .ant-select-lg:not(.ant-select-customize-input) .ant-select-selector::after,
  .slots__timezone-picker .ant-select-lg:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-item,
  .slots__timezone-picker .ant-select-lg:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-placeholder {
    line-height: 1.3;
  }

  .slots__timezone-picker .ant-select-item-option:hover:not(.ant-select-item-option-disabled):not(.ant-select-item-option-selected),
  .slots__timezone-picker .ant-select-item-option-active:not(.ant-select-item-option-disabled):not(.ant-select-item-option-selected) {
    background-color: var(--booking-timezone-option-bg) !important;
  }

  .slots__timezone-picker .ant-select-item-option-selected:not(.ant-select-item-option-disabled) {
    background-color: var(--booking-timezone-selected-bg) !important;
    color: var(--booking-timezone-text);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--blue-500);
  }

  .slots__timezone-picker .ant-select-item-option-selected.ant-select-item-option-active:not(.ant-select-item-option-disabled) {
    background-color: var(--booking-timezone-selected-bg) !important;
  }

  .slots__timezone-picker .ant-select-item-option-selected:not(.ant-select-item-option-disabled) .ant-select-item-option-state {
    color: var(--gray-600);
  }

  .slots__timezone-picker .slots__timezone-dropdown.ant-select-dropdown {
    position: absolute;
    top: 100% !important;
    left: 0 !important;
    right: auto;
    box-sizing: border-box;
    width: max-content !important;
    min-width: 100% !important;
    max-width: min(720px, calc(100vw - 32px)) !important;
    transform: none !important;
    margin-top: 4px;
    max-height: 256px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1050;
  }

  .slots__timezone-picker .slots__timezone-dropdown .ant-select-item-option-content {
    overflow: visible !important;
    white-space: nowrap !important;
    text-overflow: clip !important;
    flex: none !important;
  }

  .slots__timezone-picker .ant-select-arrow {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    margin-top: 0 !important;
    flex-shrink: 0;
    align-self: center;
    width: 12px;
    height: 12px;
    cursor: pointer;
    pointer-events: auto !important;
  }

  .slots__timezone-picker .ant-select-arrow .anticon {
    display: none;
  }

  .slots__timezone-picker .ant-select-arrow::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    cursor: pointer;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--gray-500, var(--gray-600));
    transition: transform 0.3s;
  }

  .slots__timezone-picker .ant-select-open .ant-select-arrow::after {
    transform: translate(-50%, -50%) rotate(180deg);
  }

  .slots__timezone-picker ~ .slots__timezone {
    display: none;
  }
}

.booking__toolbar-timezone-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.5;
  color: #181a20;
}

.booking__toolbar-icon {
  flex-shrink: 0;
  color: var(--gray-600);
}

.slots .booking__toolbar-duration {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  margin-bottom: 12px;
}

.slots .duration.duration--toolbar-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

/* ===== Duration toolbar card ===== */

.duration--toolbar-card {
  margin-top: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 10px 16px;
  background: #f4f6f7;
  border-radius: 10px;
  border: none;
  min-width: 128px;
}

.duration__toolbar-heading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 13px;
  color: var(--gray-700);
}

.duration__toolbar-heading::before {
  content: url("../../images/booking/icons/alarm-icon.svg");
  width: 18px;
  height: 18px;
  display: inline-block;
  line-height: 0;
}

.duration--toolbar-card .duration__controller {
  justify-content: flex-start;
  gap: 8px;
}

/* ===== Slots ===== */

.slots {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  width: 100%;
}

.slots.slots--two-columns {
  align-items: center;
}

.slots__container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px 4px;
  justify-items: stretch;
  width: 100%;
  min-width: 0;
  max-width: 190px;
  position: relative;
}

.slots__container.slots__container--two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(var(--slots-col-rows, 1), auto);
  grid-auto-flow: column;
  row-gap: 8px;
  column-gap: 4px;
  width: 100%;
  max-width: 190px;
}

.slots__container:not(.slots__container--two-columns) {
  justify-items: start;
}

.slots__container:not(.slots__container--two-columns) .slots__item {
  width: 92.7625px;
}

.slots__container.slots__container--two-columns .slots__item {
  width: 100%;
}

.slots__empty {
  grid-column: 1 / -1;
  width: 100%;
  padding: 12px 8px;
  text-align: center;
  font-weight: 500;
  font-size: 16px;
  color: black;
}

.slots__empty-hint {
  display: block;
  margin-top: 6px;
  font-weight: 400;
  font-size: 13px;
  color: var(--gray-600, #6b7280);
}

.slots__container.slots__container--loading {
  grid-template-columns: unset;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 90px;
}

.slots__container.slots__container--loading > * {
  opacity: 0!important;
  pointer-events: none;
}

.slots__container.slots__container--loading::before {
  content: "";
  display: block;
  width: 40px;
  height: 40px;
  margin: 0;
  border: 3px solid var(--gray-100, #e9eef5);
  border-top-color: var(--green-500, #00B84C);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: bookingLoaderSpin 0.8s linear infinite;
}

.slots__item {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 8px 12px;
  gap: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgb(174, 182, 191);
  background-color: var(--white-primary);
  cursor: pointer;
  font-family: "Inter", sans-serif;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease;

  span {
    font-weight: 500;
    font-size: 14px;
    line-height: 24px;
    letter-spacing: 0;
    text-align: center;
    color: rgb(24, 26, 32);
  }

  &.slots__item--available:hover {
    border-color: rgb(0, 184, 76);
    background-color: rgb(235, 249, 241);
  }
}

/* ===== Duration (details card variant) ===== */

.duration {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--black);
  font-size: 14px;
}

.details .duration > span:first-of-type {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;

  &::before {
    content: url("../../images/booking/icons/alarm-icon.svg");
    width: 20px;
    height: 20px;
  }
}

.duration__controller {
  display: flex;
  align-items: center;
  gap: 4px;
}

.duration__btn {
  width: 20px;
  height: 20px;
  background-color: transparent;
  border: none;
  cursor: pointer;
}

.duration__btn--less::after {
  content: url("../../images/booking/icons/less-icon.svg");
}

.duration__btn--more::after {
  content: url("../../images/booking/icons/more-icon.svg");
}

.duration__btn:disabled,
.duration__btn--disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.duration__value {
  font-weight: 700;
}

/* ===== Slots responsive ===== */

@media (max-width: 992px) {
  .slots {
    margin-top: 16px;
    position: relative;
  }

  .slots__container {
    margin: 0 auto;
    max-width: 220px;
  }

  .slots__container.slots__container--two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: auto;
    max-width: 360px;
  }

  .booking__toolbar-timezone .slots__timezone-picker {
    max-width: 100%;
  }

}

@media (max-width: 767px) {
  .slots {
    align-items: stretch;
  }

  #frame-1 .booking__toolbar-timezone {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
  }

  #frame-1 .booking__toolbar-timezone-label {
    flex-shrink: 0;
  }

  #frame-1 .booking__toolbar-icon {
    margin-left: 8px;
  }

  #frame-1 .booking__toolbar-timezone .slots__timezone-picker {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    margin-left: auto;
    box-sizing: border-box;
  }

  #frame-1 .slots__timezone-picker .slots__timezone-input,
  #frame-1 .slots__timezone-picker .ant-select-selection-search-input {
    text-align: right;
  }

  #frame-1 .slots .booking__toolbar-duration {
    width: 100%;
    max-width: none;
  }

  #frame-1 .slots .duration--toolbar-card {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px 12px;
    padding-left: 8px;
    padding-right: 8px;
  }

  #frame-1 .slots__timezone-picker .slots__timezone-dropdown.ant-select-dropdown {
    left: 0 !important;
    right: 0 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box;
  }

  #frame-1 .slots__timezone-picker .slots__timezone-dropdown .ant-select-item-option-content {
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  #frame-1 .slots__container {
    max-width: none;
    margin-top: 0;
  }

  #frame-1 .slots__container.slots__container--two-columns {
    max-width: none;
    width: 100%;
  }

  #frame-1 .slots__container .slots__item {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  #frame-1 .booking__toolbar-timezone {
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
  }

  #frame-1 .booking__toolbar-timezone .slots__timezone-picker {
    flex-basis: auto;
    margin-left: 0;
    max-width: min(100%, 320px) !important;
  }

  #frame-1 .booking__toolbar-timezone .slots__timezone-picker > .ant-select {
    max-width: 100%;
  }

  #frame-1 .slots__container {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  #frame-1 .slots__container.slots__container--two-columns {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-items: stretch;
  }

  #frame-1 .slots__container:not(.slots__container--two-columns) {
    width: min(195px, 100%);
    max-width: min(195px, 100%);
    justify-items: stretch;
  }

  #frame-1 .slots__container:not(.slots__container--two-columns) .slots__item {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
}
