/* Estilos específicos para cards de produto (carregado após o Tailwind) */

:root{
    --price-color: #00a650; /* Verde para preços */
    --primary: #015DA2;
    --primary-700: #014A81;
    --accent: #F97316; /* Laranja para destaque */
    --bg: #E6F0F6;
    --card-radius: 16px; /* Bordas mais arredondadas */
    --card-shadow: 0 4px 15px rgba(2,6,23,0.05);
    --card-shadow-hover: 0 10px 30px rgba(2,6,23,0.1);
    --muted: #64748b;
    --transition-medium: 220ms;
}

/* Grid helper (aplique na seção que contém os cards) */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

/* Novo layout para a grade de produtos em largura total */
.products-grid-full-width {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
    padding: 0 2rem; /* Espaçamento nas laterais */
    max-width: 1600px; /* Largura máxima para a grade */
    margin: 0 auto;
}

/* --- V2 Product Card --- */
.product-card-v2 {
    background: #fff;
    border-radius: var(--card-radius);
    border: 1px solid #eef2f5;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.product-card-v2:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-shadow-hover);
}
.product-card-v2__media {
    display: block;
    background-color: #fff;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.product-card-v2__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.75rem;
    transition: transform 0.4s ease;
}
.product-card-v2:hover .product-card-v2__media img {
    transform: scale(1.05);
}
.product-card-v2__info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.product-card-v2__title-link {
    text-decoration: none;
    color: inherit;
}
.product-card-v2__title {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
    line-height: 1.4;
    /* Limita o título a 2 linhas */
    height: 2.66em; /* 1.4 * 0.95rem * 2 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.5rem;
}
.product-card-v2__price-section {
    margin-top: auto; /* Empurra para o final */
    padding-top: 0.5rem;
}
.product-card-v2__original-price {
    font-size: 0.8rem;
    color: #94a3b8;
    text-decoration: line-through;
}
.product-card-v2__price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--price-color);
    line-height: 1;
}
.product-card-v2__actions {
    margin-top: 0.75rem;
}
.product-card-v2__add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.6rem;
    font-weight: 600;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    background-color: transparent;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}
.product-card-v2__add-btn:hover {
    border-color: var(--primary);
    background-color: var(--primary);
    color: #fff;
}
/* --- Fim V2 Product Card --- */

/* Card base (mantém compatibilidade com .card .product-card existentes) */
.card.product-card {
  border-radius: var(--card-radius);
  overflow: hidden;
  background: #fff;
  border: 1px solid #eef2f5;
  transition: transform var(--transition-medium) ease, box-shadow var(--transition-medium) ease;
  display: flex;
  flex-direction: column;
}
.card.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--card-shadow-hover);
}

/* Media area: mantém square aspect-ratio already in template; add subtle vignette & center */
.product-media {
  position: relative;
  background-color: #f8fafc;
  overflow: hidden;
  display: block;
}
.product-media img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Alterado para 'contain' para evitar cortes */
  aspect-ratio: 1 / 1; /* Garante que a imagem seja quadrada */
  transition: transform 420ms cubic-bezier(.2,.9,.3,1);
  padding: 0.5rem; /* Adiciona um respiro para a imagem não colar nas bordas */
}
.card.product-card:hover .product-media img {
  transform: scale(1.06) translateY(-2px);
}
/* subtle overlay for focus/contrast */

/* Info area */
.product-info {
  padding: 12px 16px 16px; /* Ajusta o padding */
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  text-align: left;
}

/* Title and meta */
.product-title {
  font-weight: 700;
  color: #072044;
  font-size: 1rem;
  line-height: 1.2;
  line-height: 1.4; /* Altura da linha para cálculo */
  max-height: 2.8em; /* 1.4em (line-height) * 2 (linhas) = 2.8em */
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}
.product-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

/* Bottom row: price (left) and small add button (right) */
.product-actions {
  margin-top: auto; /* Empurra para o final do card */
  display: flex;
  align-items: center;
  flex-wrap: wrap; /* Permite que os itens quebrem para a próxima linha */
  justify-content: space-between;
  gap: 12px; /* Espaçamento entre preço e botão */
}

/* Price styles */
.product-price {
  color: #1e293b; /* Cor mais escura para o preço final */
  font-weight: 800;
  font-size: 1.2rem;
  display: inline-block;
  line-height: 1.2; /* Melhora o alinhamento vertical */
}
.product-promo-price {
  font-size: 0.85rem;
  text-decoration: line-through;
  margin-right: 6px;
  display: inline-block;
}

/* Small add button (unstyled forms/links inside cards will match) */
.add-to-cart-form,
.product-action {
  margin: 0;
}
.add-to-cart-form {
  display: inline-flex;
  align-items: center;
}
.add-to-cart-form button,
.product-action .btn {
  background-color: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, transform 0.2s ease;
}
.add-to-cart-form button:hover,
.product-action .btn:hover {
  background-color: var(--primary-700);
  transform: scale(1.05);
}

