/* CORREÇÃO DE OVERFLOW HORIZONTAL - RESPONSIVIDADE */
/* Previne scroll horizontal em todos os tamanhos de tela */

/* Reset global para prevenir overflow */
* {
  box-sizing: border-box !important;
}

html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
}

/* Containers principais */
.container,
.main-container,
.content,
.page-content {
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

/* Grid de produtos responsivo */
#grid,
.products-grid,
.grid {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

/* Cards de produtos */
article[data-product-id] {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* MOBILE - Ajustes específicos */
@media screen and (max-width: 768px) {
  /* Força grid 2 colunas com gap responsivo */
  #grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: clamp(8px, 2vw, 15px) !important;
    padding: 0 clamp(8px, 2vw, 15px) !important;
  }

  /* Cards da GRADE DE PRODUTOS - mantém espaçamento original */
  #grid > article[data-product-id] {
    width: 100% !important;
    min-width: 140px !important;
    max-width: 160px !important;
    margin: 0 auto !important;
  }

  /* Container do CAROUSEL mobile - sem limitações */
  #featuredProductsContainer {
    /* Permitir que o carrossel funcione livremente */
    display: flex !important;
    gap: 10px !important;
  }

  /* Cards do CAROUSEL mobile - sem limites de largura */
  .featured-product-card {
    flex-shrink: 0 !important;
    /* Larguras definidas pelo JavaScript */
  }
}

/* DESKTOP - Ajustes específicos */
@media screen and (min-width: 769px) {
  /* Grid desktop responsivo */
  #grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    gap: clamp(15px, 2vw, 25px) !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
  }

  /* Cards desktop */
  article[data-product-id] {
    width: 100% !important;
    max-width: 220px !important;
    margin: 0 auto !important;
  }
}

/* Headers e navegação - REMOVIDO (migrado para header.css) */

/* Imagens responsivas */
img {
  max-width: 100% !important;
  height: auto !important;
}

/* Prevenir elementos com largura fixa que causam overflow */
div, section, article, main {
  max-width: 100% !important;
}

/* Containers de modais e overlays */
.modal,
.overlay,
.drawer {
  max-width: 100vw !important;
  overflow-x: hidden !important;
}