:root {
  --border-clr: #ccc;
  --primary-clr: #3366ff;
  --background-light: #f8f8fa;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "DM Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0rem;
  padding: 0.45rem 1rem;
}

.logo img {
  height: auto;
  width: 145px;
}

/* header menu MOBILE VERSION  */

/* header menu  */
.menu-container .register {
  display: inline-block;
  text-decoration: none;
  border: 1px solid black;
  color: black;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: bold;
}

.menu-container .register:hover {
  border: 1px solid var(--primary-clr);
  color: var(--primary-clr);
}

.menu-button {
  border: none;
  background: none;
  cursor: pointer;
}

#mobile-menu {
  display: none;
  border: 1px solid #ccc;
  width: 100%;
}

#mobile-menu a {
  display: inline-block;
  text-decoration: none;
  color: #333;
  height: 100%;
  width: 100%;
  padding: 1rem 0.5rem;
}

#mobile-menu a:hover {
  background: #333;
  color: #fff;
}
.hidden-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.search-hostel-form {
  max-width: 620px;
  margin: 0 auto;
}

.input-group {
  display: flex;
  width: 100%;
}

.input-group input,
.input-group button {
  height: 40px;
  padding: 0 1rem;
  font-size: 1rem;
  box-sizing: border-box;
}

.input-group input {
  flex: 1;
}

.input-group button {
  flex-shrink: 0;
}

.search-hostel-form input {
  border: 1px solid var(--border-clr);
  border-bottom-left-radius: 0.75rem;
  border-top-left-radius: 0.75rem;
  border-right: none;
  padding: 1rem;
  color: #333;
}

.search-hostel-form input:focus {
  outline: none;
}

.search-hostel-form button {
  background: white;
  border: 1px solid var(--border-clr);
  padding: 0 1rem;
  border-bottom-right-radius: 1rem;
  border-top-right-radius: 1rem;
  border-left: none;
  cursor: pointer;
}

/* Seccion principal */
.hero {
  min-height: calc(100vh - 65px);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 4rem 1rem 2rem 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.hero h1 {
  font-weight: 900;
  text-align: center;
  color: var(--primary-clr);
  max-width: 500px;
  margin-bottom: 0.5rem;
}

.hero h1,
.main-title,
section h1,
article h1,
nav h1,
aside h1 {
  font-size: 2.55rem;
}

.hero h2 {
  font-size: 0.875rem;
  text-align: center;
  color: #333;
}

.hero p {
  font-size: 0.95rem;
}

.hero .card-container {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 900px;
}

.hero .card-container .card-item {
  max-width: 350px;
}

/* Trending list  */
#trendingLoading {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid #ccc;
  border-top: 2px solid #333;
  border-radius: 50%;
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.trending {
  padding: 1rem 0;
}

.trending h3 {
  font-size: 1rem;
  font-weight: 500;
}

.trending ul {
  margin-left: 0;
  list-style: none;
  font-size: 0.875rem;
}

.trending ul li {
  border-bottom: 1px solid #ccc;
  padding: 0.875rem 0;
}

.trending ul li a {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
  color: #333;
}

.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto 3rem auto;
  padding: 2rem;
}

.card-container .card-item {
  border: 1px solid var(--border-clr);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.1);
}

.card-container .card-title {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.card-title span {
  font-size: 3.75rem;
}

.card-title h3 {
  font-size: 1.35rem;
}

.register-link {
  display: inline-block;
  margin-top: 1rem;
  border: 1px solid var(--primary-clr);
  border-radius: 1rem;
  padding: 0.35rem 1rem;
  cursor: pointer;
  color: var(--primary-clr);
  font-weight: 400;
  text-decoration: none;
}

.register-link:hover {
  background-color: var(--primary-clr);
  color: white;
}

.more-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.more-info a {
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--border-clr);
  border-radius: 50%;
  padding: 0.75rem;
  cursor: pointer;
}

.more-info a:hover {
  background-color: #555;
  border: 1px solid #555;
}

.more-info a svg {
  stroke: #555;
}

.more-info a:hover svg {
  stroke: #fff;
}

/* Secciones secundarias  */

.section-content {
  max-width: 1536px;
  margin: auto;
  padding: 3rem 2rem;
}

.p-center {
  text-align: center;
  margin: 0 auto;
}

section:nth-child(even) {
  background-color: aliceblue;
}

.section-content.first p {
  max-width: 960px;
  text-align: center;
  margin: 0 auto;
}

.section-content h2 {
  font-size: clamp(1.875rem, 4vw, 2.25rem);
  text-align: center;
  margin-bottom: 1rem;
}

.section-content p {
  font-size: 1rem;
}

/* sección Como Funciona */
.how-it-works-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.how-it-works-list li {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-radius: 8px;
  box-shadow: 1px 1px rgba(0, 0, 0, 0.1);
  background-color: white;
}

