/* =================================
    RESET Y BASE
    ================================= */
  *, ::after, ::before {
      box-sizing: border-box;
      margin: 0;
  }

  html {
      -webkit-text-size-adjust: none;
      height: 100%;
  }

  blockquote, body, dd, dl, figure, h1, h2, h3, h4, p {
      margin-block-end: 0;
  }

  ol, ul {
      list-style: none;
      padding: 0;
      margin: 0;
  }

  img, picture {
      max-width: 100%;
      display: block;
  }

  button, input, select, textarea {
      font: inherit;
  }

  textarea:not([rows]) {
      min-height: 10em;
  }

  :target {
      scroll-margin-block: 5ex;
  }

  a {
      text-decoration: none;
      color: inherit;
  }

  /* =================================
    VARIABLES CSS
    ================================= */
  :root {
      /* Colores */
      --bg-color: #F5F4F4;
      --primary: #F1E7DA;
      --secondary: #262525;
      --S800: #3E3D3D;
      --S700: #575555;
      --S600: #6f6d6d;
      --S500: #888585;
      --S400: #a09d9d;
      --S300: #b7b6b6;
      --S200: #cfcece;
      --S100: #e7e7e7;
      --btn-bg: #eecda3;
      
      /* Tipografía */
      --h1: clamp(2rem, 5vw, 3.5rem);
      --h2: clamp(1.75rem, 4vw, 2.75rem);
      --h3: clamp(1.5rem, 3vw, 2rem);
      --h4: clamp(1.25rem, 2vw, 1.5rem);
      --p: clamp(1rem, 1.2vw, 1.125rem);
      
      /* Espaciado */
      --space-xs: 0.5rem;
      --space-sm: 1rem;
      --space-md: 1.5rem;
      --space-lg: 2rem;
      --space-xl: 2.5rem;
      --padding-x: clamp(1rem, 5vw, 8rem);
      
      /* Transiciones */
      --transition: 0.3s ease;
      --transition-card: 0.5s cubic-bezier(.175, .885, .32, 1.275);

      /*Scrolls*/
      #servicio,
      #historia,
      #galeria,
      #contacto {
          scroll-margin-top: 145px;
      }


  }
  /* =================================
    TIPOGRAFÍA
    ================================= */
  @font-face {
      font-family: Oswald;
      src: url(../fonts/Oswald/Oswald-VariableFont_wght.ttf) format('truetype');
      font-display: swap;
      }

  @font-face {
      font-family: Montserrat;
      src: url(../fonts/Montserrat/Montserrat-VariableFont_wght.ttf) format('truetype');
      font-display: swap;
  }

  body {
      line-height: 1.5;
      min-height: 100vh;
      background-color: var(--bg-color);
      font-family: Montserrat, sans-serif;
      display: flex;
      flex-direction: column;
      padding: 0;
      margin: 0;
  }

  h1, h2, h3, h4, button {
      color: var(--S800);
      font-family: Oswald, sans-serif;
      line-height: 1.1;
      text-wrap: balance;
  }

  h1 { font-size: var(--h1); }
  h2 { font-size: var(--h2); }
  h3 { font-size: var(--h3); }
  h4 { font-size: var(--h4); }
  p { font-size: var(--p); }

  /* =================================
    COMPONENTES REUTILIZABLES
    ================================= */

  /* Botones */
  button {
      background-color: var(--btn-bg);
      padding: var(--space-sm) var(--space-md);
      font-size: var(--h3);
      border: none;
      border-radius: 4%;
      transition: var(--transition);
      cursor: pointer;
  }

  button:hover {
      background-color: var(--S700);
      color: var(--S100);
  }

  /* =================================
    HEADER
    ================================= */
  .header,
  .header__con__fondo {
      position: fixed;
      padding: var(--space-sm) var(--padding-x);
      width: 100%;
      z-index: 1000;
      transition: var(--transition);
      display: flex;
      justify-content: space-between;
      align-items: center;
  }

  .header {
      background: transparent;
      background: rgba(69,69,69, 0.2)
  }

  .header__con__fondo {
      background: rgba(69,69,69, 0.75);
      backdrop-filter: blur(1rem);
  }

  .header__logo {
      width: clamp(15rem, 30vw, 20rem);
      fill: var(--primary);
  }

  .header__nav .nav__list {
      display: flex;
      gap: clamp(1rem, 3vw, 2rem);
      flex-wrap: wrap;
  }

  .nav__list a {
      color: var(--bg-color);
      font-weight: 700;
      cursor: pointer;
      transition: var(--transition);
      font-size: var(--p);
  }

  .nav__list a:hover {
      color: var(--primary);
      font-weight: bolder;
      text-decoration: underline;
  }

  /* =================================
    MAIN
    ================================= */
  main {
      flex: 1;
      width: 100%;
  }

  /* =================================
    UP AND DOWN ICONS
    ================================= */

    .arrow_icon{
      visibility: hidden;
      max-width: 80px;
      position: sticky;
      float: right;
      right: 25px;
      bottom: 25px;
      opacity: 0;
      cursor: pointer;
      z-index: 999;
      transition: opacity 0.5s ease, visibility 0.5s ease, transform 0.2s ease;
    }

    .arrow_icon.visible {
      
      opacity: 1;
      visibility: visible;
    }

    .arrow_icon:hover{
        transform: translateY(-4px);
    }
  /* =================================
    SECCIÓN INICIO
    ================================= */
  .inicio {
      display: flex;
      flex-direction: column;
      position: relative;
      margin-top: 0;
      width: 100%;
      justify-content: center;
      align-items: center;
  }

  .inicio__fondo {
      width: 100dvw;
      height: 100vh; 
      filter: saturate(0) brightness(0.5);
      object-fit: cover;
      display: block; 
      z-index: -1;
      position: relative;
  }


  .inicio__contenido {
      position: absolute;
      display: flex;
      flex-direction: column;
      top: 50%;
      left: 50%;
      text-align: center;
      color: var(--primary);
      align-items: center;
      gap: var(--space-lg);
      transform: translate(-50%, -50%);
      padding: var(--space-sm);
      width: 90%;
  }

  .contenido__titulo {
      color: var(--S100);
  }

  /* =================================
    SECCIÓN SOBRE MÍ
    ================================= */
