/* ===============================
   CSS PARA SERVIÇOS - servicos.css
   =============================== */

/* ===============================
   SECÇÃO DE SERVIÇOS - LAYOUT PRINCIPAL
   =============================== */

.services-preview {
  padding: 80px 0;
  background: var(--secondary-color, #f4ebdc);
}

.services-preview h2 {
  text-align: center;
  font-size: 2.5rem;
  color: var(--primary-color, #593621);
  font-weight: bold;
}

.services-preview h2::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background-color: var(--accent-color, #8B4513);
  margin: 1rem auto 0;
}

/* ===============================
   GRID DE SERVIÇOS - 3 COLUNAS FIXAS
   =============================== */

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 900px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ===============================
   CARD DO SERVIÇO - TRANSIÇÕES SUAVES
   =============================== */

.service-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;  
  user-select: none;
  transition: transform 0.2s ease;
  margin: 5px;
}



/* ===============================
   IMAGEM DO SERVIÇO - TAMANHO CONTROLÁVEL
   =============================== */

/* 🎯 VARIÁVEL PARA CONTROLAR ALTURA DAS IMAGENS */
:root {
  --service-image-height: 230px; /* 🔧 ALTERE ESTE VALOR PARA MUDAR O TAMANHO */
}

.service-image {
  position: relative;
  width: 100%;
  height: var(--service-image-height);
  overflow: hidden;
  /* Hardware acceleration para transições mais suaves */
  transform: translateZ(0);
  backface-visibility: hidden;
}

.service-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease-out;
  /* Hardware acceleration */
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Imagem texto para crossfade - OTIMIZADA */
.service-text-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease-out;
  pointer-events: none;
  z-index: 1;
  /* Hardware acceleration para performance */
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: opacity;
}

/* Efeito sutil de zoom - OTIMIZADO */
.service-card:hover .service-main-img,
.service-card:hover .service-text-img {
  transform: translateZ(0) scale(1.03);

  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===============================
   OVERLAY VISUAL - DESABILITADO
   =============================== */

.service-clickable-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  z-index: 2;
  pointer-events: none;
}

/* ===============================
   DESCRIÇÃO DO SERVIÇO (DEBAIXO DA IMAGEM - SEMPRE IGUAL)
   =============================== */

.service-description {
  background: #F4EBDC;
  padding: 10px;
  text-align: center;
  display: block;
}

.service-description-text {
  color: #593621;
  font-size: 1.8rem;
  font-weight: bold;
  text-align: center;
  margin: 0;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.4;
  word-wrap: break-word;
}

/* Responsividade - Mantém o mesmo visual em todos os tamanhos */
@media (max-width: 1200px) {
  .service-description-text {
    font-size: 1.5rem;
  }
  .service-description {
    padding: 15px;
  }
}

@media (max-width: 768px) {
  .service-description-text {
    font-size: 1.3rem;
  }
  .service-description {
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .service-description-text {
    font-size: 1.1rem;
    letter-spacing: 0.5px;
  }
  .service-description {
    padding: 10px;
    margin-top: -40px;
  }
}

/* ===============================
   ESTADOS E ACESSIBILIDADE
   =============================== */

.service-card:focus {
  outline: 3px solid var(--accent-color, #e0b77b);
  outline-offset: 2px;
}

/* ===============================
   LOADING STATE
   =============================== */

.service-main-img[src=""],
.service-main-img:not([src]) {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ===============================
   MODAL DOS SERVIÇOS
   =============================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
    box-sizing: border-box;
}

/* Fullscreen modal - quando está visible (display: flex) */
#full-image-modal {
    padding: 0 !important;
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    align-items: center;
    justify-content: center;
}

/* Previne scroll quando modal fullscreen está aberto */
html.modal-open-fullscreen,
body.modal-open-fullscreen {
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    top: 0;
    left: 0;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    border-radius: 4px;
}

.service-modal-content {
    background-color: #F4EBDC;
    padding: 30px;
    width: 90%;
    max-width: 1200px;
    max-height: 91vh;
    overflow-y: auto;
    position: relative;
    margin: 20px auto;
}

.service-modal-content h2 {
    color: var(--primary-color, #593621);
    font-size: 2.5rem;
    margin-bottom: 15px;
    margin-top: 5px;
    text-align: center;
}

.service-modal-description {
    margin-bottom: 25px;
    font-size: 1.1rem;
    text-align: center;
    line-height: 1.6;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* ===============================
   GRID DE IMAGENS DO MODAL - 3 COLUNAS
   =============================== */

.service-images-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 30px;
}

.service-image-item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 5/3; /* Proporção fixa para todas as imagens */
    cursor: pointer;
    transition: transform 0.2s ease;
    border-radius: 3px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.service-image-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.service-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.service-image-item:hover img {
    transform: scale(1.05);
}

/* ===============================
   MODAL DE IMAGEM GRANDE
   =============================== */

#full-image-modal {
    z-index: 1200;
    background-color: rgba(0, 0, 0, 0.9);
}

#full-size-image {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 6px;
    object-fit: contain;
    flex-shrink: 0;
}

