/* =========================================================
   ONEPA — TV / OLD BROWSER FIXES
   Loaded right after inicio.css.

   Every rule below sits inside an @supports not (...) block,
   so it ONLY applies on old browsers (smart TVs) that do not
   understand a newer CSS feature used in inicio.css.
   Modern browsers (computers, phones) skip this whole file,
   so the website looks exactly the same there.
========================================================= */


/* ---------------------------------------------------------
   1. "inset: 0" not understood
   Without this, the image/animation areas and the map flags
   have no size on old TVs.
--------------------------------------------------------- */

@supports not (inset: 0) {

  @media (min-width: 601px) {
    .solutions-section .solution-visual {
      top: 0 !important;
      right: 0 !important;
      bottom: 0 !important;
      left: 0 !important;
    }
  }

  .presence-map-image-wrap .presence-country-hotspots {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
  }
}


/* ---------------------------------------------------------
   2. min() / clamp() not understood
   Without this, the six animations (iframes) shrink to a
   tiny 300x150 box, and several sections lose their width.
--------------------------------------------------------- */

@supports not (width: min(1px, 2px)) {

  .hero-highlights-card {
    width: 80%;
    max-width: 880px;
  }

  .wrap,
  .hero-wrap {
    width: calc(100% - 48px);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
  }

  #sobre .why-text {
    width: calc(100% - 48px);
    max-width: 1200px;
  }

  .presence-map-content {
    width: calc(100% - 48px);
    max-width: 1500px;
  }

  .presence-map-image,
  .presence-map-hotspot-stage {
    width: 100%;
    max-width: 900px;
  }

  /* The six tile animations, videos and images */
  .solutions-section .solution-visual img,
  .solutions-section .solution-visual video.solution-video,
  .solutions-section .solution-visual iframe.solution-html {
    width: 52vw !important;
    max-width: 440px !important;
  }

  @media (max-width: 960px) {
    .solutions-section .solution-visual img,
    .solutions-section .solution-visual video.solution-video,
    .solutions-section .solution-visual iframe.solution-html {
      width: 60vw !important;
      max-width: 380px !important;
    }
  }

  @media (max-width: 760px) {
    .wrap,
    .hero-wrap {
      width: calc(100% - 36px);
    }

    #sobre .why-text {
      width: calc(100% - 36px);
    }

    .presence-map-content {
      width: calc(100% - 28px);
    }

    .solutions-section .solution-visual img,
    .solutions-section .solution-visual video.solution-video,
    .solutions-section .solution-visual iframe.solution-html {
      width: 76vw !important;
      max-width: 300px !important;
    }
  }

  @media (max-width: 600px) {
    .solutions-section .solution-visual img,
    .solutions-section .solution-visual video.solution-video,
    .solutions-section .solution-visual iframe.solution-html {
      width: 56% !important;
      max-width: none !important;
    }
  }

  @media (max-width: 420px) {
    .wrap,
    .hero-wrap {
      width: calc(100% - 28px);
    }

    #sobre .why-text {
      width: calc(100% - 28px);
    }
  }
}


/* ---------------------------------------------------------
   3. "aspect-ratio" not understood
   Gives the invisible map-flag circles a real size.
--------------------------------------------------------- */

@supports not (aspect-ratio: 1 / 1) {

  .presence-map-image-wrap .presence-country-hotspot {
    width: 32px;
    height: 32px;
  }
}


/* ---------------------------------------------------------
   4. "margin-inline" / "padding-block" not understood
   Keeps the page wrappers centred.
--------------------------------------------------------- */

@supports not (margin-inline: auto) {

  .wrap,
  .hero-wrap {
    margin-left: auto;
    margin-right: auto;
  }

  @media (max-width: 760px) {
    section {
      padding-top: 60px;
      padding-bottom: 60px;
    }
  }
}


/* ---------------------------------------------------------
   5. CSS grid not understood (very old TVs)
   Same layouts rebuilt with flexbox.
--------------------------------------------------------- */

@supports not (display: grid) {

  /* Three hero cards side by side */
  .hero-highlights-card {
    display: flex;
  }

  .hero-highlights-card > .hero-highlight-item {
    flex: 1 1 0%;
    margin-right: 16px;
  }

  .hero-highlights-card > .hero-highlight-item:last-child {
    margin-right: 0;
  }

  /* The two texts inside each hero card: one visible at a time */
  .hero-highlight-item {
    display: block !important;
    position: relative;
  }

  .hero-highlight-item .hero-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
  }

  .hero-highlight-item .hero-text.is-active {
    position: relative;
  }

  /* Three columns on black */
  #sobre .why-text {
    display: flex;
  }

  #sobre .why-text p {
    flex: 1 1 0%;
    margin-right: 48px;
  }

  #sobre .why-text p:last-child {
    margin-right: 0;
  }

  /* Six solution tiles, two per row */
  .solutions-section .solutions-slider {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
  }

  .solutions-section .solution-slide {
    width: calc(50% - 4px) !important;
    height: auto !important;
    margin-bottom: 8px !important;
  }

  @media (max-width: 760px) {
    .hero-highlights-card {
      display: block;
    }

    .hero-highlights-card > .hero-highlight-item {
      margin-right: 0;
      margin-bottom: 12px;
    }

    #sobre .why-text {
      display: block;
    }

    #sobre .why-text p {
      margin-right: 0;
      margin-bottom: 24px;
    }
  }
}


/* ---------------------------------------------------------
   6. CSS variables not understood
   The three main texts keep their intended size.
--------------------------------------------------------- */

@supports not (--onepa-test: 0) {

  .hero-highlight-item .hero-text,
  .hero-highlight-item p,
  #sobre .why-text p,
  .why-text p,
  .presence-map-heading p {
    font-size: 18px !important;
  }

  @media (max-width: 1100px) {
    .hero-highlight-item .hero-text,
    .hero-highlight-item p,
    #sobre .why-text p,
    .why-text p,
    .presence-map-heading p {
      font-size: 16px !important;
    }
  }

  @media (max-width: 900px) {
    .hero-highlight-item .hero-text,
    .hero-highlight-item p,
    #sobre .why-text p,
    .why-text p,
    .presence-map-heading p {
      font-size: 17px !important;
    }
  }
}
