| 1 |
/** |
| 2 |
* Country selector with flags. |
| 3 |
* |
| 4 |
* Deliberately mirrors assets/css/phone-input.css so the country field and the |
| 5 |
* phone country-code field look like the same control. The native <select> is |
| 6 |
* kept in the DOM (it still holds the value and submits with the form) but |
| 7 |
* visually hidden once the widget takes over. |
| 8 |
*/ |
| 9 |
|
| 10 |
.yatra-country-field { |
| 11 |
position: relative; |
| 12 |
display: block; |
| 13 |
width: 100%; |
| 14 |
} |
| 15 |
|
| 16 |
/* The original control still submits; it just stops being visible. */ |
| 17 |
.yatra-country-field .yatra-country-native { |
| 18 |
position: absolute; |
| 19 |
width: 1px; |
| 20 |
height: 1px; |
| 21 |
padding: 0; |
| 22 |
margin: -1px; |
| 23 |
overflow: hidden; |
| 24 |
clip: rect(0 0 0 0); |
| 25 |
white-space: nowrap; |
| 26 |
border: 0; |
| 27 |
} |
| 28 |
|
| 29 |
.yatra-country-trigger { |
| 30 |
display: flex; |
| 31 |
align-items: center; |
| 32 |
gap: 8px; |
| 33 |
width: 100%; |
| 34 |
padding: 10px 12px; |
| 35 |
background: #fff; |
| 36 |
border: 1px solid #d1d5db; |
| 37 |
border-radius: 8px; |
| 38 |
cursor: pointer; |
| 39 |
font-size: 15px; |
| 40 |
line-height: 1.4; |
| 41 |
color: #111827; |
| 42 |
text-align: left; |
| 43 |
transition: border-color 0.15s ease, box-shadow 0.15s ease; |
| 44 |
} |
| 45 |
|
| 46 |
.yatra-country-trigger:hover { |
| 47 |
border-color: #9ca3af; |
| 48 |
} |
| 49 |
|
| 50 |
.yatra-country-field.is-open .yatra-country-trigger, |
| 51 |
.yatra-country-trigger:focus-visible { |
| 52 |
outline: none; |
| 53 |
border-color: #2563eb; |
| 54 |
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); |
| 55 |
} |
| 56 |
|
| 57 |
.yatra-country-flag { |
| 58 |
flex-shrink: 0; |
| 59 |
width: 22px; |
| 60 |
height: 16px; |
| 61 |
object-fit: cover; |
| 62 |
border-radius: 2px; |
| 63 |
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); |
| 64 |
} |
| 65 |
|
| 66 |
.yatra-country-label { |
| 67 |
flex: 1 1 auto; |
| 68 |
overflow: hidden; |
| 69 |
text-overflow: ellipsis; |
| 70 |
white-space: nowrap; |
| 71 |
} |
| 72 |
|
| 73 |
.yatra-country-caret { |
| 74 |
flex-shrink: 0; |
| 75 |
color: #6b7280; |
| 76 |
transition: transform 0.15s ease; |
| 77 |
} |
| 78 |
|
| 79 |
.yatra-country-field.is-open .yatra-country-caret { |
| 80 |
transform: rotate(180deg); |
| 81 |
} |
| 82 |
|
| 83 |
.yatra-country-dropdown { |
| 84 |
position: absolute; |
| 85 |
z-index: 60; |
| 86 |
top: calc(100% + 4px); |
| 87 |
left: 0; |
| 88 |
right: 0; |
| 89 |
display: none; |
| 90 |
background: #fff; |
| 91 |
border: 1px solid #e5e7eb; |
| 92 |
border-radius: 8px; |
| 93 |
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12); |
| 94 |
overflow: hidden; |
| 95 |
} |
| 96 |
|
| 97 |
.yatra-country-field.is-open .yatra-country-dropdown { |
| 98 |
display: block; |
| 99 |
} |
| 100 |
|
| 101 |
.yatra-country-search-wrap { |
| 102 |
padding: 8px; |
| 103 |
border-bottom: 1px solid #f3f4f6; |
| 104 |
} |
| 105 |
|
| 106 |
.yatra-country-search { |
| 107 |
width: 100%; |
| 108 |
padding: 8px 10px; |
| 109 |
font-size: 14px; |
| 110 |
border: 1px solid #d1d5db; |
| 111 |
border-radius: 6px; |
| 112 |
box-sizing: border-box; |
| 113 |
} |
| 114 |
|
| 115 |
.yatra-country-search:focus { |
| 116 |
outline: none; |
| 117 |
border-color: #2563eb; |
| 118 |
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); |
| 119 |
} |
| 120 |
|
| 121 |
.yatra-country-list { |
| 122 |
max-height: 260px; |
| 123 |
margin: 0; |
| 124 |
padding: 4px 0; |
| 125 |
overflow-y: auto; |
| 126 |
list-style: none; |
| 127 |
} |
| 128 |
|
| 129 |
.yatra-country-option { |
| 130 |
display: flex; |
| 131 |
align-items: center; |
| 132 |
gap: 10px; |
| 133 |
padding: 8px 12px; |
| 134 |
cursor: pointer; |
| 135 |
font-size: 14px; |
| 136 |
color: #111827; |
| 137 |
} |
| 138 |
|
| 139 |
.yatra-country-option:hover, |
| 140 |
.yatra-country-option.is-active { |
| 141 |
background: #f3f4f6; |
| 142 |
} |
| 143 |
|
| 144 |
.yatra-country-option-name { |
| 145 |
flex: 1 1 auto; |
| 146 |
overflow: hidden; |
| 147 |
text-overflow: ellipsis; |
| 148 |
white-space: nowrap; |
| 149 |
} |
| 150 |
|
| 151 |
.yatra-country-empty { |
| 152 |
padding: 12px; |
| 153 |
font-size: 14px; |
| 154 |
color: #6b7280; |
| 155 |
text-align: center; |
| 156 |
} |
| 157 |
|
| 158 |
/* |
| 159 |
* Deliberately no `prefers-color-scheme` block. |
| 160 |
* |
| 161 |
* The booking form has no dark styling of its own (booking.css / common.css |
| 162 |
* define none), so reacting to the visitor's OS theme here would drop a dark |
| 163 |
* dropdown into an otherwise white form. The phone widget only darkens when the |
| 164 |
* theme opts in via `.yatra-phone-dark`; if a dark variant is ever wanted here, |
| 165 |
* follow that pattern with a `.yatra-country-dark` opt-in class rather than |
| 166 |
* keying off the operating system. |
| 167 |
*/ |
| 168 |
|