/* =====================
   Custom Select Wrapper
===================== */

.custom-select {
  position: relative;
  display: inline-block;
  min-width: 4rem;
  width: 100%;
}

/* Hidden native select */
.custom-select select {
  display: none;
}

/* Custom Select Button */
.custom-select__button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 0;
  border-radius: 0.75rem;
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 3.959px 14.845px 0 rgba(0, 0, 0, 0.1),
    0 0.99px 0 0 rgba(255, 255, 255, 0.3) inset,
    0 3.959px 19.794px 0 rgba(255, 0, 23, 0.2) inset;
  backdrop-filter: blur(49.484535217285156px);
  -webkit-backdrop-filter: blur(49.484535217285156px);
  padding: 0.9375rem;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
  min-width: 4rem;
}

.header__actions .custom-select {
  width: auto;
}

.custom-select__value {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.custom-select__flag {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 50%;
  background: #f2f4fb;
  font-size: 1.25rem;
  line-height: 1;
}

.custom-select__code,
.custom-select__label {
  line-height: 1.2;
}

.custom-select__button:hover,
.custom-select__button:focus {
  outline: none;
  box-shadow: 0 3.959px 14.845px 0 rgba(0, 0, 0, 0.2),
    0 0.99px 0 0 rgba(255, 255, 255, 0.4) inset,
    0 3.959px 19.794px 0 rgba(255, 0, 23, 0.3) inset;
}

.custom-select__button:active {
  transform: scale(0.98);
}

/* Arrow Icon */
.custom-select__arrow {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #fff;
  transform: rotate(0);
  transition: transform 0.3s ease;
  pointer-events: none;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.custom-select--open .custom-select__arrow {
  transform: rotate(180deg);
}

/* Custom Select Dropdown */
.custom-select__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.5rem;
  border: 1px solid rgba(255, 131, 131, 0.2);
  border-radius: 0.75rem;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 3.959px 14.845px 0 rgba(0, 0, 0, 0.1), 0 0.99px 0 0 rgba(255, 255, 255, 0.3) inset, 0 3.959px 19.794px 0 rgba(255, 0, 23, 0.2) inset;
  backdrop-filter: blur(49.484535217285156px);
  -webkit-backdrop-filter: blur(49.484535217285156px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  max-height: 300px;
  overflow-y: auto;
}

.custom-select--language .custom-select__dropdown {
  left: auto;
  right: 0;
  min-width: 17rem;
  padding: 0.5rem;
  max-height: min(32rem, calc(100vh - 7.5rem));
  border: 0;
  border-radius: 1.5rem;
  background: #f3f5ff;
  box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, 0.35);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.custom-select--open .custom-select__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Custom Select List */
.custom-select__list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}

/* Custom Select Option */
.custom-select__option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #d1d1d1;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  line-height: 1.5;
  white-space: nowrap;
  border-radius: 0.625rem;
}

.custom-select__option:hover,
.custom-select__option:focus {
  background-color: #300a10;
  color: #fa1f59;
  outline: none;
}

.custom-select__option--selected {
  background-color: #4b0611;
  color: #fa1f59;
  font-weight: 500;
}

.custom-select--language .custom-select__option {
  color: #101014;
  font-size: 1.0625rem;
}

.custom-select--language .custom-select__option:hover,
.custom-select--language .custom-select__option:focus {
  background: rgba(250, 31, 89, 0.12);
  color: #101014;
}

.custom-select--language .custom-select__option--selected {
  background: transparent;
  color: #101014;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}


/* Scrollbar Styling */
.custom-select__dropdown::-webkit-scrollbar {
  width: 6px;
}

.custom-select__dropdown::-webkit-scrollbar-track {
  background: rgba(131, 255, 143, 0.05);
  border-radius: 10px;
}

.custom-select__dropdown::-webkit-scrollbar-thumb {
  background: rgba(131, 255, 143, 0.3);
  border-radius: 10px;
}

.custom-select__dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(131, 255, 143, 0.5);
}

/* =====================
   Responsive
===================== */

@media (max-width: 1440px) {
  .custom-select__button {
    font-size: 0.9375rem;
    padding: 0.875rem;
    border-radius: 0.6875rem;
  }
}

@media (max-width: 1023.98px) and (min-width: 768px) {
  .custom-select__button {
    padding: 0.8125rem;
    font-size: 0.9375rem;
    border-radius: 0.6875rem;
    min-width: 60px;
  }
}

@media (max-width: 899.98px) and (min-width: 768px) {
  .custom-select__button {
    padding: 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.625rem;
    min-width: 58px;
  }
}

@media (max-width: 767.98px) {
  .custom-select__button {
    padding: 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.625rem;
    min-width: min-content;
  }

  .custom-select__option {
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
  }

  .header__mobile-actions .custom-select--language .custom-select__dropdown {
    left: 50%;
    right: auto;
    min-width: min(17rem, calc(100vw - 2rem));
    transform: translate(-50%, -10px);
  }

  .header__mobile-actions .custom-select--language.custom-select--open .custom-select__dropdown {
    transform: translate(-50%, 0);
  }
}

@media (max-width: 479.98px) {
  .custom-select__button {
    padding: 0.625rem;
    font-size: 0.8125rem;
    border-radius: 0.5rem;
    min-width: 54px;
  }

  .custom-select__arrow {
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #fff;
  }

  .custom-select__option {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }
}