.sobremi {
    display: flex;
    flex-direction: row;
    width: 100%;
    margin-bottom: 2.5%;
    align-items: stretch;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    padding-left: var(--padding-x);
    padding-right: var(--padding-x);
    opacity: 0;
    transform: translateY(0);
    transition: opacity 0.7s ease, transform 0.7s ease-in;
}

.sobremi__aparicion {
    opacity: 1;
    transform: translateY(-25%);
    transition: all 0.4s ease-out;
}

  .sobremi__card {
      display: flex;
      flex-direction: column;
      width: 100%;
      min-width: 250px;
      flex: 1;
      padding: var(--space-sm) var(--space-sm) var(--space-lg);
      background-color: var(--btn-bg);
  }

  .sobremi__card header {
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: var(--space-sm);
      margin-bottom: 0.75rem;
  }

  .sobremi__card svg {
      height: 3rem;
      min-width: 3rem;
      color: var(--S800);
  }

 .sobremi__card:nth-child(2) {
      background-color: var(--S800);
      color: var(--primary);
  }

  .sobremi__card:nth-child(2) header,
  .sobremi__card:nth-child(2) header * {
      color: var(--primary);
  }

  .sobremi__card:nth-child(3) {
      background-color: #d9d9d9;
      color: var(--secondary);
  }

  /* =================================
    SECCIÓN PRESENTACIÓN
    ================================= */
  .presentacion {
      display: flex;
      flex-direction: row;
      padding-left: var(--padding-x);
      padding-right: var(--padding-x);
      max-height: max-content;
      gap: 1.4rem;
      flex-wrap: wrap;
  }

  .presentacion__info {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: var(--space-xl);
      flex: 1;
      min-width: 280px;
  }

  .presentacion img {
      display: inline;
      vertical-align: top;
      border-radius: 8px;
      width: 100%;
      max-width: 400px;
      height: 333px;
      object-fit: cover;
  }

  #presentacion__segundafoto{
    display: none;
  }

  /* =================================
    SECCIÓN SERVICIOS
    ================================= */
  .servicio {
      display: flex;
      flex-direction: column;
      width: 100%;
      justify-content: center;
      align-items: center;
      margin: 2.5% auto;
      z-index: 1;
  }

  .servicio__header {
      position: relative;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      width: 100%;
      align-items: center;
      justify-content: center;
      padding: var(--space-lg) var(--padding-x);
      height: fit-content;
  }

  .servicio__header h2,
  .servicio__header p {
      color: var(--S100);
      font-weight: 700;
      text-align: center;
      z-index: 1;
  }

  .servicio__header .servicio__fondo {
      position: absolute;
      width: 100%;
      height: 100%;
      object-fit: cover;
      filter: saturate(0) brightness(.3);
      z-index: 0;
  }

  .servicio__servicios {
      position: relative;
      background-color: var(--S100);
      width: 90%;
      margin: -1rem auto 0 auto; 
  }

  .servicio__servicios nav {
      display: flex;
      flex-direction: row;
      width: 100%;
      flex-wrap: wrap;
  }

  .servicio__servicios nav button {
      width: 100%;
      min-width: 150px;
      flex: 1;
      background-color: var(--S700);
      color: var(--S100);
      border-radius: 0;
      transition: var(--transition);
  }

  .servicio__servicios nav button.active {
      background-color: var(--btn-bg);
      color: var(--S800);
  }

  .tab-content {
      display: none;
      transition: opacity 0.3s;
  }

    .tab-content > p {
      text-align: center;

  }

  .tab-content>.servicios__imagenes{
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2.5rem;
    gap: 7.5rem;
  }

  .tab-content>.servicios__imagenes>img{
    width: 640px;
    height: 400px;
  }

  .tab-content.active {
      display: block;
      padding: var(--space-lg) clamp(1rem, 3vw, 2rem);
  }

  /* =================================
    SECCIÓN GALERÍA
    ================================= */
  .galeria {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 2.5%;
    background-color: var(--S100);
    gap: 20px;
    padding-left: var(--padding-x);
    padding-right: var(--padding-x);
    padding-top: 1rem;
  }

  .galeria_row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2.5%;
    gap: 20px;
  }
  .galeria_row picture {
    flex: 1 1 calc(33.33% - 20px); 
    max-width: calc(33.33% - 20px);
    min-width: 280px;
    display: flex;
  }
  .galeria_row img {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 16/9;
    contain: layout style paint;
  }

