/* TuPerrito 1.3.0: ajustes de lectura y distribución en pantallas pequeñas.
   Cargar DESPUÉS de assets/css/style.css para preservar el diseño de escritorio. */

/* Las celdas de rejilla y los elementos flexibles no deben crecer por textos largos. */
@media (max-width: 980px) {
  .hero .hero-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
  }
  .hero .hero-copy {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 0;
    margin: 0 auto;
    text-align: center;
  }
  .hero .hero-copy .badge {
    display: inline-flex;
    max-width: 100%;
    margin: 0 auto 20px;
    white-space: normal;
    line-height: 1.35;
    justify-content: center;
  }
  .hero .hero-copy h1 {
    position: relative;
    display: block;
    width: 100%;
    max-width: 750px;
    margin: 0 auto 18px;
    color: #073557 !important;
    font-size: clamp(2rem, 5.75vw, 3.65rem);
    line-height: 1.13;
    letter-spacing: -.035em;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: none;
    text-wrap: balance;
  }
  .hero .hero-copy > p {
    display: block;
    width: 100%;
    max-width: 640px;
    margin: 0 auto 24px;
    font-size: clamp(.98rem, 1.8vw, 1.1rem);
    line-height: 1.6;
    color: #466675 !important;
    overflow-wrap: break-word;
  }
  .hero .hero-actions {
    justify-content: center;
    margin-bottom: 22px;
    gap: 10px;
  }
  .hero .hero-actions .btn {
    max-width: 100%;
  }
  .hero .hero-proof {
    position: static;
    z-index: auto;
    display: flex;
    width: 100%;
    max-width: 600px;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto;
    text-align: left;
    line-height: 1.4;
  }
  .hero .hero-proof > span:last-child {min-width: 0; max-width: min(100%, 360px);}
  .hero .hero-visual {
    position: relative;
    flex: 0 0 auto;
    width: min(100%, 460px);
    min-height: 0;
    max-width: 100%;
    margin: 0 auto;
    padding: 8px 0 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: 'logo logo' 'chip1 chip2';
    align-items: center;
    justify-items: center;
    gap: 12px;
    overflow: visible;
    isolation: isolate;
  }
  .hero .hero-aura {
    position: absolute;
    top: 1%;
    left: 50%;
    width: min(90%, 385px);
    height: auto;
    aspect-ratio: 1;
    transform: translateX(-50%);
    animation: none !important;
    pointer-events: none;
    z-index: -1;
  }
  .hero .hero-logo {
    grid-area: logo;
    position: relative;
    display: block;
    width: min(88%, 385px);
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    animation: none !important;
    z-index: 1;
  }
  .hero .float-chip {
    position: relative !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 11px 12px;
    border-radius: 14px;
    font-size: .8rem;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: break-word;
    gap: 7px;
    box-shadow: 0 8px 22px #0f617422;
  }
  .hero .chip-1 {grid-area: chip1;}
  .hero .chip-2 {grid-area: chip2;}
  .hero .float-chip span {flex: 0 0 auto; font-size: 1.25rem;}

  /* Cinta de novedades: un renglón desplazable sin comprimir ni superponer títulos. */
  .ticker .ticker-inner {display: flex; align-items: center; gap: 13px; min-width: 0; overflow: hidden;}
  .ticker .ticker-inner strong {flex: 0 0 auto; min-width: 0;}
  .ticker .ticker-list {flex: 1 1 auto; min-width: 0; max-width: 100%; gap: 18px; overflow-x: auto; overflow-y: hidden;}
  .ticker .ticker-list a {flex: 0 0 auto; max-width: min(75vw, 400px); overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}

  .section .section-head {position: relative; min-width: 0; gap: 14px;}
  .section .section-head > div {min-width: 0;}
  .section .section-head h2 {line-height: 1.18; overflow-wrap: break-word; text-wrap: balance;}
  .section .section-head .eyebrow {line-height: 1.4; white-space: normal;}
}

@media (max-width: 600px) {
  .hero {padding: 34px 0 38px;}
  .hero .hero-grid {gap: 22px;}
  .hero .hero-copy h1 {font-size: clamp(2rem, 8vw, 2.9rem); max-width: 20ch;}
  .hero .hero-copy > p {font-size: 1rem; line-height: 1.62;}
  .hero .hero-proof {font-size: .84rem;}
  .hero .hero-visual {gap: 9px;}
  .hero .float-chip {font-size: .71rem; padding: 10px 8px;}
  .hero .float-chip span {font-size: 1.1rem;}
  .ticker .ticker-inner {gap: 9px; padding: 11px 0;}
  .ticker .ticker-inner strong {font-size: .7rem;}
  .ticker .ticker-list a {font-size: .78rem; max-width: 58vw;}
  .section .section-head h2 {font-size: clamp(1.9rem, 7vw, 2.6rem);}
  .section .section-head {margin-bottom: 26px;}
  .section .section-head p {font-size: .95rem;}
}

@media (max-width: 400px) {
  .hero .hero-actions {flex-direction: column; align-items: stretch;}
  .hero .hero-actions .btn {width: 100%;}
  .hero .hero-visual {grid-template-columns: 1fr; grid-template-areas: 'logo' 'chip1' 'chip2'; gap: 8px;}
  .hero .float-chip {width: min(100%, 320px); font-size: .78rem;}
  .hero .hero-proof {flex-direction: column; text-align: center;}
  .hero .hero-proof .icons {justify-content: center;}
  .hero .hero-copy h1 {font-size: clamp(1.95rem, 8.3vw, 2.35rem);}
}

@media (prefers-reduced-motion: reduce) {
  .hero .hero-visual *, .hero .hero-copy * {animation: none !important;}
}
