header {
  transition: transform 0.5s ease-in-out;
}

.navbar a.nav-link {
  color: #f8f9fa;
}

.navbar .nav-link:hover, .nav-link:focus {
  color: #FFB800;
}

#headerNav .dropdown-menu.show {
  z-index: 1021;
}

#flags-language {
  z-index: 1021;
}

/* Correção para bandeira do Brasil não esticar no mobile */
.flag-icon {
  object-fit: contain !important;
  max-width: 20px !important;
  max-height: 20px !important;
  width: auto !important;
  height: auto !important;
  border-radius: 3px;
}

/* Garante que o botão da flag não quebre o layout no mobile */
#flags-language-1 .btn {
  min-width: 24px;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 576px) {
  .flag-icon {
    max-width: 18px !important;
    max-height: 18px !important;
  }
}

/* Bandeiras no dropdown de idiomas */
.flag-icon-small {
  object-fit: contain !important;
  max-width: 22px !important;
  max-height: 16px !important;
  width: auto !important;
  height: auto !important;
  border-radius: 2px;
  vertical-align: middle;
}

/* Melhorias de UX para mobile - Cadastro de máquinas */
@media (max-width: 768px) {
  /* Formulário mais compacto no mobile */
  .card-body {
    padding: 1rem;
  }

  /* Campos de formulário com melhor espaçamento */
  .form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
  }

  /* Botões mais acessíveis no mobile */
  .btn-sm {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
  }

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

  /* Grid de imagens otimizado para mobile */
  .row-cols-1 > * {
    margin-bottom: 1rem;
  }
}

/* Melhorias de UX para mobile - Meus Anúncios */
@media (max-width: 768px) {
  /* Cards de máquinas no mobile */
  .machine-card-image {
    width: 100% !important;
    height: auto !important;
    min-height: 200px;
    max-height: 250px;
    object-fit: cover;
  }

  /* Ações das máquinas empilhadas no mobile */
  .machine-actions {
    flex-direction: column !important;
  }

  .machine-actions .btn {
    margin-bottom: 0.5rem;
  }

  .admin-actions {
    flex-direction: column !important;
  }

  .admin-actions .btn {
    margin-bottom: 0.5rem;
  }

  /* Navegação de tabs responsiva */
  .nav-pills {
    flex-direction: column;
    gap: 0.5rem;
  }

  .nav-pills .nav-item {
    width: 100%;
  }

  .nav-pills .nav-link {
    text-align: center;
    width: 100%;
  }

  /* Títulos das máquinas mais legíveis no mobile */
  .card-title {
    font-size: 1.1rem !important;
    line-height: 1.3;
  }

  /* Badges de status mais visíveis */
  .badge {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
  }

  /* Preços destacados no mobile */
  .fs-5.fw-bold {
    font-size: 1.3rem !important;
  }
}

@media (max-width: 576px) {
  /* Ajustes para telas muito pequenas */
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Header responsivo */
  h2, h3 {
    font-size: 1.5rem;
  }

  /* Botões ocupam largura total no mobile */
  .btn-group-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .btn-group-mobile .btn {
    width: 100%;
  }

  /* Imagens de máquinas otimizadas */
  .img-thumbnail {
    width: 100% !important;
    height: auto !important;
    max-height: 200px;
    object-fit: cover;
  }

  /* Cards de máquinas com padding reduzido em telas pequenas */
  .bg-white.rounded.p-4 {
    padding: 1rem !important;
  }

  /* Navegação de tabs em telas pequenas */
  .nav-pills .nav-link {
    font-size: 0.875rem;
    padding: 0.5rem;
  }

  /* Botão "Cadastrar novo anúncio" responsivo */
  .btn-primary.btn-sm {
    width: 100%;
    margin-bottom: 1rem;
  }

  /* Ajuste do título principal */
  .display-3.fs-2 {
    font-size: 1.75rem !important;
  }
}

/* Correção das thumbnails na página de detalhes do equipamento */
#main-thumbnails {
  display: flex;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding: 0.5rem 0;
  gap: 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

#main-thumbnails::-webkit-scrollbar {
  height: 4px;
}

#main-thumbnails::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 2px;
}

#main-thumbnails::-webkit-scrollbar-thumb {
  background: #007bff;
  border-radius: 2px;
}

#main-thumbnails .col-auto {
  flex: 0 0 auto;
  padding: 0;
}