/* =================================
   SECCIÓN HISTORIA
   ================================= */
.historia {
    display: flex;
    flex-direction: column;
    padding-left: var(--padding-x);
    padding-right: var(--padding-x);
    margin-top: 2.5%  ;
    width: 100%;
}

.historia h2 {
    text-align: left;
    width: 100%;
    margin-bottom: 20px;
}

.historia__cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    gap: var(--space-md);
}

.historia__card {
    position: relative;
    overflow: visible;
    display: inline-block;
    max-width: calc(33.33% - 48px);
    min-width: 280px;    
    height: clamp(200px, 18vw, 260px);
    margin: var(--space-sm);
    border-radius: 10px;
    perspective: 1000px;
    cursor: pointer;
    transition: height 0.5s ease-out;

    transform-style: preserve-3d;
}

.historia__card.flip {
    height: auto ; 
    min-height: clamp(200px, 18vw, 260px);
    z-index: 10;
    transition: height 0.25s ease-in;
}

/* Ambas caras */
.historia__card > .card__front,
.historia__card > .card__back {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    width: 100%;
    border-radius: 10px;
    color: var(--S100);
    padding: var(--space-md);
    text-align: center;

    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-style: preserve-3d;

    transition-timing-function: cubic-bezier(.175, .885, .32, 1.275);
    transition-duration: .5s;
    transition-property: transform, opacity;
}

/* Cara delantera */
.card__front {
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transform: rotateY(0);
}

