/* ============================================================
   MAR A DENTRO — Sistema de Estilos Customizados (Custom Overrides)
   Organizado por Especificidade e Cascata Natural (Sem !important)
   ============================================================ */

/* ----------------------------------------------------------
   1. REGRA DE RESETS & FONTES
   ---------------------------------------------------------- */
:root {
  --bs-font-sans-serif: 'Jost', sans-serif;
  --bs-body-font-family: 'Jost', sans-serif;
  font-family: 'Jost', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html, body,
h1, h2, h3, h4, h5, h6,
input, textarea, select, button,
a, p, li, div, label, span, strong, em, b, small, blockquote {
  font-family: 'Jost', sans-serif;
}

/* ----------------------------------------------------------
   2. LARGURA TOTAL E ESTRUTURA DE LAYOUT
   ---------------------------------------------------------- */
body .themeflat-container,
body .themeflat-container.full,
body .container,
body .container-sm,
body .container-md,
body .container-lg,
body .container-xl,
body .container-xxl,
body .md-banner-carousel,
body .footer,
body .footer-v2,
body .footer-v3,
body #footer,
body .main-content,
body .tf-widget-product-tab,
body .tf-widget-category-product,
body .tf-widget-benefit-v3,
body .tf-widget-instagram,
body .tf-widget-our-collection,
body .tf-widget-vlog-v3,
body .flat-slider,
body .slider-item,
body .main-slider,
body .swiper-container,
body .swiper,
body .home-boxed .boxed,
body .md-modalidades-bar {
  max-width: 100%;
  width: 100%;
}

body .themeflat-container,
body .md-banner-carousel,
body .footer,
body .home-boxed .boxed,
body .md-modalidades-bar {
  padding-left: 16px;
  padding-right: 16px;
  margin-left: auto;
  margin-right: auto;
}

/* Header sticky */
body #header,
body .header,
body .header-v2,
body .md-header {
  position: sticky;
  top: 0;
  z-index: 99999;
  background-color: #ffffff;
}

body .header-v2,
body .header-v2 .container,
body .header-v2 .themeflat-container,
body .header-v2 .inner-header,
body .header-v2 .header-wrap {
  padding-left: 0;
  padding-right: 0;
}

/* Elementos desativados */
body .tf-widget-our-collection,
body .graphic-h3,
body .tf-widget-vlog-v3 {
  display: none;
}

/* ----------------------------------------------------------
   3. ÍCONES & FONTES TERCEIRIZADAS
   ---------------------------------------------------------- */
body i[class*="fa-"],
body span[class*="fa-"],
body [class^="fa-"],
body [class*=" fa-"],
body .fa, body .fas, body .far, body .fab, body .fa-solid, body .fa-regular, body .fa-brands {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome";
}

body i[class*="icon-"],
body span[class*="icon-"],
body [class^="icon-"],
body [class*=" icon-"],
body .select-category::after,
body span.select-category::after,
body .sex-container::after {
  font-family: icomoon;
}

body .swiper-button-next::after,
body .swiper-button-prev::after {
  font-family: swiper-icons;
}

/* Hero Carousel Logo */
body .pd-r-slider .content-slide .hero-logo-img,
body .content-slide .hero-logo-img,
body .hero-logo-img {
  max-width: 260px;
  height: auto;
  margin-bottom: 16px;
  display: block;
}

body .tf-widget-benefit-v3 {
  margin-top: 30px;
}

body .md-sidebar-vendedor {
  position: sticky;
  top: 90px;
  align-self: start;
  z-index: 90;
}

/* ----------------------------------------------------------
   4. GRID DE PRODUTOS & CARDS (Fluido & Responsivo)
   ---------------------------------------------------------- */
body .tf-product-category.style2.columns-3.recent-ads-grid,
body .tf-product-category.recent-ads-grid,
body .recent-ads-grid,
body #category-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* REMOVER ANIMAÇÃO CIRCULAR GIRATÓRIA */
body .category-thumbnail::after,
body .category-thumbnail:after,
body .tf-product-category.style2 .category-thumbnail::after,
body .tf-product-category.style2 .category-thumbnail:after {
  display: none !important;
  animation: none !important;
  transform: none !important;
  opacity: 0 !important;
  content: none !important;
}

/* ----------------------------------------------------------
   CHAT FLUTUANTE (EXCLUSIVO PARA USUÁRIOS LOGADOS)
   ---------------------------------------------------------- */
#floating-chat-widget {
  display: none !important;
}

body.user-logged-in #floating-chat-widget {
  display: block !important;
}

/* Card Container sem Borda Arredondada (Bordas Retas 0px) */
body .product-category.recent-ad-card,
body .recent-ad-card,
body .product-card-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #ffffff;
  border-radius: 0px;
  border: 1px solid #E2E8F0;
  padding: 12px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  box-sizing: border-box;
  position: relative;
}

body .product-category.recent-ad-card:hover,
body .recent-ad-card:hover,
body .product-card-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(0, 119, 182, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  border-color: #CBD5E1;
}

/* Thumbnail sem Borda Arredondada (0px) */
body .category-thumbnail,
body .product-card-image-wrap {
  position: relative;
  width: 100%;
  max-width: none;
  min-width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0px;
  overflow: hidden;
  background: #E2E8F0;
  box-sizing: border-box;
  flex-shrink: 0;
}