#main-thumbnails .img-thumbnail,
#main-thumbnails .main-thumb {
  width: 70px;
  height: 50px;
  object-fit: cover;
  border-radius: 0.375rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

#main-thumbnails .img-thumbnail:hover,
#main-thumbnails .main-thumb:hover,
#main-thumbnails .img-thumbnail.active,
#main-thumbnails .main-thumb.active {
  border-color: #007bff;
}

/* Thumbnails responsivas no mobile */
@media (max-width: 768px) {
  #main-thumbnails {
    gap: 0.375rem;
    padding: 0.5rem;
    justify-content: flex-start;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  #main-thumbnails::-webkit-scrollbar {
    display: none;
  }

  #main-thumbnails .img-thumbnail,
  #main-thumbnails .main-thumb {
    width: 60px !important;
    height: 45px !important;
    border-radius: 0.25rem;
  }

  /* Container das thumbnails mais compacto no mobile */
  .container-fluid.bg-white.py-2.border-bottom {
    padding: 0.5rem !important;
  }

  /* Botão play do vídeo menor no mobile */
  #main-thumbnails .position-relative svg {
    width: 16px !important;
    height: 16px !important;
  }
}

/* Estilos para área de administração (categorias, marcas, modelos) */
.admin-management-area {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.admin-management-area .table {
  font-family: inherit;
}

.admin-management-area .table tbody tr:hover {
  background-color: rgba(0, 123, 255, 0.1);
}

.admin-management-area .table tbody tr.table-light {
  background-color: rgba(248, 249, 250, 0.8);
}

.admin-management-area .table tbody tr.table-light:hover {
  background-color: rgba(233, 236, 239, 0.8);
}

/* Indentação visual melhorada */
.category-indent {
  border-left: 2px solid #dee2e6;
  margin-left: 1rem;
  padding-left: 0.5rem;
}

.category-indent.level-1 {
  border-left-color: #007bff;
}

.category-indent.level-2 {
  border-left-color: #28a745;
}

.category-indent.level-3 {
  border-left-color: #ffc107;
}

/* Ícones hierárquicos */
.hierarchy-icon {
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.hierarchy-icon:hover {
  opacity: 1;
}

/* Tablets */
@media (min-width: 769px) and (max-width: 1024px) {
  #main-thumbnails .img-thumbnail,
  #main-thumbnails .main-thumb {
    width: 65px;
    height: 48px;
  }
}

footer ul li a {
  color: var(--bs-tertiary-bg);
}

.number-value {
  font-size: 0.85rem;
  color: var(--bs-dark-bg-subtle);
}

.category-machine li {
  display: block;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--bs-gray-100);
}

.category-machine li a {
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.4rem 0;
  border-radius: 0;
  border-bottom: 1px solid var(--bs-gray-100);
  text-decoration: none;
  color: var(--bs-body-color);
  transition: color 0.2s ease;
}

.category-machine li a:hover {
  color: var(--bs-primary);
}

.category-machine li strong {
  font-weight: 800;
}

.category-machine ul ul {
  margin-left: 0;
  padding-left: 0;
}

.category-machine ul ul li {
  border-bottom: none;
  padding: 0.2rem 0;
}

@media (min-width: 1200px) {
  .paragraph-width {
    width: 450px;
  }
}

.breadcrumb-item + .breadcrumb-item::before {
  color: rgb(255 255 255 / 75%);
}

.breadcrumb a {
  color: var(--bs-light);
}

.breadcrumb-item.active span,
.breadcrumb-item.active a {
  color: #FFB800 !important;
  text-decoration: none;
}

a .breadcrumb-item .equipaments {
  color: var(--bs-dark);
}

.equipaments a {
  color: var(--bs-dark);
}

.equipaments .breadcrumb-item + .breadcrumb-item::before {
  color: var(--bs-dark);
}

@media (min-width: 768px) {
  .icon {
    display: none;
  }
}

@media (min-width: 768px) {
  .collapsible {
    display: block !important;
  }
}

a, .card-img-top {
  transform: scale(1);
  transition: transform 0.3s ease;
}

/* se quiser um efeito no hover também */

a:hover, .card-img-top:hover {
  transform: scale(0.98);
  filter: brightness(0.9);
}

@media (min-width: 320px) {
  #logo-tractor {
    height: 48px;
    width: auto;
  }
}

