/* =========================================================
   Tarjetero en Red - Estilos para móviles
   Este archivo complementa styles-pc.css.
   ========================================================= */

@media (max-width: 767px) {
  /* Ajustes generales para pantallas pequeñas */
  body {
    padding-top: 200px;
  }

  .headerTop {
    flex-direction: column;
    height: auto;
    padding: 12px 15px;
    gap: 10px;
    text-align: center;
  }

  header h1 {
    font-size: 19px;
  }

  .btnRowTarjetero {
    gap: 10px 15px;
    padding: 8px 12px 10px 12px;
  }

  .btnRowTarjetero a,
  .btnRowTarjetero button.navLinkItem {
    font-size: 12px;
  }

  .heroLayout {
    flex-direction: column;
    align-items: center;
  }

  .adsLeft,
  .adsRight {
    display: none;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .card-img-wrapper {
    height: 130px;
  }

  .card .info {
    padding: 10px 12px;
  }

  .card h3 {
    font-size: 13px;
    white-space: nowrap;
  }

  .card p {
    font-size: 11px;
    white-space: nowrap;
  }

  .modal {
    padding: 10px;
  }

  .modal-inner {
    grid-template-columns: 1fr;
    max-height: 92vh !important;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  .details {
    padding: 20px 20px 50px 20px !important;
    overflow-y: visible !important;
    max-height: none !important;
  }
}

@media (min-width: 768px) and (max-width: 1100px) {
  .heroLayout {
    flex-direction: column;
    align-items: center;
  }

  .adsLeft,
  .adsRight {
    display: none;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .beneficios-row {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .gallery {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }

  .card-img-wrapper {
    height: 180px;
  }

  .card .info {
    padding: 16px;
  }

  .card h3 {
    font-size: 15px;
    white-space: normal;
  }

  .card p {
    font-size: 13px;
    white-space: normal;
  }
}

@media (max-width: 800px) {
  .modal {
    padding: 10px;
  }

  .modal-inner {
    grid-template-columns: 1fr;
    max-height: 92vh !important;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  .details {
    padding: 20px 20px 50px 20px !important;
    overflow-y: visible !important;
    max-height: none !important;
  }
}

/* Carrusel horizontal compacto para Beneficios en celulares y tablets */
@media (max-width: 1100px) {
  .beneficios-row {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    gap: 15px !important;
    padding: 10px 5px 20px 5px !important;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }

  .beneficios-row::-webkit-scrollbar {
    display: none;
  }

  .beneficios-row .testimonio {
    flex: 0 0 82% !important;
    max-width: 82% !important;
    min-height: 190px !important; /* Limita la altura para que no se estiren verticalmente */
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important; /* Centra el contenido verticalmente como la segunda foto */
    scroll-snap-align: center !important;
    margin: 0 !important;
    box-sizing: border-box;
    padding: 20px !important;
  }
}

/* =========================================================
   POPUP PUBLICIDAD - AJUSTE PARA CELULARES
   ========================================================= */
@media (max-width: 767px) {

  .popup-publicidad {
    width: 94vw !important;
    max-width: 94vw !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
  }

  .popup-publicidad > div {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .popup-publicidad img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    object-fit: contain !important;
  }

  /* X de cerrar: la sacamos de encima del escudo */
  .popup-publicidad #cerrarPublicidad {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    z-index: 20 !important;
  }

  .popup-publicidad .contador {
    font-size: 12px !important;
    padding: 8px 5px !important;
  }
}