body .category-thumbnail img,
body .product-card-image-wrap img,
body .img-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  object-fit: cover;
  border-radius: 0px;
  display: block;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  aspect-ratio: 1 / 1;
}

body .recent-ad-card:hover .category-thumbnail img,
body .recent-ad-card:hover .product-card-image-wrap img,
body .product-card-item:hover .category-thumbnail img,
body .product-card-item:hover .product-card-image-wrap img {
  transform: scale(1.08);
}

/* Borda Pontilhada Azul e Preta no Hover (Retangular 0px) */
body .category-thumbnail::before,
body .product-card-image-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 0px;
  padding: 2.5px;
  background: repeating-linear-gradient(45deg, #0077B6, #0077B6 8px, #0A2540 8px, #0A2540 16px);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 10;
}

body .recent-ad-card:hover .category-thumbnail::before,
body .recent-ad-card:hover .product-card-image-wrap::before,
body .product-card-item:hover .category-thumbnail::before,
body .product-card-item:hover .product-card-image-wrap::before,
body .category-thumbnail:hover::before,
body .product-card-image-wrap:hover::before {
  opacity: 1;
}

/* Botão de Favorito no Canto Superior Direito das Imagens do Grid */
body .card-favorite-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 15;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  padding: 0;
  outline: none;
}

body .card-favorite-btn:hover {
  transform: scale(1.1);
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

body .card-favorite-btn i {
  font-size: 15px;
  color: #EF4444;
  transition: transform 0.2s ease;
}

body .card-favorite-btn:active i {
  transform: scale(1.25);
}

/* PÁGINA DE CATEGORIAS LARGURA INTEIRA DA PÁGINA (100% Full Width) */
body #main-category-view,
body #main-category-view .themeflat-container {
  max-width: 100% !important;
  width: 100% !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
  box-sizing: border-box !important;
}

/* Card Info */
body .recent-ad-info,
body .recent-ad-info > div,
body .product-card-info,
body .product-card-info > div {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
  padding: 12px 4px 4px 4px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ----------------------------------------------------------
   5. BOTÃO "VER DETALHES >" (Estrutura Horizontal em 1 Única Linha)
   ---------------------------------------------------------- */
body .btn-ver-detalhes,
body .recent-ad-card .btn-ver-detalhes,
body .product-category .btn-ver-detalhes {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: #0077b6;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 6px;
  margin-top: 10px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
  transition: background 0.25s ease, transform 0.2s ease;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0, 119, 182, 0.2);
  box-sizing: border-box;
}

body .btn-ver-detalhes span {
  display: inline-block;
  white-space: nowrap;
}

body .btn-ver-detalhes i {
  display: inline-block;
  font-size: 11px;
  margin: 0;
  padding: 0;
  vertical-align: middle;
  line-height: 1;
}

body .recent-ad-card:hover .btn-ver-detalhes,
body .product-category.recent-ad-card:hover .btn-ver-detalhes,
body .product-card-item:hover .btn-ver-detalhes {
  background: #0A2540;
  color: #ffffff;
}

/* ----------------------------------------------------------
   6. SUBMENUS DO HEADER (Categorias e Dropdown de Usuário)
   ---------------------------------------------------------- */
body .md-nav-categorias,
body .md-nav-user-container {
  position: relative;
  display: inline-flex;
  align-items: center;
}

body .md-nav-categorias::after,
body .md-nav-user-container::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -10px;
  right: -10px;
  height: 20px;
  background: transparent;
  z-index: 99998;
}

body .md-submenu-modalidades,
body .md-user-dropdown-menu {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: absolute;
  top: 100%;
  min-width: 210px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(10, 37, 64, 0.18), 0 4px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid #E2E8F0;
  padding: 8px 0;
  margin-top: 4px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
  transform: translateY(6px);
  z-index: 99999;
}

body .md-submenu-modalidades { left: 0; }
body .md-user-dropdown-menu { right: 0; }

body .md-nav-categorias:hover .md-submenu-modalidades,
body .md-submenu-modalidades:hover,
body .md-nav-user-container:hover .md-user-dropdown-menu,
body .md-user-dropdown-menu:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

body .md-user-dropdown-menu .dropdown-user-header {
  padding: 12px 20px 8px 20px;
  font-size: 14px;
  font-weight: 700;
  color: #0A2540;
  border-bottom: 1px solid #F1F5F9;
  margin-bottom: 4px;
  word-break: break-word;
}

body .md-submenu-modalidades a,
body .md-user-dropdown-menu a {
  display: block;
  padding: 10px 20px;
  color: #0F172A;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease;
  border-bottom: 1px solid #F1F5F9;
}

body .md-submenu-modalidades a:last-child,
body .md-user-dropdown-menu a:last-child {
  border-bottom: none;
}

body .md-submenu-modalidades a:hover,
body .md-user-dropdown-menu a:hover {
  background: #F0F9FF;
  color: #0077B6;
}

body .md-user-dropdown-menu a.btn-logout-action:hover {
  background: #FEF2F2;
  color: #DC2626;
}

/* User Icon Button Header */
body .md-user-header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #F1F5F9;
  color: #0A2540;
  transition: all 0.25s ease;
  text-decoration: none;
  border: 1px solid #CBD5E1;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0 4px;
}

body .md-user-header-btn:hover {
  background: #0077B6;
  color: #ffffff;
  border-color: #0077B6;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 119, 182, 0.3);
}
