/* =========================================
   PÁGINA VITRINE (Category Page)
========================================= */

/* =========================================
1. RESET E VARIÁVEIS GLOBAIS
 ========================================= */
:root {
  /* Paleta de Cores JKB Store */
  --color-orange: #ff5722;
  --color-orange-hover: #e64a19;
  --color-blue-dark: #1a0b52;
  --color-blue-btn: #2d1b70;
  --color-text-dark: #1f1f1f;
  --color-text-light: #64626b;
  --color-white: #ffffff;
  --color-bg-light: #f9f9f9;
  --color-gray-border: #e0e0e0;

  /* Configurações */
  --container-width: 1820px;
  --border-radius-pill: 50px;
  --border-radius-card: 16px;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", sans-serif;
  color: var(--color-text-dark);
  background-color: var(--color-white);
  line-height: 1.5;
  overflow-x: hidden;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
  /* overflow: clip; */
}

.btn {
  display: inline-block;
  padding: 12px 32px;
  border-radius: var(--border-radius-card);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn-orange {
  background-color: var(--color-orange);
  color: var(--color-white);
}

.btn-orange:hover {
  background-color: var(--color-orange-hover);
  transform: translateY(-2px);
}

.btn-dark {
  background-color: var(--color-blue-btn);
  color: var(--color-white);
}

.btn-dark:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.2;
}

/* =========================================
2. NAVBAR
========================================= */
.navbar {
  padding: 10px 0;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border-radius: 0 0 24px 24px;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease-in-out;
}

.navbar.scrolled {
  padding: 10px 0;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 1);
}

.navbar.scrolled .logo-img {
  height: 40px;
  width: 40px;
  transition: all 0.3s ease-in-out;
  border-radius: 0;
}

.navbar.scrolled .nav-links a {
  font-size: 1rem;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-menu-wrapper {
  display: flex;
  align-items: center;
  gap: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 5px;
}

.logo-img {
  height: 70%;
  width: 70%;
  transition: all 0.3s ease-in-out;
  border-radius: 0;
}

.nav-links {
  display: flex;
  gap: 40px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--color-blue-dark);
  font-weight: 500;
  font-size: 1.2rem;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--color-orange);
}

.nav-icons {
  display: flex;
  gap: 60px;
  align-items: center;
}

.nav-icons i {
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-blue-dark);
  transition: var(--transition);
}

.nav-icons i:hover {
  color: var(--color-orange);
}

.mobile-toggle,
.mobile-menu-left,
.mobile-inner-header {
  display: none;
}

.nav-header-mobile {
  display: contents; /* No desktop, o logo age normalmente */
}

/* Botão Fechar dentro do menu */
.mobile-close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--color-blue-dark);
  cursor: pointer;
}

/* =========================================
   DROPDOWN MENU
========================================= */

.dropdown-trigger {
  position: relative;
  height: 100%;
}

.dropdown-menu {
  position: absolute;
  top: 40px;
  left: -20px;
  background-color: #fff;
  width: 220px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 15px 0;
  list-style: none;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.dropdown-menu li {
  padding: 0;
}

.dropdown-menu li a {
  display: block;
  padding: 10px 25px;
  font-size: 1rem;
  color: var(--color-text-light);
  font-weight: 400;
  transition:
    background 0.2s,
    color 0.2s;
}

.dropdown-menu li a:hover {
  background-color: #f5f5f5;
  color: var(--color-orange);
}

.dropdown-menu .divider {
  background-color: #eee;
  margin: 8px 0;
}

.dropdown-trigger:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-trigger.menu-open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-trigger:hover .fa-chevron-down,
.dropdown-trigger.menu-open .fa-chevron-down {
  transform: rotate(180deg);
}

.fa-chevron-down {
  transition: transform 0.3s ease;
}

/* --- HERO DA CATEGORIA --- */
.category-hero {
  height: 50vh;
  width: 100%;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-end;
  background-image: url(public/assets/cover_vitrine.png);
  padding-bottom: 100px;
}

/* Gradiente para garantir leitura do texto sobre a imagem */
.category-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0) 60%
  );
}

.hero-cat-content {
  position: relative;
  z-index: 2;
  width: 100%;
  text-align: left;
}

.hero-cat-content h1 {
  color: white;
  font-size: 3.5rem;
  font-weight: 700;
  text-align: inherit;
}