/* Cara trasera */
.card__back {
    position: relative; 
    top: 0;
    left: 0;
    width: 100%;
    height: auto; 
    background-color: var(--S800);
    opacity: 0;
    transform: rotateY(-180deg);
}

/* Imagen */
.historia__card .card__fondo {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    top: 0;
    left: 0;
    z-index: -1;
    border-radius: 10px;
    filter: brightness(.3);
    transition: height 0.6s cubic-bezier(.34, 1.56, .64, 1);
}

/* Flip aplicado */
.historia__card.flip > .card__front {
    transform: rotateY(180deg);
}

.historia__card.flip > .card__back {
    opacity: 1;
    transform: rotateY(0);
}

.historia__card h3,
.historia__card p {
    color: var(--S100);
}

.historia__card p {
    line-height: 1.5;
}

  /* =================================
    SECCIÓN RESEÑAS
    ================================= */
.reviews {
    background-color: var(--S800);
    width: 100%;
    display: flex;
    flex-direction: column;
    margin-top: 2.5%;
    margin-bottom: 1%;
    padding: var(--space-lg) var(--padding-x);
    gap: var(--space-xs);
}

.reviews h2,
.reviews p {
    color: var(--S100);
}

.reviews p{
  margin-bottom: 2.5%;
}

.reviews p a {
    color: var(--primary);
    text-decoration: underline;
}

.reviews__rows {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-xl );
    margin-top: 1.5%;
    width: 100%;
}

.review__card {
    flex: 1 1 calc(33.33% - 20px);
    width: calc(33.33% - 20px);
    max-width: calc(33.33% - 48px);
    min-width: 280px;    
    height: auto; 
    min-height: clamp(200px, 18vw, 260px); 
    margin: 0;  /* CAMBIADO: de 1em a 0 */
    background: var(--bg-color);
    border-radius: var(--space-sm);
    padding: var(--space-lg);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.review__text {
    position: relative;
    z-index: 1;
    flex: 1;
}

.review__card p {
    color: var(--S800);
    line-height: 1.7;
    margin: 0;
}

.review__card footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: none;
    margin-top: auto;
    padding-top: var(--space-xs);
    border-top: 2px solid var(--S700);
    opacity: 0.85;
    text-align: left;
}

.review__card footer::before {
    color: var(--S700);
    font-weight: normal;
}

.review__card footer cite {
    font-weight: bold;
    font-style: normal;
    color: var(--S700);
    letter-spacing: 0.3px;
}

.review__card:hover {
    transform: translateY(-8px);
}

.review__card:hover footer {
    opacity: 1;
}

.review__card:hover::before {
    opacity: 0.12;
}
/* =================================
   SECCIÓN CONTACTO
   ================================= */
.contacto {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: var(--space-xs) var(--padding-x);
    margin-bottom: -5%;
}

.contacto h2 {
    width: 100%;
    margin-bottom: 1%;
    text-align: left;
}

.contacto__informacion {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    width: 55%;
    overflow: hidden;
}

.informacion__datos {
    background-color: var(--btn-bg);
    padding: var(--space-md) var(--space-lg);
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-md);
}

.informacion__datos h2 {
    margin-bottom: 0.8rem;
    font-weight: bold;
    font-size: 1.5rem;
}

.informacion__datos article {
    margin-bottom: 0;
}

.informacion__datos article:first-child {
    margin-bottom: var(--space-md);
}

.informacion__datos table {
    width: auto;
    border-collapse: collapse;
    table-layout: auto;
}

.informacion__datos td {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    border-top: 1px solid var(--secondary);
    white-space: nowrap; 
}

.informacion__datos td:first-child {
    text-align: left;
    padding-right: var(--space-md);
}

.informacion__datos td:last-child {
    text-align: right;
}

.informacion__datos tr:last-child td:last-child {
    padding-right: 0;
}

.icon {
    fill: var(--S800);
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
}

.text_con_icono {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: var(--space-xs);
}

.text_con_icono:last-child {
    margin-bottom: 0;
}

