:root {
  --primary-color: #fffffc;
  --second-color: #0c2d57;
  --primary-title: #003184;
  --border: #e7e9ed;
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-size: 16px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  /* font-family: "Lilita One"; */
}

html,
body {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

header nav {
  height: auto;
  background-color: var(--primary-color);
  display: flex;
  flex-direction: row;
  align-items: center;
}

nav #img_igss {
  width: 25%;
  padding-left: 30px;
}

nav #t_igss {
  padding-left: 15px;
  color: var(--primary-title);
  font-size: 20px;
}

#search {
  display: flex;
  width: 100%;
  height: auto;
  padding-top: 50px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

#search h1 {
  font-size: 28px;
  color: var(--primary-title);
  padding-bottom: 20px;
}

.section_search {
  width: 70%;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.section_search #search_input {
  width: 100%;
  height: 55px;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding-left: 15px;
  font-size: 18px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.section_search .btn_group {
  display: flex;
  justify-content: center;
  gap: 20px;
  width: 100%;
}

.section_search .btn_search,
.section_search .btn_clear {
  width: 180px;
  height: 48px;
  background-color: var(--second-color);
  color: var(--primary-color);
  border-radius: 10px;
  font-size: 17px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.section_search .btn_search:hover,
.section_search .btn_clear:hover {
  background-color: var(--primary-title);
}

#cards {
  padding-top: 50px;
  padding-left: 200px;
  width: 90%;
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  grid-gap: 10px;
  align-content: center;
}

.card {
  width: 100%;
  height: 250px;
  perspective: 1000px;
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  background-color: var(--primary-color);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-front {
  z-index: 2;
}

.card-back {
  transform: rotateY(-180deg);
}

.card button {
  height: 30px;
  width: 80%;
  border: 2px solid var(--border);
  border-radius: 10px;
  margin-top: auto;
  align-self: center;
  font-size: 14px;
  font-weight: bold;
  background-color: var(--primary-color);
}

.card h2 {
  align-self: center;
  margin-bottom: 2px;
}

.card p:last-of-type {
  margin-bottom: 50px;
}

.contenedor-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 10px;
  align-content: center;
  padding: 10px;
}

.area-section {
  display: flex;
  flex-direction: column;
  background-color: var(--border);
  border: 2px solid var(--border);
  border-radius: 10px;
}

.area-section h2 {
  margin-bottom: 25px;
  align-self: center;
  cursor: pointer;
  position: relative;
  color: var(--primary-title);
  font-weight: 900;
}

.area-section h2::after {
  content: "▼";
  position: absolute;
  right: -30px;
  top: 0;
  font-size: 18px;
  transition: transform 0.3s ease;
}

.area-section h2.colapsado::after {
  transform: rotate(-90deg);
}

.area-section .contenedor-cards {
  overflow: hidden;
  transition: max-height 1.5s ease, opacity 1.5s ease;
  max-height: 10000px;
  opacity: 1;
}

.area-section .contenedor-cards.oculto {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.btn_subir {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--primary-color);
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 100%;
  width: 50px;
  height: 50px;
  font-size: 24px;
  text-align: center;
  line-height: 50px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn_subir:hover {
  cursor: pointer;
  background-color: var(--border);
  color: var(--primary-color);
}

footer {
  background-color: var(--second-color);
  color: var(--primary-color);
  padding: 25px 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 90%;
  max-width: 1000px;
  text-align: center;
}

.footer-left,
.footer-center,
.footer-right {
  flex: 1;
  text-align: center;
}

.footer-left p {
  font-size: 14px;
  color: var(--primary-color);
  opacity: 0.85;
}

.footer-center .footer-logo {
  width: 200px;
  height: auto;
}

.footer-right .footer-logo-r {
  width: 100px;
  height: auto;
}

footer strong {
  color: var(--primary-color);
}

/* --- media para celular footer--- */
@media (max-width: 600px) {
  .footer-container {
    flex-direction: column;
    gap: 10px;
  }

  .footer-left p,
  .footer-right p {
    font-size: 13px;
  }

  .footer-center .footer-logo {
    width: 60px;
  }
}


/* --- media para celular --- */
@media (max-width: 600px) {
  header nav {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: var(--primary-color);
  }

  nav #img_igss {
    width: 80%;
    max-width: 280px;
    height: auto;
    margin: 15px 0;
    padding: 0;
  }

  #search {
    width: 100%;
    padding: 15px;
    text-align: center;
    align-items: center;
    justify-content: center;
  }

  #search h1 {
    font-size: 17px;
    font-weight: bold;
    color: var(--primary-title);
    margin-bottom: 10px;
    line-height: 1.4;
  }

  .section_search {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .section_search #search_input {
    width: 90%;
    height: 45px;
    border-radius: 10px;
    font-size: 15px;
    padding: 5px 10px;
    margin-bottom: 10px;
  }

  .section_search .btn_group {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 90%;
  }

  .section_search button,
  .section_search .btn_search,
  .section_search .btn_clear {
    flex: 1;
    height: 45px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    color: var(--primary-color);
    background-color: var(--second-color);
    transition: background-color 0.3s ease;
  }

  .section_search button:hover,
  .section_search .btn_search:hover,
  .section_search .btn_clear:hover {
    background-color: var(--primary-title);
  }

  #cards {
    width: 100%;
    padding: 10px 0 40px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .area-section {
    width: 95%;
    margin-bottom: 20px;
    border-radius: 12px;
    background-color: var(--border);
    text-align: center;
  }

  .area-section h2 {
    display: inline-flex;             
    align-items: center;              
    justify-content: center;         
    gap: 6px;                         
    color: var(--primary-title);
    font-weight: 900;
    font-size: 18px;
    line-height: 1.2;
    margin: 15px auto 10px auto;
    padding-top: 6px;
    text-align: center;
    width: 100%;
  }

  .area-section h2::after {
    content: "▼";
    display: inline-block;
    font-size: 16px;
    color: var(--primary-title);
    position: relative;
    top: 1px;                         
    transform: rotate(0deg);
    transition: transform 0.3s ease;
  }

  .area-section h2.colapsado::after {
    transform: rotate(-90deg);
  }

  .contenedor-cards {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
    justify-items: center;
  }

  .card {
    width: 90%;
    height: auto;
    min-height: 220px;
    background-color: var(--primary-color);
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  }

  .card p {
    font-size: 14px;
    line-height: 1.3;
    text-align: left;
    margin: 4px 0;
  }

  .card button {
    width: 90%;
    height: 40px;
    font-size: 14px;
    margin: 8px auto;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: var(--primary-color);
    font-weight: bold;
  }

  .card h3 {
    font-size: 16px;
    color: var(--primary-title);
    text-align: center;
    margin-bottom: 6px;
  }

  .btn_subir {
    position: fixed;
    bottom: 15px;
    right: 15px;
    background-color: var(--primary-color);
    color: var(--second-color);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 20px;
    line-height: 45px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease;
  }

  .btn_subir:hover {
    background-color: var(--border);
  }
}



