/* =========================================================
   BASE
   ========================================================= */

.chevista-hero{
  background:#ffffff;
  padding: 0 0 clamp(48px, 6vw, 96px) 0;
}

.chevista-container{
  width: min(1200px, calc(100% - 2rem));
  margin-left:auto;
  margin-right:auto;
}

/* Fix overflow orizzontale (mobile) */
.chevista-hero,
.chevista-tiles{
  overflow-x: clip;
}
@supports not (overflow: clip){
  .chevista-hero,
  .chevista-tiles{ overflow-x: hidden; }
}

.chevista-hero__copy,
.chevista-hero__media{
  min-width:0;
}

.chevista-hero__copy{
  align-self: center;
}

/* =========================================================
   HERO
   ========================================================= */

.chevista-hero__grid{
  display:grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: stretch;
}

.chevista-hero__subtitle{
  display:inline-block;
  color:#ef8504;
  font-weight:500;
  text-transform:uppercase;
  letter-spacing:0.06em;
  margin-bottom:6px;
}

.chevista-hero__title{
  margin:0 0 18px 0;
  font-weight:800;
  line-height:1.05;
  font-size: clamp(44px, 5.6vw, 76px);
}

.chevista-hero__summary{
  font-size: clamp(16px, 1.4vw, 18px);
  line-height:1.6;
  max-width:52ch;
}

.chevista-hero__summary,
.chevista-hero__summary p,
.chevista-content,
.chevista-content p,
.chevista-content li{
  text-align:left;
}

.chevista-hero__media{
  justify-self: end;
  display:flex;
  justify-content:flex-end;
  width:100%;
}

/* =========================================================
   VIDEO + MASCHERA
   ========================================================= */

.chevista-eye{
  position: relative;
  width: 100%;
  max-width: 860px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #ffffff;
  margin-left: auto;
  transform: none;
  isolation: isolate;
}

/* Shift SOLO desktop */
@media (min-width: 722px){
  .chevista-eye{
    transform: translateX(22px);
  }
}

