/* ======================
   SERVICE DETAIL LAYOUT STYLES - ВИПРАВЛЕНА ВЕРСІЯ
   Responsive стилі для сторінок послуг з правильним центруванням
====================== */

/* ======================
   CSS VARIABLES
====================== */
:root {
  --service-padding: clamp(1rem, 4vw, 3rem);
  --service-gap: clamp(1.5rem, 4vw, 3rem);
  --service-border-radius: clamp(15px, 3vw, 25px);
}

/* ======================
   BODY PADDING FOR SERVICE PAGES
====================== */
body.service-page {
  padding-top: clamp(100px, 15vw, 140px);
}

/* ======================
   SERVICE HERO SECTION
====================== */
.service-hero {
  background: linear-gradient(135deg, var(--bg-light), var(--card-bg));
  border-radius: var(--service-border-radius);
  padding: var(--service-padding);
  margin: 1rem auto;
  max-width: 1200px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.service-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: var(--service-border-radius) var(--service-border-radius) 0 0;
}

.service-hero h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  color: var(--primary);
  margin-bottom: 1rem;
  font-weight: 600;
  text-align: center;
  position: relative;
}

.service-hero h1::after {
  display: none; /* Прибираємо рисочку для hero заголовків */
}

.service-hero .subtitle {
  font-size: clamp(1rem, 3vw, 1.3rem);
  color: var(--gray);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ======================
   MAIN CONTENT CONTAINER
====================== */
.service-main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

@media (min-width: 768px) and (max-width: 1279px) {
  .service-main {
    margin: 2rem 2rem;
    padding: 0;
  }
}

@media (max-width: 767px) {
  .service-main {
    margin: 1.5rem 1rem;
    padding: 0;
  }
}

@media (max-width: 480px) {
  .service-main {
    margin: 1rem 0.5rem;
    padding: 0;
  }
}

/* ======================
   SERVICE CONTENT CARD
====================== */
.service-content-card {
  background: var(--bg-light);
  border-radius: var(--service-border-radius);
  padding: var(--service-padding);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
}

.service-content-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.9), rgba(45, 45, 45, 0.9));
  border-radius: var(--service-border-radius);
  z-index: -1;
}

/* ======================
   ВИПРАВЛЕНІ СТИЛІ ДЛЯ ЗАГОЛОВКІВ ТА РИСОЧОК
====================== */

/* БАЗОВІ стилі для h2 в service pages - ЗЛІВА за замовчуванням */
.service-content-card h2 {
  color: var(--primary);
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  margin-bottom: 2rem;
  position: relative;
  text-align: left;
}

.service-content-card h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  transform: none;
  width: 50px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

/* ЦЕНТРОВАНІ заголовки (коли потрібно) */
.service-content-card h2.centered,
.service-features-section .service-content-card h2 {
  text-align: center;
}

.service-content-card h2.centered::after,
.service-features-section .service-content-card h2::after {
  left: 50%;
  transform: translateX(-50%);
}

/* MOBILE: усі заголовки по центру на <= 767px */
@media (max-width: 767px) {
  .service-content-card h2 {
    text-align: center !important;
  }
  
  .service-content-card h2::after {
    left: 50% !important;
    transform: translateX(-50%) !important;
  }
}

/* ======================
   TOP SECTION: LIST + IMAGE LAYOUT
====================== */
.service-top-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

/* Desktop: 2 columns side by side */
@media (min-width: 769px) {
  .service-top-section {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
  }
}

@media (min-width: 1200px) {
  .service-top-section {
    gap: 4rem;
  }
}

/* ======================
   SERVICES LIST
====================== */
.services-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.services-list li {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  color: var(--light);
  line-height: 1.8;
}

.services-list li:hover {
  background: rgba(255, 152, 0, 0.05);
  border-radius: 8px;
  padding-left: 1rem;
}

.services-list li::before {
  content: '✓';
  color: var(--primary);
  font-weight: bold;
  font-size: 1.2rem;
  margin-right: 1rem;
  flex-shrink: 0;
}

/* MOBILE: Center список на <= 767px */
@media (max-width: 767px) {
  .services-list {
    text-align: center;
  }
  
  .services-list li {
    justify-content: center;
    text-align: center;
  }
}

/* ======================
   IMAGE SECTION
====================== */
.service-image-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--service-border-radius);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease;
}

.service-image-card:hover {
  transform: translateY(-5px);
}

.service-image-card img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.service-image-card:hover img {
  transform: scale(1.05);
}

/* DESKTOP IMAGE - ховати на малих екранах */
.service-top-section > .service-image-card {
  display: block;
}

@media (max-width: 768px) {
  .service-top-section > .service-image-card {
    display: none;
  }
}

.service-image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: white;
  padding: 1.5rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.service-image-card:hover .service-image-overlay {
  transform: translateY(0);
}

.service-image-overlay h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.service-image-overlay p {
  font-size: 0.95rem;
  opacity: 0.9;
}

/* ======================
   MOBILE INLINE IMAGE - показується тільки на мобільних
====================== */
.service-image-mobile {
  margin: 2rem 0;
}

/* ХОВАТИ на екранах > 768px */
@media (min-width: 769px) {
  .service-image-mobile {
    display: none;
  }
}

