/* Estilos personalizados para a seção de classificados */

.cid-classified-home .card,
.cid-classified-list .card,
.cid-classified-detail .card {
  border: 1px solid #e9e9e9;
  border-radius: 0;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cid-classified-home .card:hover,
.cid-classified-list .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.cid-classified-list .card,
.cid-classified-detail .card {
  transition: transform 0.3s, box-shadow 0.3s;
  border: none;
  overflow: hidden;
}

.cid-classified-list .card:hover,
.cid-classified-detail .row .col-md-4 .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Container e wrapper para imagens padronizadas */
.card-img-container {
  position: relative;
  overflow: hidden;
  height: 200px;
  background-color: #f8f9fa;
}

.card-img-wrapper {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.img-link {
  display: block;
  height: 100%;
  width: 100%;
  text-decoration: none;
}

.cid-classified-list .card-img-top,
.cid-classified-detail .row .col-md-4 .card-img-top {
  height: 100%;
  object-fit: cover;
  width: 100%;
  border-radius: 0;
  transition: transform 0.5s ease;
}

.card-img-wrapper:hover .card-img-top {
  transform: scale(1.05);
}

.cid-classified-home .card-title,
.cid-classified-list .card-title {
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 1.1rem;
  line-height: 1.3;
  height: 2.8rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cid-classified-home .card-footer,
.cid-classified-list .card-footer {
  background-color: transparent;
  padding: 15px;
}

.cid-classified-detail .product-image img {
  width: 100%;
  height: 500px;
  object-fit: cover;
  border-radius: 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.cid-classified-detail .product-gallery img {
  height: 120px;
  object-fit: cover;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 0;
  border: 2px solid transparent;
}

.cid-classified-detail .product-gallery img:hover,
.cid-classified-detail .product-gallery img.active {
  border-color: #000142;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cid-classified-detail .product-gallery img:hover {
  opacity: 0.8;
}

.cid-classified-detail .product-price h2 {
  font-weight: 700;
  margin-bottom: 20px;
  font-size: 2.2rem;
  letter-spacing: -0.5px;
}

.cid-classified-detail .contact-buttons {
  margin-top: 20px;
}

.cid-classified-detail .contact-buttons .btn-whatsapp {
  background-color: #25D366;
  border-color: #25D366;
  color: white;
  font-weight: 600;
}

.cid-classified-detail .contact-buttons .btn-whatsapp:hover {
  background-color: #1fba58;
  border-color: #1fba58;
}

.cid-classified-detail .product-description {
  background-color: #f9f9f9;
  padding: 20px;
  border-left: 4px solid #000142;
}

.cid-classified-detail .product-specs {
  background-color: #f9f9f9;
  padding: 20px;
  border-left: 4px solid #000142;
}

.cid-classified-detail .product-specs .table {
  margin-bottom: 0;
}

.cid-classified-detail .product-specs th {
  width: 40%;
  color: #000142;
  font-weight: 600;
}

.cid-classified-detail .seller-card {
  background-color: #f9f9f9;
  border-left: 4px solid #000142;
}

.cid-classified-detail .seller-logo-container {
  width: 80px;
  height: 80px;
  background-color: white;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.cid-classified-detail .seller-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cid-classified-detail .seller-description {
  margin-top: 15px;
  padding: 10px;
  background-color: #f9f9f9;
  border-left: 3px solid #000142;
}

.cid-classified-detail .seller-description p {
  margin-bottom: 5px;
  line-height: 1.5;
  font-size: 0.95rem;
}

.cid-classified-detail .section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #000142;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #f0f0f0;
}

/* Breadcrumb com margin-bottom aumentado */
.breadcrumb {
  margin-bottom: 7rem !important;
}

/* Modal de contato */
.modal-contact .modal-header {
  background-color: #000142;
  color: white;
}

.modal-contact .modal-header .btn-close {
  color: white;
  opacity: 1;
}

.modal-contact .form-control:focus {
  border-color: #000142;
  box-shadow: 0 0 0 0.25rem rgba(0, 1, 66, 0.25);
}

.modal-contact .btn-primary {
  background-color: #000142;
  border-color: #000142;
}

/* Estilos responsivos */
@media (max-width: 768px) {
  .cid-classified-detail .product-image img {
    height: 300px;
  }
  
  .cid-classified-detail .product-gallery img {
    height: 80px;
  }
}

/* Badges e etiquetas */
.badge {
  font-weight: 600;
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.badge.bg-warning {
  background-color: #FFC107 !important;
  color: #000 !important;
}

.badge.bg-primary {
  background-color: #0d6efd !important;
}

.badge.bg-light {
  background-color: #f8f9fa !important;
  color: #212529 !important;
}

/* Preço com destaque */
.text-price {
  color: #000142 !important;
  font-weight: 700;
  font-size: 1.4rem;
}

/* Estilo para o texto "Sob Consulta" */
.text-price.sob-consulta {
    color: #fd7e14;
    font-weight: bold;
    font-style: italic;
    display: inline-block;
    position: relative;
}

.text-price.sob-consulta::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #fd7e14;
    opacity: 0.5;
}

/* Ícones */
.icon-spec {
  color: #000142;
  margin-right: 5px;
  width: 16px;
  text-align: center;
}

.item-spec {
  display: flex;
  align-items: center;
  margin-right: 15px;
}

.item-spec small {
  display: block;
  font-size: 0.7rem;
  color: #6c757d;
}

.item-spec span {
  font-weight: 500;
  font-size: 0.9rem;
}

/* Estilos para selo de VENDIDO sobreposto na visualização pública com SVG - Largura total */
.img-sold-public .card-img-top {
  filter: brightness(0.6) saturate(0.7) grayscale(0.3);
  transition: filter 0.3s ease;
}

.sold-overlay-public {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  animation: soldOverlayPublicFadeIn 0.8s ease forwards;
}

.sold-seal-public {
  width: 100%;
  height: auto;
  max-width: 80%;
  filter: drop-shadow(3px 3px 8px rgba(0,0,0,0.7));
  transform: scale(0.6) rotate(0deg);
  animation: soldSealPublicScale 0.8s ease 0.3s forwards;
}

@keyframes soldOverlayPublicFadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes soldSealPublicScale {
  0% {
    transform: scale(0.6) rotate(0deg);
  }
  30% {
    transform: scale(1.05) rotate(0deg);
  }
  75% {
    transform: scale(0.95) rotate(0deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

/* Efeito adicional no hover do card vendido */
.img-sold-public:hover .card-img-top {
  filter: brightness(0.4) saturate(0.5) grayscale(0.5);
}

.img-sold-public:hover .sold-seal-public {
  transform: scale(1.02) rotate(0deg);
  filter: drop-shadow(4px 4px 8px rgba(0,0,0,0.7));
}

/* Ajustes para responsividade móvel */
@media (max-width: 768px) {
  .sold-seal-public {
    max-width: 85%;
  }
}

@media (max-width: 480px) {
  .sold-seal-public {
    max-width: 90%;
  }
}

/* Container de imagem com posicionamento correto */
.card-img-container {
  position: relative;
  overflow: hidden;
}

/* Sobreposição no card completo para items vendidos */
.img-sold-public .card {
  border: 2px solid #dc3545;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.img-sold-public .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(220, 53, 69, 0.4);
}

/* ========================================
   ESTILOS CONSOLIDADOS PARA SELO VENDIDO
   ======================================== */

/* SELO GENÉRICO - Fallback para todas as páginas */
.sold-overlay {
  position: absolute !important;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  animation: soldOverlayFadeIn 0.8s ease forwards;
}

.sold-seal {
  width: 100% !important;
  height: auto !important;
  max-width: 80% !important;
  filter: drop-shadow(3px 3px 8px rgba(0,0,0,0.7));
  transform: scale(0.6) rotate(0deg);
  animation: soldSealScale 0.8s ease 0.3s forwards;
}

/* Animações genéricas - fallback */
@keyframes soldOverlayFadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes soldSealScale {
  0% {
    transform: scale(0.6) rotate(0deg);
  }
  30% {
    transform: scale(1.05) rotate(0deg);
  }
  75% {
    transform: scale(0.95) rotate(0deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

/* Imagens vendidas - aplicação genérica */
.image-sold {
  filter: brightness(0.7) saturate(0.8) grayscale(0.2) !important;
  border: 2px solid #dc3545 !important;
}

/* Estilos para selo de VENDIDO na página de detalhes com SVG - Largura total */
.cid-classified-detail .product-image {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.product-image-sold img {
  filter: brightness(0.65) saturate(0.7) grayscale(0.2);
  transition: filter 0.3s ease;
}

.sold-overlay-detail {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  opacity: 0;
  animation: soldOverlayDetailFadeIn 1s ease forwards;
}

.sold-seal-detail {
  width: 100%;
  height: auto;
  max-width: 70%;
  filter: drop-shadow(4px 4px 10px rgba(0,0,0,0.8));
  transform: scale(0.5) rotate(0deg);
  animation: soldSealDetailScale 1s ease 0.4s forwards;
}

@keyframes soldOverlayDetailFadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes soldSealDetailScale {
  0% {
    transform: scale(0.5) rotate(0deg);
  }
  30% {
    transform: scale(1.1) rotate(0deg);
  }
  60% {
    transform: scale(0.95) rotate(0deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

/* Efeito adicional no hover da imagem vendida */
.product-image-sold:hover img {
  filter: brightness(0.5) saturate(0.5) grayscale(0.4);
}

.product-image-sold:hover .sold-seal-detail {
  transform: scale(1.02) rotate(0deg);
  filter: drop-shadow(6px 6px 12px rgba(0,0,0,0.8));
}

/* Selo de vendido também nas miniaturas da galeria */
.thumbnail-container {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.thumbnail-container:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.thumbnail-sold .thumbnail {
  filter: brightness(0.7) saturate(0.8) grayscale(0.2);
  border: 2px solid #dc3545 !important;
}

.thumbnail-sold:hover .thumbnail {
  filter: brightness(0.6) saturate(0.6) grayscale(0.3);
}

.sold-overlay-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  animation: soldOverlayThumbnailFadeIn 0.6s ease forwards;
}

.sold-seal-thumbnail {
  width: 100%;
  height: auto;
  max-width: 75%;
  filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.6));
  transform: scale(0.7) rotate(0deg);
  animation: soldSealThumbnailScale 0.6s ease 0.2s forwards;
}

@keyframes soldOverlayThumbnailFadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes soldSealThumbnailScale {
  0% {
    transform: scale(0.7) rotate(0deg);
  }
  30% {
    transform: scale(1.05) rotate(0deg);
  }
  75% {
    transform: scale(0.95) rotate(0deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

/* ========================================
   ESTILOS PARA ÁREA ADMINISTRATIVA
   ======================================== */

/* Container de imagem no admin */
.image-container {
  position: relative !important;
  overflow: hidden;
}

.image-container.image-sold {
  border: 2px solid #dc3545 !important;
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.3) !important;
}

.sold-seal-admin {
  width: 100% !important;
  height: auto !important;
  max-width: 85% !important;
  filter: drop-shadow(2px 2px 5px rgba(0,0,0,0.6));
  transform: scale(0.7) rotate(0deg);
  animation: soldSealAdminScale 0.6s ease 0.2s forwards;
}

@keyframes soldSealAdminScale {
  0% {
    transform: scale(0.7) rotate(0deg);
  }
  50% {
    transform: scale(1.05) rotate(0deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

/* ========================================
   FALLBACKS E COMPATIBILIDADE
   ======================================== */

/* Fallback para quando a imagem SVG não carrega */
.sold-overlay::after {
  content: "VENDIDO";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-25deg);
  color: #dc3545;
  font-weight: 900;
  font-size: 18px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
  letter-spacing: 2px;
  opacity: 0.9;
  z-index: 1;
}

/* Esconder o texto fallback quando a imagem SVG carrega */
.sold-overlay img + *::after {
  display: none;
}

/* Ajustes responsivos para miniaturas */
@media (max-width: 768px) {
  .sold-seal, .sold-seal-public, .sold-seal-thumbnail {
    max-width: 80% !important;
  }
  
  .sold-seal-detail {
    max-width: 75% !important;
  }
  
  .sold-seal-admin {
    max-width: 90% !important;
  }
}

@media (max-width: 480px) {
  .sold-seal, .sold-seal-public, .sold-seal-thumbnail {
    max-width: 85% !important;
  }
  
  .sold-seal-detail {
    max-width: 80% !important;
  }
  
  .sold-seal-admin {
    max-width: 95% !important;
  }
}

/* ========================================
   PERFORMANCE E OTIMIZAÇÕES
   ======================================== */

/* Reduce motion para usuários que preferem menos animação */
@media (prefers-reduced-motion: reduce) {
  .sold-overlay,
  .sold-seal,
  .sold-seal-public,
  .sold-seal-detail,
  .sold-seal-thumbnail,
  .sold-seal-admin {
    animation: none !important;
    opacity: 1 !important;
    transform: scale(1) !important;
  }
}

/* GPU acceleration para animações mais suaves */
.sold-overlay,
.sold-seal,
.sold-seal-public,
.sold-seal-detail,
.sold-seal-thumbnail,
.sold-seal-admin {
  will-change: transform, opacity;
  backface-visibility: hidden;
  perspective: 1000px;
}

/* ========================================
   COMPATIBILIDADE COM NAVEGADORES ANTIGOS
   ======================================== */

/* Fallback para navegadores que não suportam drop-shadow */
.sold-seal,
.sold-seal-public,
.sold-seal-detail,
.sold-seal-thumbnail,
.sold-seal-admin {
  -webkit-filter: drop-shadow(3px 3px 8px rgba(0,0,0,0.7));
  -moz-filter: drop-shadow(3px 3px 8px rgba(0,0,0,0.7));
  -ms-filter: drop-shadow(3px 3px 8px rgba(0,0,0,0.7));
}