.chevista-eye__iframe,
.chevista-eye__poster,
.chevista-eye__mask{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Video sotto */
.chevista-eye__iframe{
  z-index: 1;
  border: 0;
  pointer-events: none;
}

/* Poster sopra il video */
.chevista-eye__poster{
  z-index: 2;
  object-fit: cover;
  object-position: center center;
  transition: opacity .28s ease, visibility .28s ease;
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  user-select: none;
}

/* Maschera sempre sopra tutto */
.chevista-eye__mask{
  z-index: 3;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
  user-select: none;
}

/* Stato: poster visibile */
.chevista-eye.is-poster-visible .chevista-eye__poster{
  opacity: 1;
  visibility: visible;
}

/* Stato: video visibile */
.chevista-eye.is-video-visible .chevista-eye__poster{
  opacity: 0;
  visibility: hidden;
}

/* Fallback aspect-ratio (browser vecchi) */
@supports not (aspect-ratio: 1 / 1){
  .chevista-eye::before{
    content:"";
    display:block;
    padding-top:56.25%;
  }
  .chevista-eye > *{
    position:absolute;
    inset:0;
  }
}

/* =========================================================
   AZIONI: INPUT + CERCA + CONTATTI
   ========================================================= */

.chevista-hero__actions{
  display:flex;
  align-items:center;
  gap:18px;
  margin-top:28px;
}

.chevista-search{
  display:flex;
  align-items:center;
  width:min(430px, 100%);
}

.chevista-search:focus-within .chevista-search__input{
  border-color:#e28b33;
}

.chevista-search__input{
  flex:1;
  height:40px;
  padding:0 18px;
  border:1px solid #d8dde6;
  border-right:0;
  border-radius:5px 0 0 5px;
  background:#fff;
  font-size:18px;
  outline:none;
}

.chevista-search__input::placeholder{
  color:#9aa3b2;
}

.chevista-search__btn{
  width:40px;
  height:40px;
  border:0;
  border-radius:0 5px 5px 0;
  background:#ef8504;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  padding:0;
}

.chevista-search__icon{
  width:40px;
  height:40px;
  display:block;
  background-image:url("https://chevista.com/wp-content/uploads/2026/01/icon04.svg");
  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;
}

/* Focus accessibile (fallback) */
.chevista-search__btn:focus{
  outline:2px solid #000;
  outline-offset:2px;
}
@supports selector(:focus-visible){
  .chevista-search__btn:focus{ outline:none; }
  .chevista-search__btn:focus-visible{
    outline:2px solid #000;
    outline-offset:2px;
  }
}

.chevista-btn{
  height:40px;
  padding:0 28px;
  border-radius:5px;
  background:#ef8504;
  color:#fff;
  letter-spacing:0.04em;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  white-space:nowrap;
  font-size:18px;
  font-weight:500;
}

/* =========================================================
   MOBILE HERO
   ========================================================= */

@media (max-width: 721px){
  .chevista-hero{
    margin-top:30px;
  }

  .chevista-hero__grid{
    grid-template-columns:1fr;
  }

  .chevista-hero__copy{
    text-align:left;
  }

  .chevista-hero__subtitle{
    display:block;
    text-align:center;
    margin-left:auto;
    margin-right:auto;
  }

  .chevista-hero__title{
    font-size: clamp(36px, 9vw, 52px);
    margin-bottom:14px;
    text-align:center;
  }

  .chevista-hero__summary{
    max-width:52ch;
    margin-left:auto;
    margin-right:auto;
    text-align:center;
  }

  
  .chevista-content p,
  .chevista-content li{
    text-align:left !important;
  }

  .chevista-hero__media{
    justify-content:center;
    justify-self:center;
  }

  .chevista-eye{
    margin-left:auto;
    margin-right:auto;
    max-width: min(560px, 100%);
    transform:none;
  }

  .chevista-hero__actions{
    flex-direction:row;
    justify-content:center;
    gap:16px;
  }

  .chevista-search{
    width:min(520px, 62vw);
  }

  .chevista-btn{
    width:auto;
  }
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1024px) and (min-width: 722px){
  .chevista-hero__grid{
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  }
  .chevista-eye{
    max-width: 760px;
  }
}

/* =========================================================
   HOME – SEZIONE TILES 2x2 FULL-WIDTH
   ========================================================= */

.chevista-tiles{
  background:#fff;
  padding: clamp(14px, 2vw, 22px) 0;

  position:relative;
  left:50%;
  transform:translateX(-50%);
  width:100vw;
  width:100dvw;

  margin:0;
  max-width:none;
  box-sizing:border-box;
}

.chevista-tiles__grid{
  width:100%;
  max-width:none;
  margin:0;

  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: clamp(6px, 1vw, 14px);

  padding:0;
  box-sizing:border-box;
}

.chevista-tile{
  position:relative;
  display:block;
  overflow:hidden;
  border-radius:0px;
  text-decoration:none;
  color:inherit;

  aspect-ratio:16 / 9;
  background:#f3f5f8;
}

.chevista-tile__img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
}

.chevista-tile__cta{
  position:absolute;
  top:80%;
  left: clamp(12px, 2vw, 22px);
  right: clamp(12px, 2vw, 22px);
  transform: translateY(-50%);

  display:flex;
  align-items:center;
  gap:12px;

  padding: clamp(10px, 1.4vw, 14px) clamp(12px, 1.8vw, 18px);
  border-radius:8px;

  background: rgba(255,255,255,0.88);
}

