/* Services Page Styles - Updated Version */

.services-hero {
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-300) 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.services-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('../img/icons/settings.webp') center/cover no-repeat;
  opacity: 0.1;
  z-index: 1;
}

.services-hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

.services-hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 1rem;
  font-weight: 700;
  color: white;
}

.services-hero .lead {
  font-size: 1.25rem;
  opacity: 0.9;
  margin-bottom: 0;
  line-height: 1.5;
}

.services-main {
  padding: 4rem 0;
  background: #f8f9fa;
}

.services-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

/* Service Tiles */
.service-tile {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(36, 93, 42, 0.1);
  transition: all 0.4s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 500px;
}

/* Special Estimax styling for energy certificates tile */
.service-tile.estimax-branded {
  background: rgba(17, 0, 135, 0.1); /* lekko granatowe wnętrze */
  border: 3px solid #110087; /* granatowa obwolutka */
  color: #110087;
  position: relative;
  overflow: hidden;
}

.service-tile.estimax-branded::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #110087, #b4d440, #fe8a28);
  opacity: 1;
  z-index: 1;
}

.service-tile.estimax-branded .service-tile-image {
  background: 
    url('../../img/estimax_tlo.webp') center/cover no-repeat,
    rgba(17, 0, 135, 0.05);
  position: relative;
  filter: saturate(0.8) brightness(0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-tile.estimax-branded .service-tile-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.7); /* mocniejsze zamglenie */
  backdrop-filter: blur(3px);
  z-index: 1;
}

.service-tile.estimax-branded .service-tile-image::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 40px;
  background: url('../../img/svg/logo_estkg.svg') center/contain no-repeat;
  z-index: 3;
  filter: drop-shadow(0 4px 8px rgba(17, 0, 135, 0.3));
}

/* Ukryj oryginalną ikonę eco_2.webp */
.service-tile.estimax-branded .service-tile-image img {
  display: none;
}

.service-tile.estimax-branded h3 {
  color: #110087;
  font-weight: 700;
}

.service-tile.estimax-branded .service-summary {
  color: rgba(17, 0, 135, 0.8);
}

.service-tile.estimax-branded .feature-badge {
  background: rgba(17, 0, 135, 0.1);
  color: #110087;
  border: 1px solid rgba(17, 0, 135, 0.2);
  font-weight: 600;
}

.service-tile.estimax-branded:hover .feature-badge {
  background: #110087;
  color: white;
  border-color: #110087;
  transform: translateY(-1px);
}

.service-tile.estimax-branded .price-info .price-from {
  color: #110087;
  font-size: 1.4rem;
  font-weight: 800;
}

.service-tile.estimax-branded .btn-service-primary {
  background: #fe8a28;
  border-color: #fe8a28;
  color: white;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(254, 138, 40, 0.3);
}

.service-tile.estimax-branded .btn-service-primary:hover {
  background: #110087;
  color: white;
  border-color: #110087;
  box-shadow: 0 8px 25px rgba(17, 0, 135, 0.4);
  transform: translateY(-3px);
}

.service-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--green-900), var(--green-300));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.service-tile:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border-color: var(--green-300);
}

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

.service-tile-image {
  height: 200px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.service-tile-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(36, 93, 42, 0.05) 0%, rgba(156, 203, 122, 0.05) 100%);
}

.service-tile-image img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.service-tile:hover .service-tile-image img {
  transform: scale(1.1);
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.2));
}

.service-tile-content {
  padding: 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.service-tile h3 {
  color: var(--green-900);
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
}

.service-summary {
  color: #6c757d;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.service-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.feature-badge {
  background: rgba(156, 203, 122, 0.1);
  color: var(--green-900);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(156, 203, 122, 0.2);
  transition: all 0.3s ease;
}

.service-tile:hover .feature-badge {
  background: var(--green-300);
  color: white;
  border-color: var(--green-300);
}

.service-tile-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.price-info .price-from {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green-900);
}

.btn-service-primary {
  background: var(--green-900);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  border: 2px solid var(--green-900);
  white-space: nowrap;
}

.btn-service-primary:hover {
  background: var(--green-300);
  border-color: var(--green-300);
  text-decoration: none;
  color: white;
  transform: translateY(-2px);
}

.btn-service-primary svg {
  transition: transform 0.3s ease;
}

.btn-service-primary:hover svg {
  transform: translateX(4px);
}

/* Partner tile used on Estimax landing */
.partner-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid rgba(17, 0, 135, 0.08);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  max-width: 320px;
  margin: 1.5rem auto;
  box-shadow: 0 8px 24px rgba(8, 20, 40, 0.06);
}

.partner-tile img {
  display: block;
  width: auto;
  height: 54px; /* match markup height */
  max-width: 100%;
  object-fit: contain;
}

@media (max-width: 480px) {
  .partner-tile {
    padding: 0.75rem 1rem;
    max-width: 280px;
  }
  .partner-tile img {
    height: 44px;
  }
}

/* Services CTA Section */
.services-cta {
  background: white;
  padding: 4rem 0;
  border-top: 1px solid #e9ecef;
}

.cta-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.cta-content h2 {
  color: var(--green-900);
  margin-bottom: 1rem;
  font-size: 2rem;
  font-weight: 600;
}

.cta-content p {
  color: #6c757d;
  font-size: 1.1rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.cta-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-cta-primary,
.btn-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.btn-cta-primary {
  background: var(--green-900);
  color: white;
  border: 2px solid var(--green-900);
}

.btn-cta-primary:hover {
  background: var(--green-300);
  border-color: var(--green-300);
  text-decoration: none;
  color: white;
}

.btn-cta-secondary {
  background: transparent;
  color: var(--green-900);
  border: 2px solid var(--green-900);
}

.btn-cta-secondary:hover {
  background: var(--green-900);
  color: white;
  text-decoration: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .services-hero {
    padding: 3rem 0;
  }
  
  .services-main {
    padding: 3rem 0;
  }
  
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .service-tile {
    min-height: auto;
  }
  
  .service-tile-content {
    padding: 1.5rem;
  }
  
  .service-tile-image {
    height: 160px;
  }
  
  .service-tile-image img {
    width: 60px;
    height: 60px;
  }
  
  .service-tile-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .cta-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .btn-cta-primary,
  .btn-cta-secondary {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .service-tile-content {
    padding: 1rem;
  }
  
  .services-container {
    padding: 0 0.5rem;
  }
  
  .feature-badge {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }
}

/* Animation classes for JavaScript */
.service-tile.animate-in {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Loading animation */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.service-tile.loaded {
  animation: slideInUp 0.6s ease forwards;
}