_header.scss 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  1. // Import Sass modules for variables, mixins, and map functions
  2. @use '../abstracts/variables' as v;
  3. @use '../abstracts/mixins' as mix;
  4. @use 'sass:map';
  5. // Main header component with fixed positioning and responsive behavior
  6. .header {
  7. position: fixed; // Stays at top when scrolling
  8. top: 0px;
  9. width: 100%;
  10. padding: map.get(v.$spacers, 3) 0;
  11. z-index: map.get(v.$z-indices, 'navbar'); // High z-index to stay above content
  12. height: 85px;
  13. .container {
  14. position: relative;
  15. // Tablet/Mobile: Flexbox layout with three main elements
  16. // Layout order: Logo - Button - Toggle
  17. @include mix.respond-to-max('md') {
  18. @include mix.flex(row, space-between, center);
  19. }
  20. }
  21. .logo {
  22. height: 35px;
  23. z-index: 1001;
  24. @include mix.respond-to-max('md') {
  25. width: 35%;
  26. height: 45px;
  27. }
  28. @include mix.respond-to-min('xl') {
  29. width: 20%;
  30. height: 55px;
  31. max-width: 200px;
  32. }
  33. .image {
  34. width: 100%;
  35. height: 100%;
  36. object-fit: contain;
  37. }
  38. .overlay-link {
  39. position: absolute;
  40. top: 0;
  41. left: 0;
  42. width: 100%;
  43. height: 100%;
  44. z-index: 1;
  45. }
  46. }
  47. .navbar {
  48. @include mix.respond-to-min('md-c') {
  49. position: static;
  50. background: transparent;
  51. height: auto;
  52. }
  53. @include mix.respond-to-max('md-c') {
  54. position: fixed;
  55. left: 0;
  56. top: -100vh;
  57. width: 100%;
  58. height: 100vh;
  59. background-color: rgba(v.$black, 0.95);
  60. backdrop-filter: blur(10px);
  61. @include mix.flex(column, flex-start, flex-start);
  62. z-index: 1000;
  63. @include mix.transition(top 0.3s ease);
  64. padding-top: 80px;
  65. overflow-y: auto;
  66. &.mobile-menu-open {
  67. top: 0;
  68. }
  69. }
  70. .nav-menu {
  71. @include mix.flex(row, flex-start, center);
  72. gap: 10px;
  73. list-style: none;
  74. margin: 0;
  75. padding: 0;
  76. width: 100%;
  77. @include mix.respond-to-min('md-c') {
  78. @include mix.flex-direction(row);
  79. gap: 30px;
  80. }
  81. @include mix.respond-to-max('md-c') {
  82. @include mix.flex-direction(column);
  83. @include mix.align-items(flex-start);
  84. gap: 0;
  85. text-align: left;
  86. padding: 0 map.get(v.$spacers, 4);
  87. max-width: 400px;
  88. margin: 0 auto;
  89. }
  90. > li {
  91. @include mix.respond-to-max('md-c') {
  92. width: 100%;
  93. }
  94. @include mix.respond-to-min('md-c') {
  95. width: auto;
  96. }
  97. }
  98. .nav-link {
  99. color: v.$white;
  100. text-decoration: none;
  101. font-weight: map.get(v.$font-weights, 'medium');
  102. @include mix.transition(v.$transition-base);
  103. position: relative;
  104. display: block;
  105. @include mix.respond-to-min('md-c') {
  106. padding: 5px 0;
  107. font-size: map.get(v.$font-sizes, 'base');
  108. }
  109. @include mix.respond-to-max('md-c') {
  110. padding: map.get(v.$spacers, 3) 0;
  111. font-size: map.get(v.$font-sizes, 'md-c');
  112. width: 100%;
  113. border-bottom: 1px solid rgba(v.$white, 0.1);
  114. }
  115. &::after {
  116. content: '';
  117. position: absolute;
  118. bottom: 0;
  119. left: 50%;
  120. width: 0;
  121. height: 2px;
  122. background-color: v.$primary;
  123. @include mix.transition(all 0.3s ease);
  124. @include mix.transform(translateX(-50%));
  125. @include mix.respond-to-max('md-c') {
  126. display: none;
  127. }
  128. }
  129. &:hover, &.active {
  130. color: v.$primary;
  131. &::after {
  132. width: 100%;
  133. }
  134. }
  135. }
  136. .dropdown {
  137. position: relative;
  138. @include mix.respond-to-max('md-c') {
  139. width: 100%;
  140. }
  141. .dropdown-toggle {
  142. cursor: pointer;
  143. color: v.$white;
  144. text-decoration: none;
  145. font-weight: map.get(v.$font-weights, 'medium');
  146. @include mix.transition(v.$transition-base);
  147. position: relative;
  148. display: block;
  149. @include mix.respond-to-min('md-c') {
  150. padding: 5px 0;
  151. font-size: map.get(v.$font-sizes, 'base');
  152. }
  153. @include mix.respond-to-max('md-c') {
  154. padding: map.get(v.$spacers, 3) 0;
  155. font-size: map.get(v.$font-sizes, 'md-c');
  156. width: 100%;
  157. border-bottom: 1px solid rgba(v.$white, 0.1);
  158. @include mix.flex(row, space-between, center);
  159. }
  160. &::after {
  161. content: '▼';
  162. font-size: 10px;
  163. @include mix.transition(transform 0.3s ease);
  164. @include mix.respond-to-min('md-c') {
  165. position: relative;
  166. left: 5px;
  167. }
  168. @include mix.respond-to-max('md-c') {
  169. font-size: 12px;
  170. }
  171. }
  172. &.active::after {
  173. @include mix.transform(rotate(180deg));
  174. }
  175. &::before {
  176. content: '';
  177. position: absolute;
  178. bottom: 0;
  179. left: 50%;
  180. width: 0;
  181. height: 2px;
  182. background-color: v.$primary;
  183. @include mix.transition(all 0.3s ease);
  184. @include mix.transform(translateX(-50%));
  185. @include mix.respond-to-max('md-c') {
  186. display: none;
  187. }
  188. }
  189. &:hover {
  190. color: v.$primary;
  191. &::before {
  192. width: 100%;
  193. }
  194. }
  195. }
  196. .dropdown-menu {
  197. list-style: none;
  198. margin: 0;
  199. padding: 0;
  200. @include mix.respond-to-max('md-c') {
  201. position: static;
  202. background-color: rgba(v.$white, 0.05);
  203. backdrop-filter: blur(10px);
  204. margin-left: map.get(v.$spacers, 3);
  205. border-left: 2px solid rgba(v.$primary, 0.3);
  206. opacity: 0;
  207. visibility: hidden;
  208. max-height: 0;
  209. overflow: hidden;
  210. @include mix.transition(all 0.3s ease);
  211. &.dropdown-open {
  212. opacity: 1;
  213. visibility: visible;
  214. max-height: 500px;
  215. padding: map.get(v.$spacers, 2) 0;
  216. margin-top: map.get(v.$spacers, 2);
  217. }
  218. }
  219. @include mix.respond-to-min('md-c') {
  220. position: absolute;
  221. top: 140%;
  222. left: -10px;
  223. @include mix.transform(translateY(-10px));
  224. background-color: v.$white;
  225. @include mix.box-shadow(v.$box-shadow-lg);
  226. min-width: 180px;
  227. padding: map.get(v.$spacers, 2) 0;
  228. z-index: map.get(v.$z-indices, 'dropdown');
  229. opacity: 0;
  230. visibility: hidden;
  231. @include mix.transition(v.$transition-base);
  232. }
  233. .dropdown-item {
  234. display: block;
  235. padding: map.get(v.$spacers, 2) map.get(v.$spacers, 3);
  236. text-decoration: none;
  237. font-family: v.$font-family-sans;
  238. font-weight: map.get(v.$font-weights, 'regular');
  239. @include mix.transition(v.$transition-base);
  240. @include mix.respond-to-max('md-c') {
  241. color: v.$white;
  242. font-size: map.get(v.$font-sizes, 'base');
  243. text-align: left;
  244. border-bottom: 1px solid rgba(v.$white, 0.05);
  245. &:last-child {
  246. border-bottom: none;
  247. }
  248. }
  249. @include mix.respond-to-min('md-c') {
  250. color: v.$dark-gray;
  251. font-size: map.get(v.$font-sizes, 'sm');
  252. }
  253. &:hover {
  254. background-color: rgba(v.$primary, 0.1);
  255. color: v.$primary;
  256. padding-left: map.get(v.$spacers, 4);
  257. @include mix.respond-to-max('md-c') {
  258. background-color: rgba(v.$primary, 0.2);
  259. }
  260. }
  261. }
  262. }
  263. @include mix.respond-to-min('md-c') {
  264. &:hover {
  265. .dropdown-toggle {
  266. color: v.$primary;
  267. &::before {
  268. width: 100%;
  269. }
  270. }
  271. .dropdown-menu {
  272. opacity: 1;
  273. visibility: visible;
  274. @include mix.transform(translateY(0));
  275. }
  276. }
  277. }
  278. }
  279. }
  280. }
  281. .actions {
  282. .theme-switcher {
  283. margin: 0 1rem;
  284. .theme-toggle-btn {
  285. background-color: var(--color-surface);
  286. border: 1px solid var(--color-border);
  287. border-radius: 50%;
  288. cursor: pointer;
  289. width: 40px;
  290. height: 40px;
  291. @include mix.flex(column, center, center);
  292. padding: 5px;
  293. transition: all 0.3s ease;
  294. &:hover {
  295. border-color: var(--color-primary);
  296. }
  297. svg {
  298. width: 22px;
  299. height: 22px;
  300. color: var(--color-primary);
  301. transition: color 0.3s ease;
  302. }
  303. }
  304. .moon-icon {
  305. display: none;
  306. }
  307. .dark-mode {
  308. .moon-icon {
  309. display: block;
  310. }
  311. .sun-icon {
  312. display: none;
  313. }
  314. }
  315. }
  316. .btn-get-quotes {
  317. white-space: nowrap;
  318. z-index: 1001;
  319. visibility: visible;
  320. @include mix.respond-to-max('md') {
  321. visibility: hidden;
  322. }
  323. }
  324. }
  325. .mobile-menu-toggle {
  326. @include mix.flex(column, center, center);
  327. width: 30px;
  328. height: 30px;
  329. background: transparent;
  330. border: none;
  331. cursor: pointer;
  332. z-index: 1001;
  333. position: relative;
  334. @include mix.respond-to-min('md-c') {
  335. display: none;
  336. }
  337. @include mix.respond-to-max('md-c') {
  338. order: 3;
  339. }
  340. .hamburger-line {
  341. width: 25px;
  342. height: 3px;
  343. background-color: v.$white;
  344. margin: 2px 0;
  345. @include mix.transition(v.$transition-smooth);
  346. transform-origin: center;
  347. &:nth-child(1) {
  348. @include mix.transform(translateY(0));
  349. }
  350. &:nth-child(2) {
  351. opacity: 1;
  352. }
  353. &:nth-child(3) {
  354. @include mix.transform(translateY(0));
  355. }
  356. }
  357. &.active {
  358. .hamburger-line {
  359. background-color: v.$white !important;
  360. &:nth-child(1) {
  361. @include mix.transform(translateY(7px) rotate(45deg));
  362. }
  363. &:nth-child(2) {
  364. opacity: 0;
  365. }
  366. &:nth-child(3) {
  367. @include mix.transform(translateY(-7px) rotate(-45deg));
  368. }
  369. }
  370. }
  371. }
  372. &.header-transparent {
  373. background-color: transparent;
  374. @include mix.transition(all 0.4s);
  375. }
  376. &.header-scrolled {
  377. background-color: var(--color-surface);
  378. @include mix.box-shadow(v.$box-shadow);
  379. @include mix.transition(all 0.4s);
  380. .mobile-menu-toggle .hamburger-line {
  381. background-color: var(--menu-icon-color);
  382. }
  383. .navbar .nav-menu .nav-link {
  384. @include mix.respond-to-min('md-c') {
  385. color: var(--color-text-primary);
  386. }
  387. @include mix.respond-to-max('md-c') {
  388. color: v.$white;
  389. }
  390. &:hover, &.active {
  391. color: v.$primary;
  392. }
  393. }
  394. .navbar .nav-menu .dropdown .dropdown-toggle {
  395. @include mix.respond-to-min('md-c') {
  396. color: var(--color-text-primary);
  397. }
  398. @include mix.respond-to-max('md-c') {
  399. color: v.$white;
  400. }
  401. &:hover {
  402. color: v.$primary;
  403. }
  404. }
  405. }
  406. }