/*! kiltel-next.css | Author: Kilvish (Vasu Birla) | MIT */

/* Hide intl-tel-input default UI if loaded */
.iti,
.iti * {
  display: none !important;
}

/* Main phone input wrapper */
.kiltel-phone-wrap {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  position: relative;
}

/* Country selector trigger button */
.kiltel-country-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ced4da;
  border-right: none;
  background: #fff;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
  width: 54px;
  min-width: 48px;
  padding: 0 4px 0 2px;
  cursor: pointer;
  transition: border 0.2s, background 0.2s;
  outline: none;
  box-sizing: border-box;
}

.kiltel-country-trigger:hover {
  background: #f8f9fa;
}

.kiltel-country-trigger:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.kiltel-country-trigger img {
  width: 28px;
  height: 20px;
  border-radius: 3px;
  object-fit: cover;
}

.kiltel-country-trigger svg {
  margin-left: 3px;
  width: 14px;
  height: 12px;
}

/* Phone input field */
.form-control[data-kilvish-tel] {
  border: 1px solid #ced4da;
  border-left: none;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  flex: 1 1 0%;
  font-size: 1.09em;
  padding-left: 12px !important;
  box-sizing: border-box;
  min-width: 120px;
}

/* Country dropdown list */
.kiltel-country-list {
  position: absolute;
  left: 0;
  top: 110%;
  background: #fff;
  z-index: 999;
  max-height: 280px;
  min-width: 100%;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.11);
  border: 1px solid #ececec;
  padding: 0;
  animation: kiltelSlideIn 0.18s ease-out;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@keyframes kiltelSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Search wrapper inside dropdown */
.kiltel-country-search-wrap {
  padding: 10px 10px 8px 10px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  position: sticky;
  top: 0;
  z-index: 2;
}

.kiltel-country-search {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  font-size: 0.95em;
  outline: none;
  transition: border 0.2s;
}

.kiltel-country-search:focus {
  border-color: #86b7fe;
}

/* Scrollable options container */
.kiltel-country-options {
  overflow-y: auto;
  max-height: 220px;
  padding: 4px 0;
}

/* Individual country option */
.kiltel-country-option {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.13s;
}

.kiltel-country-option img {
  width: 22px;
  height: 16px;
  margin-right: 10px;
  border-radius: 2px;
  object-fit: cover;
}

.kiltel-country-option span {
  font-size: 0.95em;
  color: #333;
}

.kiltel-country-option:hover,
.kiltel-country-option.active {
  background: #f1f6ff;
}

.kiltel-country-option.active {
  font-weight: 500;
}

/* Separator between preferred and other countries */
.kiltel-country-separator {
  border-top: 1px solid #e0e0e0;
  margin: 4px 0;
}

/* Disabled state */
.kiltel-phone-wrap.disabled .kiltel-country-trigger {
  pointer-events: none;
  opacity: 0.65;
  background: #e9ecef;
}

.form-control[data-kilvish-tel]:disabled {
  background: #e9ecef;
  opacity: 0.65;
}

/* Error state */
.kiltel-phone-wrap.has-error .kiltel-country-trigger {
  border-color: #dc3545;
}

.kiltel-phone-wrap.has-error .form-control[data-kilvish-tel] {
  border-color: #dc3545;
}

/* Mobile responsive */
@media (max-width: 600px) {
  .kiltel-country-list {
    max-width: 98vw !important;
    left: 50%;
    transform: translateX(-50%);
  }
  
  .kiltel-country-option {
    padding: 10px 14px;
  }
}
