/* PointTurkey phone fields (phone.css), paired with js/phone.js. Owner: phone agent. Prefix ptp-.
   Layout: [flag +90 v] [ national number        (v) ]  - the country button is its own control next to the page's input,
   so each page keeps its own .pt-input look. Phones (< 600 px): the country list is a full-height sheet. */

/* before phone.js runs, keep tel inputs left-to-right (numbers are LTR in every language) */
input[type="tel"][data-pt-phone] { direction: ltr; }

.ptp { position: relative; display: flex; align-items: stretch; gap: 8px; width: 100%; min-width: 0; }
.ptp > .ptp-input { flex: 1 1 auto; min-width: 0; width: auto; padding-inline-end: 40px; font-variant-numeric: tabular-nums; letter-spacing: .01em; }

.ptp-cc {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; min-height: 48px; min-width: 44px; padding: 0 10px 0 12px;
  border: 1px solid var(--pt-gray-300, #d2d2cc); border-radius: var(--pt-r, 12px); background: var(--pt-surface, #fff);
  color: var(--pt-text, #171716); font: inherit; font-size: 1rem; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.ptp-cc:hover { border-color: var(--pt-gray-400, #a3a39d); background: var(--pt-gray-25, #fcfcfb); }
.ptp-cc:focus-visible { outline: none; border-color: var(--pt-red-600, #cf1f1d); box-shadow: 0 0 0 4px var(--pt-ring, rgba(207, 31, 29, .32)); }
.ptp-cc[aria-expanded="true"] { border-color: var(--pt-red-600, #cf1f1d); box-shadow: 0 0 0 4px var(--pt-ring, rgba(207, 31, 29, .32)); }
.ptp-cc[disabled] { cursor: default; background: var(--pt-gray-50, #f7f7f5); color: var(--pt-text-2, #55554f); }
.ptp-cc[disabled] .ptp-chev { display: none; }
.ptp-cc__flag { display: inline-flex; }
.ptp-cc__dial { font-weight: 600; white-space: nowrap; }
.ptp-chev { color: var(--pt-text-2, #55554f); transition: transform .15s; }
.ptp-cc[aria-expanded="true"] .ptp-chev { transform: rotate(180deg); }

.ptp-flag { display: block; width: 21px; height: 14px; border-radius: 2px; object-fit: cover; flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(23, 23, 22, .12); background: var(--pt-gray-100, #efefec); }
.ptp-flag--none { visibility: hidden; }

/* validity mark inside the input's end */
.ptp-mark { position: absolute; inset-inline-end: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%;
  pointer-events: none; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s; }
.ptp[data-state="valid"] .ptp-mark { opacity: 1; transform: none; background: var(--pt-success, #15803d)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5.5 10.5 3 3 6-7'/%3E%3C/svg%3E") center / 14px no-repeat; }
.ptp[data-state="invalid"] .ptp-mark { opacity: 1; transform: none; background: var(--pt-danger, #9f1239)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M10 5.5v5.5M10 14.5v.01'/%3E%3C/svg%3E") center / 14px no-repeat; }
.ptp[data-state="invalid"] > .ptp-input { border-color: var(--pt-danger, #9f1239); }

.ptp-hint { display: block; min-height: 0; font-size: .8125rem; line-height: 1.35; color: var(--pt-text-2, #55554f); }
.ptp-hint:empty { display: none; }
.ptp-hint.is-ok { color: var(--pt-success, #15803d); }
.ptp-hint.is-bad { color: var(--pt-danger, #9f1239); }
.pt-field > .ptp-hint, .au-field > .ptp-hint { margin-top: 4px; }

/* ---------- country list: dropdown (desktop) ---------- */
.ptp-pop {
  position: absolute; z-index: var(--pt-z-modal, 80); display: flex; flex-direction: column; overflow: hidden;
  background: var(--pt-surface, #fff); color: var(--pt-text, #171716); border: 1px solid var(--pt-border, #e4e4e0);
  border-radius: var(--pt-r-lg, 16px); box-shadow: var(--pt-shadow-lg, 0 24px 48px -16px rgba(17, 17, 16, .22));
  animation: ptp-in .14s ease-out;
}
.ptp-pop[hidden], .ptp-backdrop[hidden] { display: none; }
.ptp-pop__head { display: none; }
.ptp-pop__searchwrap { padding: 10px; border-bottom: 1px solid var(--pt-border, #e4e4e0); }
.ptp-pop__search.pt-input { min-height: 44px; padding: 9px 12px 9px 38px; border-radius: var(--pt-r-sm, 8px);
  background: var(--pt-gray-50, #f7f7f5) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2355554f' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 12px center no-repeat; }
.ptp-pop__search.pt-input:focus { background-color: var(--pt-surface, #fff); }
.ptp-pop__search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.ptp-pop__list { list-style: none; margin: 0; padding: 4px 6px 8px; overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; }
.ptp-group { position: sticky; top: -4px; z-index: 1; padding: 10px 10px 6px; font-size: .75rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--pt-text-3, #6b6b65); background: var(--pt-surface, #fff); }
.ptp-opt { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 10px; border-radius: var(--pt-r-sm, 8px); cursor: pointer; }
.ptp-opt.is-active { background: var(--pt-gray-100, #efefec); }
.ptp-opt[aria-selected="true"] { font-weight: 600; }
.ptp-opt[aria-selected="true"]::after { content: ""; width: 16px; height: 16px; flex: 0 0 auto; margin-inline-start: -4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23ad1917' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 10.5 3.5 3.5 7-8'/%3E%3C/svg%3E") center / 16px no-repeat; order: 3; }
.ptp-opt__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptp-opt__code { flex: 0 0 auto; color: var(--pt-text-2, #55554f); font-variant-numeric: tabular-nums; font-weight: 400; }
.ptp-pop__empty { margin: 0; padding: 18px 16px 22px; color: var(--pt-text-2, #55554f); text-align: center; }
.ptp-pop__empty[hidden] { display: none; }

/* ---------- country list: full-height sheet (phones) ---------- */
.ptp-backdrop { position: fixed; inset: 0; z-index: calc(var(--pt-z-modal, 80) - 1); background: var(--pt-overlay, rgba(23, 23, 22, .5));
  animation: ptp-fade .18s ease-out; }
.ptp-pop.ptp-pop--sheet {
  position: fixed; inset: 0; top: max(env(safe-area-inset-top), 0px); width: auto; max-height: none; border: 0; border-radius: 0;
  padding-bottom: env(safe-area-inset-bottom); animation: ptp-up .22s cubic-bezier(.2, .8, .2, 1);
}
.ptp-pop--sheet .ptp-pop__head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 0 20px; min-height: 56px; }
.ptp-pop__title { margin: 0; font-family: var(--pt-font-display, inherit); font-weight: 700; font-size: 1.125rem; }
.ptp-pop__close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--pt-text, #171716);
  font-size: 1.75rem; line-height: 1; cursor: pointer; }
.ptp-pop__close:hover { background: var(--pt-gray-100, #efefec); }
.ptp-pop__close:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--pt-ring, rgba(207, 31, 29, .32)); }
.ptp-pop--sheet .ptp-pop__searchwrap { padding: 8px 16px 12px; }
.ptp-pop--sheet .ptp-pop__search.pt-input { min-height: 48px; font-size: 1rem; }  /* 16px: no iOS zoom */
.ptp-pop--sheet .ptp-pop__list { padding: 4px 10px 16px; }
.ptp-pop--sheet .ptp-opt { min-height: 52px; font-size: 1rem; }
html.ptp-lock, html.ptp-lock body { overflow: hidden; }

@keyframes ptp-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes ptp-up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes ptp-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .ptp-pop, .ptp-pop.ptp-pop--sheet, .ptp-backdrop { animation: none; }
  .ptp-cc, .ptp-mark, .ptp-chev { transition: none; }
}
@media (forced-colors: active) {
  .ptp-opt.is-active { outline: 2px solid Highlight; }
  .ptp-mark { forced-color-adjust: none; }
}
@media (max-width: 360px) {
  .ptp { gap: 6px; }
  .ptp-cc { padding: 0 8px 0 10px; gap: 5px; }
}