/* --- TOOLBAR (Contagem e Filtros) --- */
.products-section {
  padding: 40px 0 80px 0;
  background-color: #ffffff; /* Fundo levemente cinza da página */
}

.toolbar {
  display: flex;
  justify-content: flex-end; /* Alinha tudo à direita */
  align-items: center;
  gap: 30px;
  margin-bottom: 40px;
}

.product-count {
  color: var(--color-text-light);
  font-size: 0.9rem;
  font-weight: 500;
}

.btn-filter {
  background: transparent;
  border: 2px solid var(--color-blue-dark);
  color: var(--color-blue-dark);
  padding: 8px 24px;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s;
}

.btn-filter:hover {
  background-color: var(--color-blue-dark);
  color: white;
}

/* --- GRID DE PRODUTOS --- */
.product-grid {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  max-width: 100%;
  justify-content: center;
  align-items: center;
}

/* --- CARD DE PRODUTO --- */
.product-card {
  flex: 0 1 calc(25% - 24px);
  min-width: 250px;
  background-color: white;
  border-radius: 16px;
  padding: 0px 0 0 20px;
  position: relative;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

/* Ícone de Favoritar (Coração) */
.wishlist-btn {
  position: absolute;
  top: 25px;
  right: 25px;
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--color-blue-dark);
  cursor: pointer;
  z-index: 5;
  transition: transform 0.2s;
}

.wishlist-btn:hover {
  transform: scale(1.1);
}

.wishlist-btn i.fa-solid {
  color: var(--color-blue-dark); /* Coração preenchido */
}

/* Imagem do Produto */
.card-img-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  overflow: hidden;
}

.card-img-wrap img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  border-radius: 18px;
  transition: opacity 0.4s ease-in-out;
}

.img-hover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 2;
}

.product-card:hover .img-hover {
  opacity: 1;
}

/* Informações do Produto */
.card-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 20px;
}

.card-info h3 {
  font-size: 0.95rem;
  color: #190068;
  font-weight: 400;
  margin-bottom: 5px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 60%;
}

.card-detail {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin-bottom: 15px;
}

/* Bolinhas de Cores */
.color-variants {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid #ddd;
}

/* Botão "Ver Produto" */
.btn-product {
  background-color: var(--color-blue-dark);
  color: white;
  text-align: center;
  padding: 10px 0;
  border-radius: 15px; /* Arredondado completo */
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: auto;
  margin-left: -10px;
  width: 40%;
  display: block;
}

.btn-product:hover {
  background-color: var(--color-orange);
  color: white;
}

/* =========================================
11. FOOTER
========================================= */
.footer {
  background-color: #f0f0f0;
  padding: 60px 0 20px;
  font-size: 0.9rem;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 40px;
  padding-top: 20px;
}

.footer-logo img {
  height: 80px;
  margin-bottom: 20px;
}

.footer-links {
  display: flex;
  gap: 80px;
  margin-left: auto;
  margin-right: 60px;
}

.footer-links h4 {
  color: var(--color-blue-dark);
  margin-bottom: 15px;
  font-size: 1rem;
}

.footer-links ul {
  list-style: none;
}

.footer-links ul li {
  margin-bottom: 10px;
}

.footer-links a {
  text-decoration: none;
  color: var(--color-blue-dark);
  transition: var(--transition);
  font-weight: 700;
}

.footer-links a:hover {
  color: var(--color-orange);
}

.social-links {
  text-align: left;
  border-left: 2px solid #1a0b52;
  padding-left: 40px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 100px;
}

.social-links p {
  font-weight: 400;
  color: var(--color-blue-dark);
}

.social-links a {
  color: var(--color-blue-dark);
  font-size: 1.8rem;
  transition: var(--transition);
  display: inline-block;
}

.social-links a:hover {
  color: var(--color-orange);
  transform: translateY(-3px);
}

.copyright {
  text-align: left;
  border-top: 1px solid #d1d1d1;
  padding-top: 30px;
  color: var(--color-blue-dark);
  font-size: 0.85rem;
  max-width: 100%;
  margin: 0 auto;
}

/* --- RESPONSIVIDADE VITRINE --- */

/* Tablet (Até 1024px) -> 3 Colunas */