@supports ((-webkit-backdrop-filter: blur(6px)) or (backdrop-filter: blur(6px))){
  .chevista-tile__cta{
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
}

.chevista-tile__icon{
  width:34px;
  height:34px;
  flex:0 0 auto;
}

.chevista-tile__text{
  font-size: clamp(15px, 1.6vw, 22px);
  line-height:1.15;
  font-weight:500;
  color:#6b6b6b;
}

/* Focus accessibile (fallback) */
.chevista-tile:focus{
  outline:3px solid #000;
  outline-offset:4px;
}
@supports selector(:focus-visible){
  .chevista-tile:focus{ outline:none; }
  .chevista-tile:focus-visible{
    outline:3px solid #000;
    outline-offset:4px;
  }
}

@media (hover:hover){
  .chevista-tile:hover .chevista-tile__cta{
    background: rgba(255,255,255,0.86);
  }
}

/* Tablet */
@media (max-width: 920px){
  .chevista-tile{
    border-radius:6px;
  }
}

/* Mobile: 1 colonna */
@media (max-width: 600px){
  .chevista-tiles__grid{
    grid-template-columns:1fr;
  }
}

/* Fallback aspect-ratio tiles (browser vecchi) */
@supports not (aspect-ratio: 1 / 1){
  .chevista-tile::before{
    content:"";
    display:block;
    padding-top:56.25%;
  }
  .chevista-tile > *{
    position:absolute;
    inset:0;
  }
}

/* =========================================================
   HOME – CONTENUTO PAGINA (Gutenberg / editor)
   ========================================================= */

.chevista-pagecontent{
  padding: clamp(18px, 3vw, 40px) 0;
}

.chevista-content{
  max-width:1200px;
}

.chevista-content > *{
  max-width:100%;
}

.chevista-content > * + *{
  margin-top:1rem;
}

.chevista-content img,
.chevista-content video{
  max-width:100%;
  height:auto;
}

/* Focus link accessibile (fallback) */
.chevista-content a:focus{
  outline:3px solid #000;
  outline-offset:3px;
}
@supports selector(:focus-visible){
  .chevista-content a:focus{ outline:none; }
  .chevista-content a:focus-visible{
    outline:3px solid #000;
    outline-offset:3px;
  }
}

/* =========================================================
   HOME – PRODOTTI – MOBILE: CARD PIÙ COMPATTE
   ========================================================= */

@media (max-width: 600px){
  .chevista-pagecontent .woocommerce ul.products li.product,
  .chevista-pagecontent .woocommerce-page ul.products li.product{
    padding-bottom:10px;
    margin-bottom:14px;
  }

  .chevista-pagecontent .woocommerce ul.products li.product a img{
    width:100%;
    height:auto;
    aspect-ratio:1 / 1;
    object-fit:cover;
  }

  .chevista-pagecontent .woocommerce ul.products li.product .woocommerce-loop-product__title{
    font-size:16px;
    line-height:1.25;
    margin:8px 0 6px;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    overflow:hidden;
  }

  .chevista-pagecontent .woocommerce ul.products li.product .price{
    font-size:16px;
    margin-bottom:8px;
  }

  .chevista-pagecontent .woocommerce ul.products li.product .button{
    padding:10px 12px;
    font-size:16px;
    line-height:1;
  }

  .chevista-pagecontent .wc-block-grid__product,
  .chevista-pagecontent .wp-block-woocommerce-product-template .wc-block-product{
    padding-bottom:10px;
  }

  .chevista-pagecontent .wc-block-grid__product-image img,
  .chevista-pagecontent .wc-block-product__image img{
    width:100%;
    height:auto;
    aspect-ratio:1 / 1;
    object-fit:cover;
  }

  .chevista-pagecontent .wc-block-grid__product-title,
  .chevista-pagecontent .wc-block-product__title{
    font-size:16px;
    line-height:1.25;
    margin:8px 0 6px;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    overflow:hidden;
  }

  .chevista-pagecontent .wc-block-grid__product-price,
  .chevista-pagecontent .wc-block-product__price{
    font-size:16px;
    margin-bottom:8px;
  }

  .chevista-pagecontent .wc-block-grid__product-add-to-cart a,
  .chevista-pagecontent .wc-block-product__add-to-cart a{
    padding:10px 12px;
    font-size:16px;
    line-height:1;
  }
}