.link-mapa {
    display: block;
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    position: relative; 
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.link-mapa:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.link-mapa img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.link-mapa:hover img {
    transform: scale(1.05);
}

.link-mapa::after {
    content: 'Ver en Google Maps';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: var(--bg-color);
    padding: var(--space-sm);
    font-weight: bold;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Asegura que el click pase a través del texto */
}

.link-mapa:hover::after {
    opacity: 1;
}

#phone {
    text-decoration: none;
    cursor: pointer; 
}
  
/* =========================================================
   FOOTER 
========================================================= */
footer {
  width: 100%;
  background-color: var(--S100);
  border-top: 1px solid var(--S800);
  padding: var(--space-xl) var(--padding-x);
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center; 
  gap: 2rem;
  margin: 0 auto;
  color: var(--S800);
}

/* ---------- FIGURE (LOGO + COPYRIGHT) ---------- */
footer figure {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

footer figure img {
  width: clamp(15rem, 30vw, 20rem);
  height: auto;
  filter: invert(1);
}

footer figcaption p {
  color: var(--S700);
  font-size: var(--p);
}

/* ---------- CONTACTO ---------- */
.footer__contact {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin: auto;
}

.footer__contact h3 {
  margin: 0;
  border-bottom: 2px solid var(--S800);
  font-size: 1.3rem;
}

.footer__contact address {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  font-style: normal;
}

.text_con_icono {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  max-width: 350px;
}

.text_con_icono p {
  color: var(--S700);
  font-size: var(--p);
}

footer .icon {
  width: 1.4rem;
  height: 1.4rem;
  fill: var(--S800);
}

footer .social_media{
  padding: 0;
  width: 5rem;
  fill: var(--S800);
  cursor: pointer;

}

.text_con_icono a {
    color: var(--S700);
    font-size: var(--p);
    text-decoration: none;
    transition: color 0.3s ease, font-weight 0.3s ease; 

}

/* Efecto HOVER para los enlaces */
.text_con_icono a:hover {
    color: var(--S800); 
    font-weight: bold;  
    text-decoration: underline;
}

.programa_kit_digital{
  grid-column: span 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.programa_kit_digital img{
  width: 70rem;
}

/* =================================
   MEDIA QUERIES
   ================================= */
@media (width >=2560px ){
    h1 { font-size: clamp(4rem, 16vw, 6rem); }
    h2 { font-size: clamp(3rem, 6vw, 4rem); }
    h3 { font-size: clamp(2rem, 4vw, 3rem); } 
    p  { font-size: clamp(2rem, 3vw, 2rem);}
}
@media (max-width: 1600px) {

    h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
    h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
    h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
    
    .presentacion {
      flex-direction: column;
      align-items: center;
    }

    .presentacion>.presentacion__imagenes{
      display: flex;
      flex-direction: row;
      gap: 2rem;
    }
    #presentacion__segundafoto{
      display: contents;
    }
    .presentacion img {
        max-width: 500px;
    }
    
    .informacion__datos td {
        white-space: normal; 
        padding-right: var(--space-xs) !important;
    }
    
    .sobremi__card {
        padding-bottom: var(--space-lg);
    }
    
    .galeria_row img {
        width: 100%;
        max-width: 600px;
    }
    
  .tab-content>.servicios__imagenes{
    margin-top: 2.5rem;
    gap: 5rem;
  }

  .tab-content>.servicios__imagenes>img{
    width: 500px;
    height: 312px;
  }

  footer {
    padding: var(--space-xl) var(--space-lg);
  }
    
    footer > figure figcaption p {
        font-size: 0.9rem;
    }
    
    .footer__contact h3,
    .footer__nav h3 {
        font-size: clamp(1.1rem, 2vw, 1.3rem);
    }
}

/* Resoluciones intermedias altas (1200px - 1600px) */
@media (max-width: 1600px) and (min-width: 1200px) {
    .contacto__informacion {
        width: 70%;
    }
    
    .informacion__datos {
        max-width: 400px;
    }
    
    footer {
        gap: var(--space-lg);
    }
    
    footer > figure img {
        max-width: 220px;
    }
    
    .footer__contact address,
    .footer__nav ul {
        gap: var(--space-sm);
    }
}

/* Resoluciones intermedias (900px - 1200px) */
@media (max-width: 1200px) and (min-width: 900px) {
    .contacto__informacion {
        width: 80%;
    }
    
    .informacion__datos {
        max-width: 420px;   
    }

  .tab-content>.servicios__imagenes{
    margin-top: 2.5rem;
    gap: 2rem;
  }  
  .tab-content>.servicios__imagenes>img{
    width: 450px;
    height: 281px;
  }

  .presentacion>.presentacion__imagenes{
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
    
    footer {
        padding: var(--space-xl) var(--space-md);
        gap: var(--space-md);
    }
    
    footer > figure img {
        max-width: 250px;
    }
    
    .footer__contact .text_con_icono p,
    .footer__nav ul li a {
        font-size: 0.95rem;
    }
}

/* Tablets landscape (900px - 999px) */
@media (max-width: 999px) and (min-width: 900px) {
    .contacto__informacion {
        width: 90%;
    }
    
    .informacion__datos {
        max-width: none;
    }
  
  .tab-content>.servicios__imagenes{
    flex-direction: column;
    margin-top: 2.5rem;
    gap: 4rem;
  }
  .presentacion>.presentacion__imagenes{
    display: flex;
    gap: 1rem;
  }
  .tab-content>.servicios__imagenes>img{
    width: 500px;
    height: 312px;
  }
    footer {
        display: grid;
        grid-template-columns: 1fr 1fr ;
        align-items: start;
        padding: var(--space-lg) var(--space-md);
        gap: var(--space-md);
    }
    
    footer > figure {
        justify-content: flex-start;
        align-items: flex-start;
    }
    
    footer > figure img {
        max-width: 180px;
    }
    
    .footer__contact {
        justify-content: flex-start;
        align-items: flex-start;
    }
    
    .footer__nav {
        justify-content: flex-start;
        align-items: flex-start;
    }
    
    .footer__contact address {
        gap: var(--space-sm);
    }
    
    .footer__nav ul {
        gap: var(--space-xs);
    }
}

/* Tablets (769px - 899px) */
@media (max-width: 899px) and (min-width: 769px) {
  .contacto__informacion {
    width: 90%;
  }
    
  .informacion__datos {
    max-width: none;
  }
  
  .presentacion>.presentacion__imagenes{
    flex-direction: column;
    gap: 1rem;
  }
  
  .tab-content>.servicios__imagenes{
    display: flex;
    flex-direction: column;
    margin-top: 2.5rem;
    gap: 4rem;
  }

  .tab-content>.servicios__imagenes>img{
    width: 450px;
    height: 250px;
  }

  footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-lg) var(--space-md);
    gap: var(--space-lg);
  }
    
    footer > figure {
        align-items: center;
    }
    
    footer > figure img {
        max-width: 220px;
    }
    
    .footer__contact,
    .footer__nav {
        align-items: center;
    }
    
    .footer__contact address {
        align-items: center;
    }
    
    .footer__contact .text_con_icono {
        justify-content: center;
    }
    
    .footer__nav ul {
        flex-direction: row;
        gap: var(--space-md);
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 768px) {
  :root {
    --padding-x: 1.5rem;
    --section-gap: 3rem;
    --section-gap-small: 1.5rem;
  }
  
  .historia,
  .servicio,
  .inicio,
  .galeria {
    margin-bottom: var(--section-gap); 
  }

  .arrow_icon{
    max-width: 60px;
    right: 10px;
    bottom: 0;
  }
  
  .header,
  .header__con__fondo {
    padding: 0;
    flex-direction: column;
    align-items: center;
  }
  
  .header__nav {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-bottom: 0.5rem;
  }
  
  .header__nav .nav__list {
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
  }

  .header__nav .nav__list a{
    font-size: 0.9rem;
    font-weight: bold;
    text-decoration: none;
  }
  
  .header__logo {
    padding-top: 0.8rem;
  }
  
  .inicio__fondo {
    min-height: 60vh;
  }

  /* Sección sobre mí */
  .sobremi{
    padding-left: var(--padding-x);
    padding-right: var(--padding-x);
    margin-bottom: -2rem;
  }
  
  .presentacion img {
    max-height: 350px;
    max-height: 250px;
  }

  .presentacion>.presentacion__imagenes{
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  /* Sección servicios */
  .servicio {
    margin: var(--section-gap) auto;
  }

  .servicio__header {
    align-items: flex-start;
    gap: var(--section-gap-small);
  }
  
  .servicio__header h1,
  .servicio__header p {
    text-align: left;
  }
  
  .servicio__fondo {
    min-height: 200px;
    top: 0;
    left: 0;
  }

  .tab-content>.servicios__imagenes{
    display: flex;
    flex-direction: column;
  } 

  /* ESTO ES LO NUEVO - Asegura que picture no se deforme */
  .servicios__imagenes > picture {
    width: 100%;
    display: block;
  }

  /* Aplica a todas las imágenes, estén o no dentro de picture */
  .servicios__imagenes > picture > img,
  .servicios__imagenes > img {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 16/9;
    contain: layout style paint;
  }
  
  /* Sección galería */
  .galeria {
    margin-top: var(--section-gap);
    padding-top: var(--section-gap);
  }
  
  /*Sección de historia*/
  .historia__cards {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap :var(--space-xs);
  }

  .historia__card,
  .historia__card .card__front,
  .historia__card .card__back {
    width: 100% ;
  }

  .galeria_row picture,
  .galeria_row img {
    width: 100% ;
    max-width: 100%;
  }

  .historia__card.flip {
    height: auto !important;
  }

  /* Sección reseñas */
  .reviews {
    margin-top: var(--section-gap);
  }

  .reviews h1{
    margin-bottom: var(--section-gap-small);
  }

  /* Sección contacto */
  .contacto {
    margin-top: var(--section-gap);
  }
  
  .icon {
    width: 1.5rem;
    height: 1.5rem;
  }
  
  .contacto__informacion {
    width: 95%;
    flex-direction: column;
  }
  
  .informacion__datos {
    padding: var(--space-sm) var(--space-md);
    min-width: 100%;
    max-width: none;
  }
  
  .informacion__datos h2 {
    font-size: 1.2rem;
  }
  
  .informacion__datos table {
    width: 100%;
    font-size: 0.85rem;
  }
  
  .informacion__datos td {
    white-space: normal; 
    padding-right: var(--space-xs) !important;
  }
  
  .informacion__datos td:first-child {
    padding-right: var(--space-xs);
  }
  
  .contacto__informacion a {
    min-width: 100%;
    max-width: 100%;
    min-height: 250px;
  }
  
  .review__card{
    height: 245px;
  }
  
  footer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--space-lg) var(--padding-x);
    gap: var(--space-lg);
  }

  footer > figure {
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
  }

  footer > figure img {
    max-width: 4000px;  
  }

  footer > .footer__contact,
  footer > .footer__nav {
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
  }

  .footer__nav h3 {
    margin-bottom: var(--space-md);
  }

  .footer__contact address {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
  }

  .footer__contact .text_con_icono {
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
  }

  .footer__contact .text_con_icono p {
    text-align: center;
    max-width: 250px;
  }
  .galeria_row {
    flex-direction: row;
  }
  
  .galeria_row picture {
    flex: 1 1 calc(50% - 20px);
    max-width: calc(50% - 20px);
    min-width: calc(50% - 20px);
  }
}

  /* Móviles (hasta 480px) */
  @media (max-width: 480px) {
    .contacto__informacion {
      width: 100%;
    }
    .informacion__datos {
      padding: var(--space-sm);
    }
    .informacion__datos h2 {
      font-size: 1.1rem;
    }
    .informacion__datos table {
      font-size: 0.8rem;
    }
    .informacion__datos td {
      padding-top: 0.4rem;
      padding-bottom: 0.4rem;
    }
    .contacto__informacion a {
      min-height: 200px;
    }
    .galeria_row picture {
      flex: 1 1 100%;
      max-width: 100%;
      min-width: 100%;
    }
  }

@media (max-width: 360px) {
  .informacion__datos table {
    font-size: 0.75rem;
  }
  .informacion__datos td:first-child {
    max-width: 120px;
    }
}