/* Tablet Menor (Até 768px) -> 2 Colunas */
@media (max-width: 768px) {
  .category-hero {
    height: 250px;
  }

  .hero-cat-content h1 {
    font-size: 2.5rem;
  }

  /* Ajustes finos no card mobile */
  .card-img-wrap {
    height: 160px;
  }

  .card-info h3 {
    font-size: 0.85rem;
  }

  .btn-product {
    font-size: 0.8rem;
    padding: 8px 0;
  }
}

/* Celular (Até 480px) -> 1 Coluna (ou manter 2 se preferir grid apertado) */
@media (max-width: 480px) {
  .toolbar {
    justify-content: center;
    flex-direction: column;
  }
}

@media (min-width: 993px) {
  .mobile-menu-left,
  .mobile-inner-header {
    display: none !important;
  }

  .mobile-menu-right {
    display: flex;
    flex-direction: row-reverse;
    gap: 100px;
  }
}

/* --- RESPONSIVIDADE (MEDIA QUERIES) --- */

/* Telas Grandes */
@media (min-width: 1400px) {
  .product-card {
    flex: 0 1 calc(25% - 24px);
  }
}

/* Notebooks/Tablets Grandes */
@media (max-width: 1399px) {
  .product-card {
    flex: 0 1 calc(33.333% - 24px);
  }

  .container {
    max-width: 1250px;
  }

  img {
    width: 90%;
  }

  .wishlist-btn {
    top: 15px;
    right: 55px;
    font-size: 1.4rem;
  }
}

/* Tablets (Até 1024px) */
@media (max-width: 1024px) {
  .product-card {
    flex: 0 1 calc(50% - 20px);
  }
}

/* Tablets Pequenos (Até 768px) */
@media (max-width: 768px) {
  .product-card {
    flex: 0 1 calc(50% - 15px);
  }
}

/* Celulares (Até 480px) */
@media (max-width: 480px) {
  .product-card {
    flex: 0 1 100%;
    max-width: 350px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-blue-dark);
  cursor: pointer;
}

.nav-header-mobile {
  display: contents;
}

@media (max-width: 1025px) {
  /* --- NAVBAR MOBILE --- */
  .nav-content {
    justify-content: space-between;
    padding: 0 20px;
  }

  .logo-img {
    height: 60%;
    width: 60%;
    border-radius: 0;
  }

  .nav-header-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    z-index: 1001;
  }

  .mobile-toggle {
    display: block;
    font-size: 1.8rem;
    color: var(--color-blue-dark);
    border: none;
    background: transparent;
    cursor: pointer;
  }

  .nav-menu-wrapper {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: white;
    z-index: 2000;
    overflow: hidden;
  }

  .nav-menu-wrapper.active {
    display: grid;
    grid-template-columns: 35% 65%;
    animation: slideIn 0.3s ease-out;
  }

  .nav-links {
    flex-direction: column;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
  }

  .nav-icons {
    justify-content: center;
    gap: 30px;
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    background-color: #f9f9f9;
    width: 100%;
    text-align: center;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .dropdown-trigger:hover .dropdown-menu {
    display: block;
  }
}

