/* Limpieza general del navegador */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

/* Escala de tamaño de textos */
html {
  font-size: 18px;
}

/* Diseño responsive */
@media (max-width: 590px) {
  /* Menu desplegable pantallas pequeñas */
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
  }
  
  .logo {
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
  }

  .logo img {
    width: 1.5rem;
    height: 1.5rem;
  }

  .logo span {
    font-size: 1rem;
    text-align: center;
  }

  .menu {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }

  .menu li {
    width: 100%;
  }

  .menu a {
    display: block;
    width: 100%;
    padding: 0;
    font-size: 0.7rem;
  }

  .submenu-item {
    position: static;
    top: 0;
    left: 0;
    margin-top: -0.5rem;
    background-color: black;
    width: 100%;
    padding: 0;
    z-index: 10; /*Sobrepone el submenu*/
  }

  .submenu-item li a {
    padding: 0.2rem 0.75rem;
    font-size: 0.7rem;
  }

  .portada img {
    padding-top: 2rem;
  }
}

/* Encabezado */
.header {
  position: relative;
}

.topbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: black;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1.5rem;
  z-index: 1000;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo img {
  width: 2rem;
  height: 2rem;
}

.logo span {
  font-size: 1.2rem;
  font-weight: bold;
}

.menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.menu a, 
.menu button {
  font-size: clamp(0.8rem, 2vw, 1rem);
  position: relative;
  padding: 0.8rem;
  color: white;
  text-decoration: none;
}

.menu a:hover,
.menu button:hover {
  background-color: #494949;
}

/* Ocultar traductor original de Google */
.goog-te-banner-frame.skiptranslate,
.goog-te-gadget-icon,
.goog-logo-link,
.goog-te-gadget span {
  display: none !important;
}

/* Menu desplegable pantallas grandes */
.submenu {
  position: relative;
}

.submenu-item {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: black;
  list-style: none;
  padding: 0;
  min-width: 10rem;
}

.submenu-item[hidden] {
  display: none;
}

.submenu-item li a,
.submenu-item li button {
  display: block;
  font-size: clamp(0.8rem, 2vw, 1rem);
  padding: 0.8rem;
  color: white;
  text-decoration: none;
  text-align: center;
}

/* Items */
.item {
  display: flex;
  align-items: center;
  gap: 0.4rem; /* espacio entre icono y texto */
  background: transparent;
  width: 100%;
  border: none;
}

.item img {
  width: 1.1rem;
  height: auto;
  border-radius: 0.16rem;
}

/* Imagen de portada */
.portada img {
  width: 100%;
  height: auto;
}

/* Titulos del sitio web */
.titulo {
  text-align: center;
  font-size: clamp(1.7rem, 2vw, 2.7rem);
  color: white;
  background-color: #00aaff;
  padding: 1.2rem;
}

/* Subtitulos del sitio web */
.subtitulo {
  text-align: center;
  font-size: clamp(1.3rem, 2vw, 2.3rem);
  color: black;
  background-color: #eaf5fa;
  padding: 1rem;
}

.contenedor {
  padding: 1rem 1.5rem;
  /* Espaciado lateral moderado */
  max-width: 50rem;
  /* Limita el ancho en pantallas grandes */
  margin: 0 auto;
  /* Texto centralizado */
  text-align: center;
}

/* Pagina index (Mi curriculo) */
.perfil {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

.perfil p {
  flex: 1;
  font-size: 1rem;
  line-height: 1.6;
  text-align: justify;
}

.foto-perfil {
  width: 100%;
  height: auto;
  max-width: 14rem;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 1.5rem;
}

.tabla-1 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr));
  gap: 2rem;
  justify-items: center;
}

.item-de-tabla {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease;
}

.item-de-tabla img, 
.item-de-tabla svg {
  padding: 0.4rem;
  width: 8rem;
  height: 8rem;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.item-de-tabla span {
  font-size: 1rem;
  color: #555;
}

.item-de-tabla:hover {
  transform: scale(1.05);
}

.icono {
  background-color: #00aaff;
  color: white;
  font-size: 2.5rem;
  font-weight: bold;
  border-radius: 4rem;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  border: 0.2rem solid #9c9c9c;
  padding: 0.4rem;
  width: 7rem;
  height: 7rem;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.icono.clickable:active {
  background-color: #048bcf;
}

.icono.clickable {
  cursor: pointer;
  transition: background-color 0.30s ease;
}

.ver-todos {
  text-align: center;
  margin-top: 2rem;
}

.btn-proyectos {
  padding: 1rem 1.5rem;
  background-color: #00aaff;
  color: white;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 6rem;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  border: 0.2rem solid #9c9c9c;
}

.btn-proyectos:hover {
  transform: scale(1.05);
}

.btn-proyectos.clickable:active {
  background-color: #048bcf;
}

.btn-proyectos.clickable {
  cursor: pointer;
  transition: background-color 0.30s ease;
}

/* Graficos de habilidades */
.circle-bg {
  fill: none;
  stroke: #eee;
  stroke-width: 3.8;
}

.circle {
  fill: none;
  stroke: #00aaff;
  stroke-width: 3.8;
  stroke-linecap: round;
  transition: stroke-dasharray 0.6s ease;
}

.percentage {
  font-size: 0.6rem;
  text-anchor: middle;
  fill: #333;
}

/* Pagina privacidad (Politica de privacidad) */
.privacidad {
  padding: 1rem 1.5rem;
  max-width: 50rem;
  /* Limita el ancho en pantallas grandes */
  margin: 0 auto;
}

.privacidad h3, 
.privacidad p, 
.privacidad li {
  line-height: 1.5;
  text-align: justify;
  padding: 0;
}

.privacidad ul {
  list-style: disc;
  padding-left: 1.5rem;
}

/* Pagina proyectos (Mis proyectos) */
.tabla-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem;
  justify-items: center;
}

.proyecto {
  background-color: #f1efef;
  padding: 1rem;
  border-radius: 1.5rem;
  box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.05);
}

.proyecto h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: #333;
  text-align: center;
}

.proyecto ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1rem;
}

.proyecto li {
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  color: #444;
  text-align: justify;
}

.proyectos-img {
  padding: 0.2rem;
  width: 100%;
  height: auto;
  max-width: 30rem;
  margin: 0 auto;
  object-fit: contain;
}

/* Pie de pagina */
.footer {
  background-color: #00aaff;
  color: white;
  padding: 2rem 1.5rem;
  font-family: 'Arial', sans-serif;
  text-align: center;
  line-height: 1.5;
}

.footer h2 {
  font-size: clamp(1.5rem, 2vw, 2.5rem);
  max-width: 50rem;
  margin: 0 auto;
}

.footer p {
  font-size: clamp(0.8rem, 2vw, 1rem);
  max-width: 50rem;
  margin: 0 auto;
}

.footer-icons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.footer-icons a img {
  width: 3rem;
  height: 3rem;
  transition: transform 0.3s ease;
}

.footer-icons a:hover img {
  transform: scale(1.1);
}