/* Dodo geo + phone: flag selects, responsive combo */
.dodo-geo-phone {
  --dodo-geo-border: #e2e8f0;
  --dodo-geo-border-focus: #3b82f6;
  --dodo-geo-bg: #fff;
  --dodo-geo-muted: #f1f5f9;
  --dodo-geo-text: #1e293b;
  --dodo-geo-hint: #64748b;
  --dodo-geo-radius: 10px;
  --dodo-geo-height: 48px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  width: 100%;
  margin-bottom: 4px;
}

.dodo-geo-phone__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin: 0 0 7px;
  letter-spacing: 0.01em;
}

.dodo-geo-phone__hint {
  display: block;
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--dodo-geo-hint);
}

/* Flag + select shell */
.dodo-flag-select {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--dodo-geo-height);
  background: var(--dodo-geo-bg);
  border: 1px solid var(--dodo-geo-border);
  border-radius: var(--dodo-geo-radius);
  transition: border-color .15s ease, box-shadow .15s ease;
  overflow: hidden;
}

.dodo-flag-select:focus-within {
  border-color: var(--dodo-geo-border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.dodo-flag-badge {
  flex: 0 0 auto;
  width: 28px;
  height: 20px;
  margin-left: 12px;
  border-radius: 3px;
  background-color: #e2e8f0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
  pointer-events: none;
}

.dodo-flag-select__control {
  flex: 1 1 auto;
  min-width: 0;
  height: var(--dodo-geo-height) !important;
  margin: 0 !important;
  padding: 0 32px 0 10px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--dodo-geo-text) !important;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  line-height: 1.3 !important;
}

.dodo-flag-select__control:focus {
  outline: none !important;
  box-shadow: none !important;
}

.dodo-flag-select__chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-right: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
  transform: rotate(45deg);
  pointer-events: none;
}

/* Phone combo: dial + number */
.dodo-phone-combo {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  min-height: var(--dodo-geo-height);
  border: 1px solid var(--dodo-geo-border);
  border-radius: var(--dodo-geo-radius);
  background: var(--dodo-geo-bg);
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.dodo-phone-combo:focus-within {
  border-color: var(--dodo-geo-border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.dodo-phone-combo .dodo-flag-select--dial {
  flex: 0 0 auto;
  width: min(148px, 42%);
  min-width: 118px;
  border: 0;
  border-radius: 0;
  border-right: 1px solid var(--dodo-geo-border);
  background: var(--dodo-geo-muted);
  box-shadow: none;
}

.dodo-phone-combo .dodo-flag-select--dial:focus-within {
  box-shadow: none;
}

.dodo-phone-combo .dodo-flag-badge {
  margin-left: 10px;
  width: 24px;
  height: 17px;
}

.dodo-phone-combo .dodo-flag-select__control {
  padding-left: 8px !important;
  padding-right: 28px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
}

.dodo-phone-combo__number,
.dodo-phone-field__number {
  flex: 1 1 auto;
  min-width: 0;
  height: var(--dodo-geo-height) !important;
  margin: 0 !important;
  padding: 0 14px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  color: var(--dodo-geo-text) !important;
}

.dodo-phone-combo__number:focus,
.dodo-phone-field__number:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Register page: country + phone side by side on wide screens */
.register-page-wrapper .dodo-geo-phone--with-country {
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

@media (min-width: 560px) {
  .register-page-wrapper .dodo-geo-phone--with-country {
    grid-template-columns: 1.05fr 1.2fr;
    align-items: start;
  }
}

/* Checkout */
.dodo-geo-phone--checkout {
  margin-bottom: 0;
}

.dodo-geo-phone--checkout .dodo-geo-phone__country,
.dodo-geo-phone--checkout .dodo-geo-phone__phone {
  margin-bottom: 0;
}

#order-vtcart .dodo-geo-phone--checkout {
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 768px) {
  #order-vtcart .dodo-geo-phone--checkout.dodo-geo-phone--with-country {
    grid-template-columns: 1fr 1.15fr;
  }
}

/* Compact mobile */
@media (max-width: 420px) {
  .dodo-phone-combo {
    flex-wrap: wrap;
  }
  .dodo-phone-combo .dodo-flag-select--dial {
    width: 100%;
    min-width: 0;
    border-right: 0;
    border-bottom: 1px solid var(--dodo-geo-border);
  }
  .dodo-phone-combo__number {
    width: 100%;
  }
}

/* Legacy class hooks */
.dodo-phone-field {
  width: 100%;
}
.form-group .dodo-geo-phone {
  margin-bottom: 0;
}
.form-group-modern > .dodo-geo-phone {
  margin-bottom: 0;
}
.form-group.prepend-icon .dodo-geo-phone .field-icon {
  display: none;
}
