/* Ajustes em variáveis e correções */
:root{
    --branco: #ffffff; /* corrigido (#ffff -> #ffffff) */
    --gelo: #f1f1f1;
    --vermelho: #a10f0f;
    --preto: #2a2a2a;
    --pretos: #2a2a2a; /* usado em 'a' */
}

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Libertinus+Serif+Display&display=swap');
body{
    font-family: "Bebas Neue", sans-serif;
    
}
.toolbar{
    height: 63px;
}

.tab-link{
    display: flex;
    justify-content: center;
    flex-flow: column wrap;
}

.toolbar-inner{
    background: var(--branco);
    border-top: 1px solid var(--gelo);
}

.toolbar-inner .link{    
    flex:1;
    height: 80px;  
    line-height: 25px; 
	font-weight:bold;
    color: var(--vermelho);    
}

.toolbar-inner .link:not(.active){
    color:var(--preto);
	font-weight:normal;
}

.toolbar-inner > .link i{
    font-size: 28px;
}

.top-nav {
  width: 100%;
  height: 60px;
  background: linear-gradient(90deg,#25f4ee 0%,#010101 50%, #fe2c55 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative; /* necessário para o ::after funcionar */
}

.top-nav::after {
  content: "";
  position: absolute;
  top: 2%;
  left: 60%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100px;
  background-image: url("../img/natal.gif"); /* segunda imagem */
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
  z-index: 10;
}

.title-logo{
    font-weight: 600;
    margin: 5%;
}

.title-logo span{
    color: var(--vermelho);
}

/* Melhor posicionamento do botão do carrinho e alvo de toque maior */
.btn-cart {
    position: relative; /* necessário para ::before */
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-size: 22px;
    color: var(--preto);
    border-radius: 8px;
    background: transparent;
    touch-action: manipulation;
}

.btn-cart::before{
    content: attr(data-count);
    background:linear-gradient(rgba(0, 162, 255, 0.897),black,red);
    min-width: 12px;
    height: 15px;
    padding: 0 4px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--branco);
    position: absolute;
    top: 6px;
    right: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

a {
    color: var(--pretos);
    font-weight: 600;
    text-decoration: none;
}

form{
    padding-top: 10px;
    background: var(--branco);
    padding-bottom: 20px;
    position: relative;
}

input[type="text"] {
    width: 90%;
    height: 45px;
    border-radius: 10px;
    margin: auto;
    padding: 10px 20px;
    background: var(--gelo);
}

::placeholder{
    color: #b3afaf;
}

.icone-busca{
    position: absolute;
    top: 0px;
    right: 5%;
    font-size: 27px;
    padding: 13px;
}

.page-content{
    background: var(--branco);
    border-radius: 10px;
    margin-top: 10px;
}

.swiper {
      width: 100%;
      height: 100%;
       border-radius: 12px;
    }

    .swiper-slide {
      text-align: center;
      font-size: 18px;
      background: #fff;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .swiper-slide img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .block{
        margin-left: 2%;
        margin-right:2% ;
    }

.filter-btn{
    width: 100%;
    height: 35px;
    background: none;
    border: 2px solid var(--preto);
    border-radius: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-btn.active{
    background:linear-gradient(90deg,#25f4ee 0%,#010101 50%, #fe2c55 100%) ;
    color: var(--branco);
    border: 1px solid;
    
}

.row{
    display: flex; /* garantido como flex container */
    flex-wrap: wrap;
    flex-direction: row;
    gap: 4%; /* espaçamento consistente entre colunas */
    align-items: flex-start;
}

.item{
    color: var(--preto);
}

/* Imagens responsivas: usar aspect-ratio + fallback e limitar altura */
.img-container{
    display: block;
    width: 100%;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    background: var(--gelo);

    /* Preferência por aspect-ratio em navegadores modernos */
    aspect-ratio: 16/10;
    /* Limita altura: mínimo 140px, ideal 22vh, máximo 360px */
    max-height: clamp(140px, 22vh, 360px);
}

/* Fallback para navegadores sem aspect-ratio */
@supports not (aspect-ratio: 1/1) {
    .img-container{
        height: 0;
        padding-bottom: 62.5%; /* equivalente a 16:10 */
    }
}

.img-container img{
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   object-fit: cover;
   border-radius: 10px;
   display: block;
   /* evita que imagens muito altas forcem layout */
   max-height: 100%;
}

/* Ajuste do skeleton para acompanhar a nova técnica */
.img-skeleton{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border-radius: 10px;
    background: var(--gelo);

    aspect-ratio: 16/10;
    max-height: clamp(140px, 22vh, 360px);
}
@supports not (aspect-ratio: 1/1) {
    .img-skeleton{
        height: 0;
        padding-bottom: 62.5%;
    }
}

/* Limita imagens do slider (swiper) para não excederem o visual do card */
.swiper-slide img {
    width: 100%;
    height: auto;
    max-height: clamp(160px, 30vh, 420px);
    object-fit: cover;
    display: block;
}

/* Evita mínimos muito grandes em telas pequenas */
.item-card {
    /* ...existing declarations... */
    min-height: 0; /* permite que o cartão se ajuste à imagem e conteúdo */
}

/* Media queries mais específicas para refinar tamanhos */
@media (max-width: 420px) {
    .img-container,
    .img-skeleton {
        aspect-ratio: 4/3;
        max-height: clamp(120px, 24vh, 260px);
    }
    .swiper-slide img {
        max-height: clamp(120px, 26vh, 300px);
    }
}

@media (min-width: 1200px) {
    .img-container,
    .img-skeleton {
        aspect-ratio: 16/9;
        max-height: clamp(200px, 28vh, 520px);
    }
    .swiper-slide img {
        max-height: clamp(220px, 36vh, 600px);
    }
}

/* Pequenas melhorias visuais */
.price{
    font-size: 20px;
    margin-left: 10%;
}

/* Media queries para dispositivos móveis e tablets */
@media (max-width: 600px) {
    .top-nav{
        height: 56px;
        padding: 8px 12px;
    }
    .title-logo{
        margin: 4%;
        font-size: 20px;
    }
    .btn-cart {
        width: 48px;
        height: 48px;
        font-size: 20px;
        margin-right: 12px;
    }
    .toolbar-inner .link{
        height: 70px;
        font-size: 14px;
    }
    .item-card{
        flex: 48%;
        min-height: 200px;
        margin-right: 6%;
    }
    .price{
        font-size: 18px;
        margin-left: 8%;
    }
    .img-skeleton{
        padding-bottom: 66.66%;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .item-card{
        flex: 30%;
        min-height: 220px;
    }
    .img-skeleton{
        padding-bottom: 60%;
    }
}

@media (min-width: 900px) {
    .item-card{
        flex: 20%;
        min-height: 240px;
    }
    .img-skeleton{
        padding-bottom: 56%;
    }
}

/* Força 2 itens por linha em telas pequenas (<= 400px) */
@media (max-width: 400px) {
    .row {
        gap: 4%;
    }
    .item-card{
        flex: 0 0 calc(50% - 4%); /* ocupa metade da largura menos gap */
        max-width: calc(50% - 4%);
        margin-right: 0;
        margin-bottom: 12px;
    }
    /* garante que o segundo item da linha não ganhe margem extra */
    .item-card:nth-child(2n){
        margin-right: 0;
    }
}


/* ============================= */
/* 🧩 Correções específicas para iPhone 7 / Safari antigo */
/* ============================= */
@supports (-webkit-touch-callout: none) {
    body {
        -webkit-text-size-adjust: 100% !important;
        font-family: "Bebas Neue", Arial, sans-serif !important;
    }

    /* Corrige desalinhamento das imagens */
    .img-container img,
    .swiper-slide img {
        object-fit: cover !important;
        display: block !important;
        width: 100% !important;
        height: auto !important;
    }

    /* Força alinhamento central de itens */
    .row {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: flex-start !important;
    }

    /* Corrige fontes azuis (Safari bug em <a>) */
    a, a:visited, a:active {
        color: #2a2a2a !important;
        text-decoration: none !important;
    }

    /* Ajuste de altura e espaço inferior */
    .item-card:last-child,
    .item:last-child {
        margin-bottom: 120px !important;
    }
}