/* ======================
   TEXT SECTION - FULL WIDTH
====================== */
.service-text-section {
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  margin-top: 2rem;
}

.service-text-content {
  color: var(--light);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
}

/* MOBILE: Center текст на <= 767px */
@media (max-width: 767px) {
  .service-text-section {
    text-align: center;
  }
  
  .service-text-content {
    text-align: center;
  }
}

/* ======================
   CTA BUTTON
====================== */
.service-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--primary);
  color: white;
  padding: clamp(0.8rem, 2.5vw, 1.2rem) clamp(1.5rem, 4vw, 2.5rem);
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(255, 152, 0, 0.3);
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 1rem;
  white-space: nowrap;
}

.service-cta-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 152, 0, 0.4);
}

/* ІКОНКИ в CTA кнопці */
.service-cta-btn .icon,
.service-cta-btn i,
.service-cta-btn svg {
  width: 1em;
  height: 1em;
  margin: 0;
  flex-shrink: 0;
}

/* MOBILE: Center кнопка на <= 767px */
@media (max-width: 767px) {
  .service-text-section {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .service-cta-btn {
    align-self: center;
  }
}

/* ======================
   FEATURES SECTION - З ЦЕНТРОВАНОЮ ТРЕТЬОЮ КАРТКОЮ
====================== */
.service-features-section {
  margin: 3rem auto 0;
  max-width: 1200px;
  padding: 0 1rem;
}

@media (min-width: 768px) and (max-width: 1279px) {
  .service-features-section {
    margin: 3rem 2rem 0;
    padding: 0;
  }
}

@media (max-width: 767px) {
  .service-features-section {
    margin: 2rem 1rem 0;
    padding: 0;
  }
}

@media (max-width: 480px) {
  .service-features-section {
    margin: 1.5rem 0.5rem 0;
    padding: 0;
  }
}

/* FEATURES GRID - З ЦЕНТРУВАННЯМ ТРЕТЬОЇ КАРТКИ */
.service-features-grid {
  display: grid;
  gap: 2rem;
  margin-top: 3rem;
  /* Мобільні: 1 стовпчик */
  grid-template-columns: 1fr;
}

/* Планшети: 2+1 з центруванням третьої картки */
@media (min-width: 768px) and (max-width: 1199px) {
  .service-features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Третя картка займає весь ряд і центрується */
  .service-features-grid .service-feature-card:nth-child(3) {
    grid-column: 1 / -1;
    max-width: calc(50% - 1rem);
    margin: 0 auto;
  }
}

/* Desktop: 3 в ряд */
@media (min-width: 1200px) {
  .service-features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Скидаємо спеціальні стилі для desktop */
  .service-features-grid .service-feature-card:nth-child(3) {
    grid-column: auto;
    max-width: none;
    margin: 0;
  }
}

/* FEATURE CARDS */
.service-feature-card {
  background: var(--card-bg);
  padding: 2rem 1.5rem;
  border-radius: 15px;
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
}

.service-feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  border-color: var(--primary);
}

/* ІКОНКИ в feature cards - ідеальне центрування */
.service-feature-card .icon,
.service-feature-card i,
.service-feature-card svg {
  display: block !important;
  margin: 0 auto 1rem auto !important;
  font-size: 2.5rem;
  color: var(--primary);
  width: 40px;
  height: 40px;
  transition: all 0.3s ease;
}

.service-feature-card:hover .icon,
.service-feature-card:hover i,
.service-feature-card:hover svg {
  transform: scale(1.1) rotate(5deg);
}

.service-feature-card h3 {
  color: var(--light);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  text-align: center;
  width: 100%;
}

.service-feature-card p {
  color: var(--gray);
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
  width: 100%;
  flex-grow: 1;
}

/* ======================
   RESPONSIVE ADJUSTMENTS
====================== */
@media (max-width: 768px) {
  .service-top-section {
    margin-bottom: 2rem;
  }
  
  .service-text-section {
    padding-top: 1.5rem;
    margin-top: 1.5rem;
  }
  
  .service-image-mobile {
    margin: 1.5rem 0;
  }
}

@media (max-width: 480px) {
  .service-top-section {
    margin-bottom: 1.5rem;
  }
  
  .service-text-section {
    padding-top: 1rem;
    margin-top: 1rem;
  }
  
  .service-image-mobile {
    margin: 1rem 0;
  }
  
  .service-feature-card {
    padding: 1.5rem 1rem;
  }
  
  .service-feature-card .icon,
  .service-feature-card i,
  .service-feature-card svg {
    width: 32px;
    height: 32px;
    font-size: 2rem;
  }
}

@media (min-width: 1600px) {
  .service-top-section {
    gap: 5rem;
  }
  
  .service-text-section {
    padding-top: 3rem;
    margin-top: 3rem;
  }
  
  .service-features-grid {
    gap: 3rem;
  }
}

/* ======================
   ANIMATIONS
====================== */
@keyframes serviceSlideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.service-content-card,
.service-feature-card {
  animation: serviceSlideInUp 0.6s ease-out;
}

.services-list { animation-delay: 0.1s; }
.service-image-card { animation-delay: 0.2s; }
.service-text-section { animation-delay: 0.3s; }
.service-features-grid { animation-delay: 0.4s; }