/* ==========================================================================
   WP Product Page - Frontend Styles
   ========================================================================== */

.wppt-wrapper {
  --wppt-card-color: #4f86d7;
  --phi-hero-title-color: inherit;
  --phi-hero-subtitle-color: inherit;
  --phi-tab-text-color: #111111;
  --phi-tab-bg-color: #f5f5f5;
  padding: 0 4rem;
}

/* Hero Section - ESTILO COMPARTILHADO (Normal e Detalhes)
   ========================================================================== */
.wppt-solutions-hero {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin: 0 0 2rem;
  justify-content: space-between;
  min-height: 500px;
}

.wppt-solutions-hero .wppt-hero-media,
.wppt-hero-media {
  min-width: 280px;
}

.wppt-solutions-hero img.hero-img-principal,
img.hero-img-principal {
  width: 45vw;
  max-width: 700px;
  height: auto;
  max-height: 500px;
  top: 0px;
  right: 0px;
  border-bottom-left-radius: 80px;
  position: absolute;
}

.wppt-solutions-hero .wppt-hero-copy,
.copy {
  flex: 1;
}

.wppt-hero-title,
.copy h1 {
  margin: 2rem 0;
  font-weight: 700;
  font-size: 2.2rem;
  line-height: 1.2;
  color: var(--phi-hero-title-color, #4d82cc);
}

.wppt-hero-subtitle,
.copy p {
  margin: 0;
  font-size: 1.2rem;
  opacity: 0.9;
  line-height: 1.4;
  color: var(--phi-hero-subtitle-color, #313131);
}

/* Tabs Navigation - MODIFICADO: Tabs com mesmo tamanho
   ========================================================================== */
.tab-styles {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  width: 100%;
}

.tab-styles button {
  flex: 1; /* Isso faz com que todas as tabs tenham o mesmo tamanho */
  border: none;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-radius: 8px;
  background-color: var(--phi-tab-bg-color, #f5f5f5);
  color: var(--phi-tab-text-color, inherit);
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
  font-weight: 600;
  text-align: center;
  min-width: 20px; /* Permite que o texto seja truncado se necessário */
}

.tab-styles button span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-styles button[aria-selected='true'] {
  background-color: var(--wppt-card-color, #4f86d7);
  color: #fff;
}

/* Products List
   ========================================================================== */
.wppt-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Product Card
   ========================================================================== */
.wppt-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: var(--wppt-card-color, #4f86d7);
  display: flex;
  flex-direction: column;
  height: 320px;
  transition:
    height 0.5s ease,
    box-shadow 0.5s ease,
    transform 0.3s ease;
  will-change: height, box-shadow, transform;
}

.wppt-card:hover {
  height: 24rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transform: translateY(-5px);
}

.wppt-card a {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.wppt-hero {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.wppt-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transform: scale(1.05);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
  will-change: opacity, transform;
}

.wppt-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    var(--wppt-card-color, #4f86d7) 0%,
    rgba(0, 0, 0, 0) 60%
  );
  transition: background 0.5s ease;
  pointer-events: none;
}

.wppt-card:hover .wppt-hero img {
  opacity: 1;
  transform: scale(1);
}

.wppt-body {
  position: relative;
  z-index: 1;
  padding: 1.5rem;
  height: 100%;
  display: flex;
  align-items: flex-end;
}

.wppt-head {
  color: #fff;
}

.wppt-icon {
  display: inline-block;
  color: #fff;
  margin-bottom: 0.5rem;
  line-height: 1;
  font-size: 1.8rem;
}

.wppt-icon svg,
.wppt-icon svg * {
  fill: currentColor;
  width: 1em;
  height: 1em;
}

.wppt-title {
  margin: 0 0 0.5rem;
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.2;
  color: #fff;
}

.wppt-desc {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.35;
  max-width: 36ch;
  margin: 0;
}

.wppt-meta {
  position: relative;
  z-index: 1;
  padding: 0 1.5rem 1.5rem;
  color: #fff;
  font-size: 0.95rem;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(6px);
  transition:
    opacity 0.5s ease,
    max-height 0.5s ease,
    transform 0.5s ease;
}

.wppt-card:hover .wppt-meta {
  opacity: 1;
  max-height: 500px;
  transform: translateY(0);
}

.wppt-highlights {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.wppt-highlights li {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0.75rem 0;
}

.wppt-highlights .wppt-icon {
  font-size: 1rem;
  margin-bottom: 0;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* Product Detail Page - ATUALIZADO para manter consistência
   ========================================================================== */
.wppt-detail {
  padding: 1rem 0;
}

.wppt-detail #back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--wppt-card-color, #4f86d7);
  text-decoration: none;
  font-weight: 600;
}

.wppt-detail #back-link:hover {
  text-decoration: underline;
}

/* Detalhes do Produto */
.wppt-details-grid {
  display: grid;
  grid-template-columns: auto auto;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.wppt-detail-item {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  background: #f5f7fb;
  border-radius: 12px;
  align-items: flex-start;
}

.detail-icon {
  color: var(--wppt-card-color, #4f86d7);
  width: 20px;
  height: 20px;
}

.detail-content h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  color: #333;
}

.detail-content p {
  margin: 0;
  font-size: 0.95rem;
  color: #666;
  line-height: 1.4;
}

/* Removendo estilos antigos não utilizados */
.wppt-columns,
.wppt-box {
  display: none;
}

/* Responsive Design
   ========================================================================== */
@media (max-width: 1024px) {
  .wppt-solutions-hero {
    flex-direction: column;
  }

  .hero-img-principal {
    display: none;
  }

  .wppt-solutions-hero .wppt-hero-media,
  .wppt-hero-media {
    width: 100% !important;
    min-width: auto;
  }

  .wppt-hero-title,
  .copy h1 {
    font-size: 1.8rem;
  }

  .wppt-hero-subtitle,
  .copy p {
    font-size: 1.1rem;
  }
}

@media (max-width: 900px) {
  .wppt-details-grid {
    grid-template-columns: auto;
  }
}

@media (max-width: 640px) {
  .wppt-list {
    grid-template-columns: 1fr;
  }

  .wppt-card {
    height: 280px;
  }

  .wppt-card:hover {
    height: 22rem;
  }

  .tab-styles {
    width: 100% !important;
    flex-direction: column;
  }

  .tab-styles button {
    width: 100%;
    flex: none;
  }

  .wppt-details-grid {
    grid-template-columns: 1fr;
  }
}

/* Touch device optimizations */
@media (hover: none) {
  .wppt-hero img {
    opacity: 1;
    transform: scale(1);
  }

  .wppt-card {
    height: 24rem;
  }

  .wppt-meta {
    opacity: 1;
    max-height: none;
    transform: none;
  }
}

/* Accessibility improvements */
.tab-styles button:focus {
  outline: 2px solid var(--wppt-card-color, #4f86d7);
  outline-offset: 2px;
}

.wppt-card a:focus {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

/* Loading state */
.wppt-card .wppt-hero img {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