/* --- media para tablets --- */
@media (min-width: 601px) and (max-width: 1024px) {
  header nav {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: var(--primary-color);
  }

  nav #img_igss {
    width: 60%;
    max-width: 300px;
    height: auto;
    margin: 10px 0;
  }

  #search {
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  #search h1 {
    font-size: 20px;
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--primary-title);
  }

  .section_search {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;    
    gap: 10px;      
    margin-top: 10px;
    width: 85%;
    max-width: 800px;
  }

  .section_search #search_input {
    width: 60%;              
    height: 45px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 0 12px;
  }

  .section_search .btn_group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
  }

  .section_search button {
    flex: 1;
    height: 45px;
    min-width: 120px;
    font-size: 17px;
    border-radius: 8px;
    font-weight: bold;
    background-color: var(--second-color);
    color: var(--primary-color);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
  }

  .section_search button:hover {
    background-color: var(--primary-title);
  }

  #cards {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 15px 0 40px 0;
  }

  .area-section {
    width: 90%;
    margin-bottom: 25px;
    border-radius: 12px;
    background-color: var(--border);
    text-align: center;
    padding-bottom: 10px;
  }

  .area-section h2 {
    display: inline-flex;          
    align-items: center;             
    justify-content: center;        
    gap: 8px;
    color: var(--primary-title);
    font-weight: 900;
    font-size: 20px;
    line-height: 1.2;
    margin: 15px auto 10px auto;
    padding: 10px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 8px;
  }

  .area-section h2::after {
    content: "▼";
    display: inline-block;
    font-size: 16px;
    line-height: 1;
    color: var(--primary-title);
    transform: rotate(0deg);
    transition: transform 0.3s ease;
    position: relative;
    top: 1px;
  }

  .area-section h2.colapsado::after {
    transform: rotate(-90deg);
  }

  .contenedor-cards {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 10px 15px;
    justify-items: center;
    align-items: stretch;
    width: 100%;
  }

  .card {
    width: 90%;
    height: auto;
    min-height: 220px;
    background-color: var(--primary-color);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: transform 0.2s ease;
  }

  .card:hover {
    transform: scale(1.02);
  }

  .card h3 {
    font-size: 16px;
    color: var(--primary-title);
    text-align: center;
    margin-bottom: 8px;
  }

  .card p {
    font-size: 15px;
    line-height: 1.3;
    text-align: left;
    margin: 4px 10px;
  }

  .card button {
    width: 90%;
    height: 40px;
    font-size: 15px;
    margin: 10px auto;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: var(--primary-color);
    font-weight: bold;
    cursor: pointer;
  }

  .card button:hover {
    background-color: var(--border);
  }

  .btn_subir {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: var(--second-color);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 22px;
    line-height: 45px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease;
  }

  .btn_subir:hover {
    background-color: var(--border);
  }
}