#full-image-caption {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 1rem;
    text-align: center;
    max-width: 70%;
    line-height: 1.4;
    z-index: 1250;
    font-weight: normal;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* ===============================
   NAVEGAÇÃO DO MODAL
   =============================== */

.prev, .next {
    position: fixed;
    top: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    user-select: none;
    transform: translateY(-50%);
    transition: all 0.3s ease;
    z-index: 1250;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    padding: 0;
    margin: 0;
}

.prev {
    left: 30px;
}

.next {
    right: 30px;
}

.prev:hover, .next:hover {
    background-color: rgba(255, 255, 255, 1);
    color: #000;
    transform: translateY(-50%) scale(1.05);
}

.close-modal {
    position: fixed;
    top: 25px;
    right: 35px;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1300;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.5);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    padding: 0;
    margin: 0;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    transform: scale(1.1);
}

/* ===============================
   LOADING MESSAGE
   =============================== */

.loading-message {
  text-align: center;
  padding: 40px;
  font-size: 1.2rem;
  color: var(--primary-color, #593621);
  background: #fff;
  border-radius: 8px;
  margin: 20px;
  grid-column: 1 / -1;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.service-images-grid .loading-message {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    margin: 20px 0;
}

/* ===============================
   RESPONSIVIDADE - MANTÉM 3 COLUNAS ATÉ TABLET
   =============================== */

/* Desktop grande */
@media (min-width: 1400px) {
  .services-grid {
    padding: 10px 10px;
    gap: 50px;
  }
  :root {
    --service-image-height: 210px; /* Maior em telas grandes */
  }
}

/* Desktop médio - mantém 3 colunas */
@media (max-width: 1200px) {
  .services-grid {
    max-width: 950px;
    gap: 15px;
    padding: 0 35px;
  }
  :root {
    --service-image-height: 180px;
  }
}

/* Tablet landscape - ainda 3 colunas */
@media (max-width: 992px) {
  .services-grid {
    max-width: 800px;
    gap: 12px;
    padding: 0 25px;
  }
  :root {
    --service-image-height: 160px;
  }
  .services-preview h2 { 
    font-size: 2.2rem; 
  }
}

/* Tablet portrait - 2 colunas */
@media (max-width: 768px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 500px;
    padding: 0 20px;
  }
  .service-card {
    margin: 5px;
  }
  :root {
    --service-image-height: 150px;
  }
  .services-preview h2 { 
    font-size: 2rem; 
  }
  
  /* Modal responsivo */
  .service-modal-content {
    padding: 20px;
    width: 95%;
    max-height: 85vh;
  }
  .service-modal-content h2 { 
    font-size: 1.8rem; 
  }
  .service-images-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  #full-size-image {
    max-width: 95%;
    max-height: 75vh;
  }
  #full-image-caption {
    bottom: 40px;
    max-width: 85%;
    padding: 10px 16px;
    font-size: 0.9rem;
  }
  .prev, .next {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .prev { left: 20px; }
  .next { right: 20px; }
  .close-modal {
    top: 20px;
    right: 20px;
    font-size: 28px;
    width: 40px;
    height: 40px;
  }
}

/* Mobile - 1 coluna */
@media (max-width: 480px) {
  .services-grid {
    grid-template-columns: 1fr;
    max-width: 300px;
  }
  .service-main-img {
        height: 70%;
        margin-bottom: -45px;
    }
  
  :root {
    --service-image-height: 170px;
  }
  .services-preview h2 { 
    font-size: 1.8rem; 
  }
  
  /* Modal mobile */
  .service-images-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  #full-image-caption {
    bottom: 30px;
    padding: 8px 12px;
    font-size: 0.85rem;
    max-width: 90%;
  }
  .prev, .next {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
  .prev { left: 15px; }
  .next { right: 15px; }
  .close-modal {
    width: 35px;
    height: 35px;
    font-size: 24px;
  }
}

/* ===============================
   CONTROLES DE TAMANHO PERSONALIZÁVEIS
   =============================== */

/* 🎯 TAMANHOS PRÉ-DEFINIDOS - DESCOMENTE O QUE QUISER USAR */

/* Tamanho pequeno */
/*
:root {
  --service-image-height: 200px;
}
*/

/* Tamanho médio (padrão) */
/*
:root {
  --service-image-height: 280px;
}
*/

/* Tamanho grande */
/*
:root {
  --service-image-height: 350px;
}
*/

/* Tamanho extra grande */
/*
:root {
  --service-image-height: 420px;
}
*/