@media (min-width: 425px) {
  #logo-tractor {
    height: 70px;
    width: auto;
  }
}

@media (min-width: 991px) {
  #logo-tractor {
    height: 90px;
    width: auto;
  }
}

.megamenu {
  width: 280px;
}

.text-orange, .navbar .nav-link.active {
    color: #FFB800 !important;
}

/* Custom CSS to fix sidebar menu visibility issues - Admin styles */
.navbar-vertical .navbar-nav .nav-link-title {
    color: rgba(255, 255, 255, 0.7) !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.navbar-vertical .navbar-nav .nav-link:hover .nav-link-title {
    color: #ffffff !important;
}

.navbar-vertical .navbar-collapse {
    visibility: visible !important;
}

.navbar-dark {
    background-color: #1e293b !important;
}

/* Ensure dropdown menu items are visible */
.navbar-vertical .dropdown-menu .dropdown-item {
    color: rgba(255, 255, 255, 0.7) !important;
    visibility: visible !important;
}

.navbar-vertical .dropdown-menu .dropdown-item:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Floating WhatsApp Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.whatsapp-button {
    width: 60px;
    height: 60px;
    background-color: #25D366;
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 32px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.whatsapp-button:hover {
    background-color: #128C7E;
    color: white;
    text-decoration: none;
    transform: scale(1.1);
    box-shadow: 0 6px 12px 0 rgba(0, 0, 0, 0.3);
}

.whatsapp-button svg {
    width: 32px;
    height: 32px;
}

/* Pulse animation */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }

    .whatsapp-button {
        width: 50px;
        height: 50px;
        font-size: 26px;
    }

    .whatsapp-button svg {
        width: 26px;
        height: 26px;
    }
}

@media (max-width: 480px) {
    .whatsapp-float {
        bottom: 15px;
        right: 15px;
    }
}

/* Hello Bar */
.hello-bar {
    background: linear-gradient(90deg, #FFB800 0%, #FFA500 100%);
    color: #000;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 1050;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hello-bar-link {
    color: #000 !important;
    text-decoration: none !important;
    display: block;
    transition: opacity 0.3s ease;
}

.hello-bar-link:hover {
    opacity: 0.8;
    color: #000 !important;
    text-decoration: none !important;
}

/* Header first line height increase */
#top-header .col-12 {
    padding-top: calc(0.25rem + 10px) !important;
    padding-bottom: calc(0.25rem + 10px) !important;
}

/* Header WhatsApp Button */
.header-whatsapp-btn {
    color: #25D366 !important;
    transition: color 0.3s ease;
}

.header-whatsapp-btn:hover {
    color: #128C7E !important;
}

.header-whatsapp-btn:focus {
    color: #25D366 !important;
}

/* Footer WhatsApp Icon */
.footer-whatsapp-icon {
    color: #25D366 !important;
}

/* Equipment Cards Styles */
.equipament-card {
    padding-bottom: 7rem;
}

.equipament-card .card-title {
    line-height: 1.3;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: flex-start;
}

/* Equipment info stacked layout */
.equipment-info-stack {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.equipment-info-item {
    color: #6c757d;
    font-size: 0.875rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
}

.equipment-info-item svg {
    margin-right: 0.5rem;
    flex-shrink: 0;
}

/* Legacy equipment info styles for backward compatibility */
.equipament-card .equipment-info {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.equipament-card .equipment-info.hours {
    margin-bottom: 0;
}

/* Equipment card image */
.equipment-card-image {
    height: 150px;
}

/* Equipment location section */
.equipment-location {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    margin-top: 0.5rem;
}

.equipment-location h4 {
    margin-bottom: 0;
    line-height: 1.4;
}

/* Equipment price section */
.equipment-price {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.equipment-price h4 {
    margin-bottom: 0;
}

/* Equipment Year and Hours columns */
.equipment-year-col {
    /* col-12 col-sm-5 handled by Bootstrap classes */
}

.equipment-hours-col {
    /* col-12 col-sm-7 handled by Bootstrap classes */
}

/* Hero Section */
.hero-section {
    height: 400px;
    background-size: cover !important;
    background-position: center !important;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.6));
    z-index: 1;
}

.hero-section > * {
    position: relative;
    z-index: 2;
}

/* Search Container Styles */
.search-container .bg-primary {
    padding: 2rem 1rem;
}
