/* Calculator card */
.calculator {
  background-color: #ffffff;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.05);
  padding: 32px;
  max-width: 550px;
  color: var(--color-text);
}

.calculator__heading {
  font-weight: var(--font-weight-regular);
  margin-bottom: 12px;
  color: var(--color-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
}

.calculator__row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
}

.calculator__label {
  font-size: var(--font-size-small);
  line-height: var(--line-height-base);
  font-weight: var(--font-weight-regular);
  color: var(--color-subtext);
  margin-right: 10px;
}

.calculator__select {
  position: relative;
  user-select: none;
  width: 250px;
  color: var(--color-primary);
  font-weight: var(--font-weight-regular);
  cursor: pointer;
  user-select: none;
}

.dropdown-selected {
  display: flex;
  align-items: center;
  justify-content: end;
  cursor: pointer;
}

.dropdown-selected .arrow {
  margin-left: 5px;
}

.dropdown-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: white;
  border: 1px solid #ccc;
  margin-top: 4px;
  padding: 0;
  list-style: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  z-index: 100;
  border-radius: 4px;
}

.dropdown-list li {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  color: #333;
  font-size: var(--font-size-small);
  line-height: var(--line-height-base);
}

.dropdown-list li:hover {
  background-color: #f0f0f0;
}

.label {
  padding-right: 4px;
}
.rate {
  color: white;
  background-color: var(--color-primary);
  border-radius: 4px;
  padding: 2px 4px;
}

.calculator__value {
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
}
.calculator__rate-old {
  color: red;
  text-decoration: line-through;
}

.calculator__promo {
  color: #198754;
  background-color: #d1e7dd;
  border-radius: 4px;
  padding: 10px 20px;
  text-align: center;
  font-weight: var(--font-weight-regular);
  font-size: 0.65rem;
  line-height: var(--line-height-base);
}
.calculator__promo-link {
  color: var(--color-primary);
}

.calculator__btn {
  width: 100%;
  padding: 16px;
  margin-top: 8px;
}

/* Custom Dropdown */
.custom__dropdown {
  position: relative;
  margin-bottom: 24px;
}
.custom-dropdown__toggle {
  background: #fff;
  border: 1px solid var(--color-secondary);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.toggle__btn {
  border: none;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.custom-dropdown__flag {
  width: 39px;
  height: auto;
  margin-right: 8px;
}
.custom-dropdown__label {
  display: flex;
  flex-direction: column;
  text-align: left;
}
.selected__currency {
  font-size: var(--font-size-medium);
  line-height: var(--line-height-medium);
  font-weight: 700;
  color: var(--color-text);
}
.selected__country {
  font-size: var(--font-size-small);
  line-height: var(--line-height-base);
  font-weight: 400;
  color: var(--color-text-secondary);
}
.custom-dropdown__chevron {
  padding-left: 1rem;
  width: 28px;
  flex-shrink: 0;
}
.custom-dropdown__amount {
  flex: 1;
  text-align: right;
  z-index: 1;
}
.custom-dropdown__amount input {
  font-weight: var(--font-weight-regular);
  border: none;
  background: none;
  text-align: right;
  outline: none;
  width: 100%;
  font-size: clamp(1.125rem, 0.8vw + 0.9rem, 1.5rem);
  line-height: 1.2;
}

.custom-dropdown__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.1);
  z-index: 10;
  display: none;
  flex-direction: column;
  max-height: 300px;
  overflow: hidden;
}

.custom__dropdown.open .custom-dropdown__menu {
  display: flex;
}

.custom-dropdown__search {
  font-size: var(--font-size-small);
  line-height: var(--line-height-base);
  padding: 12px 16px;
  border: none;
  border: 2px solid var(--color-primary);
  border-top-right-radius: 12px;
  border-top-left-radius: 12px;
  outline: none;
}

.custom-dropdown__list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
}
.custom-dropdown__item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
}
.custom-dropdown__item:last-child {
  border-bottom: none;
}
.custom-dropdown__item:hover {
  background-color: #f9fafb;
}

/* Desktop */
@media (min-width: 1024px) {
  .calculator__heading {
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
  }
  .calculator__label {
    font-size: var(--font-size-small);
    line-height: var(--line-height-base);
  }
  .calculator__value {
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
  }

  .calculator__promo {
    font-size: 0.75rem;
    line-height: var(--line-height-base);
  }

  .custom-dropdown__amount input {
    font-size: clamp(1.25rem, 0.6vw + 1rem, 1.625rem);
    line-height: 1.2;
  }

  .selected__currency {
    font-size: clamp(1.125rem, 0.5vw + 0.9rem, 1.375rem);
    line-height: var(--line-height-medium);
  }

  .selected__country {
    font-size: var(--font-size-small);
    line-height: var(--line-height-base);
  }

  .dropdown-list li {
    font-size: var(--font-size-small);
    line-height: var(--line-height-base);
  }
}

/* Large desktop */
@media (min-width: 1440px) {
  .calculator__heading {
    font-size: 1rem;
    line-height: 1.5;
  }
  .calculator__label {
    font-size: 0.9375rem;
    line-height: 1.5;
  }
  .calculator__value {
    font-size: 1rem;
    line-height: 1.5;
  }

  .calculator__promo {
    font-size: 0.85rem;
    line-height: 1.6;
  }

  .custom-dropdown__amount input {
    font-size: 1.5rem;
    line-height: 1.2;
  }

  .selected__currency {
    font-size: 1.375rem;
    line-height: var(--line-height-medium);
  }

  .selected__country {
    font-size: 1rem;
    line-height: 1.6;
  }

  .dropdown-list li {
    font-size: var(--font-size-small);
    line-height: 1.6;
  }
}