/* MEDIA QUERIES (Tablets e Celulares) */
@media (max-width: 1025px) {
  .nav-content {
    justify-content: space-between;
    padding: 0 20px;
  }

  .nav-header-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    z-index: 1001;
  }

  .mobile-toggle {
    display: block;
    font-size: 1.8rem;
    color: var(--color-blue-dark);
    border: none;
    background: transparent;
    cursor: pointer;
  }

  /* --- 2. O MENU OVERLAY (Wrapper Geral) --- */
  .nav-menu-wrapper {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: white;
    z-index: 2000;
    overflow: hidden;
  }

  .nav-menu-wrapper.active {
    display: grid;
    grid-template-columns: 35% 65%;
    animation: slideIn 0.3s ease-out;
  }

  /* --- 3. COLUNA ESQUERDA (ROXA) --- */
  .mobile-menu-left {
    display: none;
    align-items: center;
    background: linear-gradient(180deg, #1a0b52 0%, #2d1b70 100%);
    padding: 40px 20px;
    text-align: left;
    color: white;
    position: relative;
  }

  .mobile-promo-content h2 {
    font-size: 1.8rem;
    line-height: 1.1;
    margin-bottom: 20px;
    color: white;
  }

  .mobile-promo-content h2 strong {
    font-weight: 800;
    font-size: 2.2rem;
  }

  .btn-outline-white {
    border: 1px solid white;
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 30px;
  }

  .promo-arrow {
    border: 1px solid white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
  }

  /* --- 4. COLUNA DIREITA (BRANCA - CONTEÚDO) --- */
  .mobile-menu-right {
    display: flex;
    flex-direction: column;
    background-color: white;
    height: 100%;
    overflow-y: auto;
  }

  .mobile-inner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    flex-direction: row-reverse;
  }

  .mobile-logo-inner {
    height: 40px;
    width: 40px;
    display: none;
  }

  .mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
  }

  .search-icon-mobile {
    font-size: 1.5rem;
    color: var(--color-blue-dark);
  }

  .nav-icons {
    display: flex;
    justify-content: space-around;
    padding: 30px 40px;
    gap: 20px;
  }

  .nav-icons i {
    font-size: 1.8rem;
  }

  .desktop-only {
    display: none !important;
  }

  .nav-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    padding: 0 40px;
  }

  .nav-links li {
    width: 100%;
    border-bottom: 1px solid #f5f5f5;
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-blue-dark);
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    padding: 0 0 20px 20px;
    display: none;
    background: white;
    width: 100%;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .dropdown-trigger.menu-open .dropdown-menu {
    display: block;
  }

  .dropdown-menu li a {
    font-size: 1rem;
    font-weight: 400;
    padding: 10px 0;
  }

  .footer-grid {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 40px;
  }

  .footer-links {
    flex-direction: column;
    justify-items: center;
    gap: 10px;
    margin: 0;
  }

  .social-links {
    border-left: none;
    padding-left: 0;
    border-top: 2px solid #1a0b52;
    padding-top: 20px;
    width: 50%;
    align-items: center;
    text-align: center;
    min-height: auto;
  }
}

/* --- AJUSTES PARA TELAS MUITO PEQUENAS (CELULARES ESTREITOS) --- */
@media (max-width: 600px) {
  .nav-menu-wrapper.active {
    grid-template-columns: 10% 90%;
  }
  .mobile-menu-left {
    display: none;
  }
  .mobile-promo-content {
    display: none;
  }
  .mobile-menu-left::after {
    content: "\f060";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: white;
    border: 1px solid white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: 20px;
  }

  .nav-icons i {
    font-size: 1rem;
  }

  .nav-links a {
    font-size: 1rem;
  }

  .dropdown-menu li a {
    font-size: 0.8rem;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (min-width: 993px) {
  .mobile-menu-left,
  .mobile-inner-header {
    display: none !important;
  }

  .mobile-menu-right {
    display: flex;
    flex-direction: row-reverse;
    gap: 100px;
  }
}

@media (max-width: 1025px) {
  .nav-menu-wrapper.active {
    display: flex;
    justify-content: end;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
    background: transparent;
  }

  .mobile-close-btn {
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #1a0b52;
  }

  .mobile-menu-right {
    background: white;
    height: 100vh;
    width: 40vw;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }
}

/* =========================================
   FILTER DROPDOWN (VITRINE)
========================================= */

.filter-dropdown-wrapper {
  position: relative;
  display: inline-block;
}
.filter-dropdown-menu {
  position: absolute;
  top: 110%;
  right: 0;
  background-color: #fff;
  min-width: 250px;
  padding: 20px 0;
  border: none;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  list-style: none;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.filter-dropdown-wrapper.active .filter-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.filter-dropdown-wrapper.active .btn-filter i {
  transform: rotate(180deg);
}

.filter-dropdown-menu li {
  padding: 0;
}

.filter-dropdown-menu li a {
  display: block;
  padding: 15px 30px;

  color: var(--color-blue-dark);
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    background 0.2s,
    color 0.2s;
}

.filter-dropdown-menu li a:hover {
  background-color: #f7f7f7;
  color: var(--color-orange);
}

.filter-header-mobile {
  display: none;
}

@media (max-width: 768px) {
  .filter-dropdown-menu {
    right: auto;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 90vw;
    text-align: center;
  }

  .filter-dropdown-wrapper.active .filter-dropdown-menu {
    transform: translateX(-50%) translateY(0);
  }
}
