/*=============== GOOGLE FONTS ===============*/
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500&display=swap");
/*=============== VARIABLES CSS ===============*/
:root {
  /*========== Colors ==========*/
  /*Color mode HSL(hue, saturation, lightness)*/
  --first-color: hsl(222, 80%, 58%);
  --dark-color: hsl(222, 24%, 8%);
  --title-color: hsl(222, 8%, 8%);
  --text-color-light: hsl(222, 8%, 65%);
  --white-color: #fff;
  --body-color: hsl(222, 100%, 99%);
  /*========== Font and typography ==========*/
  /*.5rem = 8px | 1rem = 16px ...*/
  --body-font: "Poppins", sans-serif;
  --small-font-size: .813rem;
}
@media screen and (min-width: 968px) {
  :root {
    --small-font-size: .875rem;
  }
}

/*=============== BASE ===============*/
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

body {
  background-color: var(--body-color);
}

/*=============== SEARCH ===============*/
.container {
  /* height: 100vh; */
  margin-inline: 1.5rem;
  display: grid;
  place-items: center;
}

.search {
  position: relative;
  width: 76px;
  height: 76px;
  background-color: var(--white-color);
  box-shadow: 0 4px 24px hsla(222, 68%, 12%, 0.2);
  padding: 10px;
  transition: width 0.5s cubic-bezier(0.9, 0, 0.3, 0.9);
  border-bottom: 5px solid #6132b4;
}
.search__input {
  border: none;
  outline: none;
  width: calc(100% - 64px);
  height: 100%;
  border-radius: 4rem;
  padding-left: 14px;
  font-family: var(--body-font);
  font-size: var(--small-font-size);
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.5s;
}
.search__input:-webkit-autofill {
  box-shadow: 0 0 0 100px var(--white-color) inset;
}
.search__button {
  width: 40px;
  height: 40px;
  background-color: var(--dark-color);
  border-radius: 50%;
  position: absolute;
  top: 0;
  bottom: 0;
  right: 10px;
  margin: auto;
  display: none;
  place-items: center;
  cursor: pointer;
  transition: transform 0.6s cubic-bezier(0.9, 0, 0.3, 0.9);
}
.search__icon, .search__close {
  color: var(--white-color);
  font-size: 1rem;
  position: absolute;
  transition: opacity 0.5s cubic-bezier(0.9, 0, 0.3, 0.9);
}
.search__close {
  opacity: 0;
}

/* Search animated */
.show-search {
  width: 350px;
}

.show-search .search__input {
  opacity: 1;
  pointer-events: initial;
}

.show-search .search__icon {
  opacity: 0;
}
.show-search .search__close {
  opacity: 1;
}

.error-message {
    color: #dc2626;
    font-size: 14px;
    margin-top: 8px;
    display: none;
    text-align: center;
}

.search-container {
    position: relative;
}

.btn_track {
  margin-top: 10px;
}

.clear-button {
    position: absolute;
    right: 45px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
}

.clear-button:hover {
    color: #dc2626;
}
/* clears the 'X' from Internet Explorer */
input[type=search]::-ms-clear {  display: none; width : 0; height: 0; }
input[type=search]::-ms-reveal {  display: none; width : 0; height: 0; }

/* clears the 'X' from Chrome */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration { display: none; }

/*=============== BREAKPOINTS ===============*/
/* For medium devices */
@media screen and (max-width: 576px) {
  .show-search {
    width: 80vw;
  }

  .error-message {
   text-align: center;
}
}