/**
 * Serviços Block - Grelha com Popup
 */
.services-block {
  padding: 80px 0;
  background: var(--color-gray-50, #f8f9fa);
}

.services-title {
  text-align: center;
  font-size: 2.5em;
  margin-bottom: 50px;
  color: var(--color-heading, #222);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 30px;
  margin-bottom: 40px;
}

.service-card {
  position: relative;
  height: 130px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.2),
    rgba(0, 0, 0, 0.15)
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.service-card:hover::before {
  opacity: 1;
}

.service-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.3),
    rgba(0, 0, 0, 0.7)
  );
  z-index: 1;
}

.service-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 15px;
  z-index: 2;
  color: white;
  text-align: center;
}

.service-card-title {
  font-size: 1.2em;
  margin-bottom: 10px;
  font-weight: 400;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  line-height: 1.2;
  text-wrap: auto;
  word-break: break-word;
}

/* Popup Styles */
.services-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
  padding: 20px;
}

.services-popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.services-popup {
  background: var(--color-white, #fff);
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.services-popup-overlay.active .services-popup {
  transform: scale(1);
}

.services-popup-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--color-gray-200, #f0f0f0);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50% !important;
  padding: 0 !important;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  color: var(--color-text, #333);
}

.services-popup-close:hover {
  background: var(--color-gray-300, #e0e0e0);
  transform: rotate(90deg);
}

.services-popup-content {
  padding: 60px 40px 40px;
}

.service-popup-item {
  display: none;
}

.service-popup-item.active {
  display: block;
}

.service-popup-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
}

.service-popup-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}

.service-popup-title {
  font-size: 2em;
  margin-bottom: 0;
  color: var(--color-heading, #222);
}

.service-popup-description {
  font-size: 16px;
  line-height: 1.8;
  color: var(--color-text-muted, #555);
  text-align: justify;
}

.service-popup-description h2,
.service-popup-description h3,
.service-popup-description h4 {
  margin-top: 25px;
  margin-bottom: 15px;
  color: var(--color-text, #333);
}

.service-popup-description p {
  margin-bottom: 15px;
}

.service-popup-description ul,
.service-popup-description ol {
  margin-bottom: 15px;
  padding-left: 25px;
}

.service-popup-description a {
  color: var(--color-link, #0073aa);
  text-decoration: none;
}

.service-popup-description a:hover {
  text-decoration: underline;
}

/* Prevent body scroll when popup is open */
body.popup-open {
  overflow: hidden;
}

/* Responsive - Serviços Block */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }
}

@media (max-width: 768px) {
  .services-block {
    padding: 60px 0;
  }

  .services-title {
    font-size: 2em;
    margin-bottom: 35px;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .service-card {
    height: 120px;
  }

  .service-card-title {
    font-size: 1em;
  }

  .services-popup-content {
    padding: 50px 25px 30px;
  }

  .service-popup-title {
    font-size: 1.2em;
  }

  .service-popup-description {
    font-size: 15px;
  }
}