.how-it-works-list li div:last-child {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.how-it-works-list li svg {
  flex-grow: 1;
  stroke: var(--primary-clr);
  width: 45px;
  height: 45px;
  stroke-width: 1.5;
}

.how-it-works-list p {
  font-size: 0.875rem;
}

.bold {
  font-weight: 600;
}

/* Card places */
.container-places {
  display: flex;
  gap: 1rem;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  overflow: scroll;
}

.card_places {
  position: relative;
  cursor: pointer;
}

.card_places p {
  position: absolute;
  bottom: 10px;
  left: 10px;
  color: white;
  font-weight: 600;
  font-size: 1.15rem;
}

.card_places img {
  width: 255px;
  height: 170px;
  object-fit: cover;
  border-radius: 1rem;
}

/* Seccion beneficios */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.item-flex-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.1);
  background-color: #fff;
}

.item-flex-column span {
  font-size: 2.25rem;
}

/* seccion seleccion viajero hostel */
.flex-row-wrap-center {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.choose-path {
  display: flex;
  flex-direction: column;
  max-width: 450px;
  height: 350px;
  border: 1px solid var(--border-clr);
  border-radius: 10px;
  box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.choose-path img {
  width: 100%;
  object-fit: cover;
  height: 45%;
}

.inner-content {
  padding: 1rem;
  display: flex;
  height: 55%;
  flex-direction: column;
  justify-content: space-between;
}

.inner-content a {
  background-color: var(--primary-clr);
  text-decoration: none;
  border-radius: 5px;
  padding: 0.75rem;
  text-align: center;
  color: #fff;
  cursor: pointer;
}

.inner-content a:hover {
  opacity: 0.8;
}

/* Seccion Descubri Hostels Destinos  */
.destination-list h3 {
  margin-bottom: 0.75rem;
}

.destination-list ul {
  list-style: none;
}

.destination-list ul li {
  margin-bottom: 0.5rem;
}

.destination-list ul li a {
  color: #333;
  text-decoration: none;
  font-size: 0.95rem;
}

/* Seccion Lo ultimo del blog */
.last-articles {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.b-card {
  max-width: 400px;
  list-style: none;
}

.b-card a {
  text-decoration: none;
  color: #111;
}

.b-card img {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.b-card h3 {
  text-align: center;
  padding: 0.5rem;
  font-size: 1.4rem;
}

.button-link {
  border: 1px solid var(--primary-clr);
  border-radius: 1rem;
  text-decoration: none;
  color: var(--primary-clr);
  font-size: 0.875rem;
  display: block;
  max-width: fit-content;
  margin: 3rem auto;
  padding: 0.5rem 1rem;
}

/* Terminos y condiciones */
.terms-container {
  max-width: 900px;
  margin: 1rem auto 6rem auto;
  padding: 2rem 1rem;
}

.terms-container h1 {
  text-align: center;
  margin-bottom: 2rem;
}

.terms-container h2 {
  margin: 2rem 0 1rem 0;
}

.terms-container h3 {
  margin: 1rem 0 0.75rem 0;
}

.terms-container ul {
  margin-left: 2rem;
  margin-top: 0.75rem;
}

.terms-container p + p {
  margin-top: 1rem;
}

/* Preguntas frecuentas  */

.faq {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
  color: #2c2c2c;
}

.faq details {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  background-color: white;
  transition: all 0.3s ease;
}

.faq summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 1.5rem;
  margin-bottom: 0.5rem;
}

.faq details ul {
  margin-left: 2rem;
  margin-top: 0.5rem;
}

.faq summary::marker {
  display: none;
}

.faq summary::after {
  content: "➕";
  position: absolute;
  right: 0;
  font-size: 1.2rem;
  transition: transform 0.3s;
}

.faq details[open] summary::after {
  content: "➖";
}

/* Footer */
footer {
  background-color: #121212;
  color: #fff;
  padding: 2rem 1rem;
}

footer a {
  color: #fff;
}

footer h3 {
  text-align: center;
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

footer p {
  text-align: center;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.important {
  text-align: center;
  margin: 2rem auto;
  padding: 1rem;
  max-width: 800px;
}

.important h4 {
  font-size: 1.15rem;
  margin-bottom: 1rem;
}

.social-links ul {
  list-style: none;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 450px;
  margin: 3rem auto;
}

.social-links svg {
  stroke: #fff;
  width: 30px;
  height: 30px;
  stroke-width: 1;
}

.more {
  margin: 2.25rem 0;
}

.more ul {
  list-style: none;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}

.more li + li::before {
  content: "|";
  margin-right: 1rem;
}

.more ul a {
  text-decoration: none;
}

/* Media queries */
@media (min-width: 768px) {
  header {
    flex-wrap: nowrap;
  }

  .logo img {
    height: auto;
    width: 180px;
  }

  /* header menu  */
  .menu-container .register {
    display: inline-block;
    text-decoration: none;
    border: 1px solid black;
    color: black;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: bold;
  }

  .container-places {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    max-width: 900px;
    margin: 0 auto;
  }
}