/* If the add control is a link, style to look like button */
.product-action a.button-like {
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

/* Price badge variant for featured/hero cards */
.price-badge {
  background: rgba(1,93,162,0.06);
  color: var(--primary);
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
}

/* Accessibility / Focus */
.add-to-cart-form button:focus,
.product-action .btn:focus,
.card:focus-within {
  outline: 3px solid rgba(1,93,162,0.12);
  outline-offset: 3px;
}

/* Responsive tweaks */
@media (max-width: 900px) {
    .products-grid-full-width {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        padding: 0 1.5rem;
    }
}
@media (max-width: 480px) {
    .products-grid-full-width {
        grid-template-columns: repeat(2, 1fr); /* Duas colunas no celular */
        gap: 16px;
        padding: 0 1rem;
    }
}

/* Utility: center CTA block */
.cta-center { display:flex; justify-content:center; gap:12px; padding: 24px 0; }

/* --- Estilos do Carrossel de Banners --- */

.carousel-container {
    position: relative;
    width: 100%;
    height: 100vh; /* Ocupa a altura total da tela */
    overflow: hidden;
    background-color: #000; /* Fundo para o carregamento da imagem */
    z-index: 1;
}

.carousel-track {
    position: relative;
    height: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    animation: carousel-fade 14s infinite; /* 2 slides * 7s = 14s */
}

.slide:nth-child(2) {
    animation-delay: 7s; /* Inicia a animação do segundo slide após 7s */
}

@keyframes carousel-fade {
    0% { opacity: 0; }
    7% { opacity: 1; } /* Fade in (1s de 14s) */
    50% { opacity: 1; } /* Fica visível (6s de 14s) */
    57% { opacity: 0; } /* Fade out (1s de 14s) */
    100% { opacity: 0; }
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Garante que a imagem cubra o espaço sem distorcer */
    object-position: center;
}

/* Conteúdo sobreposto (título, texto e botão) */
.slide-content {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    text-align: center;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    width: 90%;
    max-width: 600px;
    padding: 20px;
}

.slide-title {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    font-weight: 800; /* extra-bold */
}

.slide-description {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    background-color: #ffc107; /* Amarelo vibrante */
    color: #000;
    padding: 15px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2rem;
    text-shadow: none;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.cta-button:hover {
    background-color: #ffda6a;
    transform: scale(1.05);
}

/* Botões de navegação (anterior/próximo) */
.carousel-button {
    display: none; /* Esconde os botões de navegação */
}

.carousel-button:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.carousel-button.prev { left: 15px; }
.carousel-button.next { right: 15px; }

/* Indicadores de posição (bolinhas) */
.carousel-indicators { display: none; } /* Esconde os indicadores */

/* --- Responsividade para Celulares --- */
@media (max-width: 768px) {
    .carousel-container {
        height: auto; /* Altura automática para celular */
        min-height: 50vh;
        background-color: #fff; /* Fundo branco no mobile */
    }
    .slide {
        position: static;
        height: auto;
        opacity: 1;
        animation: none;
    }
    .slide:nth-child(2) {
        display: none;
    }
    .slide-content {
        left: 0;
        bottom: 5%;
        max-width: 100%;
        text-align: center;
    }
    .slide-title {
        font-size: 2.2rem;
    }
    .slide-description {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }
    .cta-button {
        padding: 12px 24px;
        font-size: 1rem;
        margin: 0 auto; /* Centraliza o botão */
    }
    .carousel-button {
        font-size: 1.5rem;
        padding: 8px 12px;
    }
}

/* --- Estilos do Banner Intermediário --- */
.intermediate-banner-section {
    height: 70vh; /* Altura padrão */
    max-height: 600px; /* Limita a altura máxima em telas muito grandes */
    background-color: #000; /* Fundo para o carregamento da imagem */
}

/* --- Responsividade para o Banner Intermediário --- */
@media (max-width: 768px) {
    .intermediate-banner-section {
        height: auto; /* Altura automática para celular */
        min-height: auto;
    }
}

/* --- Novos Estilos da Seção Sobre (Layout Estendido) --- */
.about-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    background-color: var(--bg);
    min-height: 500px;
    overflow: hidden; /* Garante que nada vaze */
}

.about-image-container {
    height: 100%;
    overflow: hidden;
}

.about-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.about-section:hover .about-image-container img {
    transform: scale(1.05);
}

.about-content-container {
    padding: 3rem 5rem;
    display: flex;
    align-items: center;
}

.cta-button-secondary {
    display: inline-block;
    background-color: var(--primary);
    color: #fff;
    padding: 14px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.cta-button-secondary:hover {
    background-color: var(--primary-700);
    transform: translateY(-2px);
}

/* Responsividade para a seção "Sobre" */
@media (max-width: 900px) {
    .about-section {
        grid-template-columns: 1fr; /* Coluna única */
    }
    .about-image-container {
        height: auto; /* Altura automática para a imagem no mobile */
    }
    .about-image-container img {
        object-fit: contain; /* Mantém a imagem completa no mobile */
    }
    .about-content-container { padding: 3rem 2rem; }
}

/* --- Estilos da Seção de Diferenciais --- */
.differentiators-section {
    padding: 9rem 0 5rem; /* Ajusta o padding para a transição com o rodapé */
    background-color: transparent; /* Deixa o fundo transparente, herdando a cor do site */
}

.differentiator-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.differentiator-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--bg), #fff);
    box-shadow: 8px 8px 16px #d4dde3, -8px -8px 16px #ffffff;
    color: var(--primary);
    transition: all 0.4s ease;
}

.differentiator-icon svg {
    width: 40px;
    height: 40px;
    transition: transform 0.4s ease;
}

.differentiator-item:hover .differentiator-icon {
    color: var(--accent);
    box-shadow: inset 8px 8px 16px #d4dde3, inset -8px -8px 16px #ffffff;
}
.differentiator-item:hover .differentiator-icon svg {
    transform: scale(1.1);
}

/* --- Estilos para Seções de Recomendação de Produto --- */
.product-recommendation-section {
    padding: 3rem 0;
    margin-top: 2rem;
    border-top: 1px solid #e5e7eb;
}
.product-recommendation-section__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    margin-bottom: 2rem;
}
/* Ajuste para a grade de produtos dentro da seção de recomendação */
.product-recommendation-section .products-grid-full-width {
    padding: 0; /* Remove o padding extra pois a seção já tem */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Cards um pouco menores */
}
