.offices-section {
  width: 100vw;
  min-height: 100vh;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 0;
  position: relative;
  overflow: hidden;
}

.offices-section::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at center,
    rgba(238, 10, 16, 0.03) 0%,
    transparent 70%
  );
  animation: float 20s ease-in-out infinite;
}

.offices-container {
  width: 95%;
  max-width: 1400px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  position: relative;
  z-index: 2;
}

.offices-header {
  text-align: center;
  animation: fadeInDown 0.8s ease-out;
}

.offices-title {
  font-size: 42px;
  font-weight: 300;
  color: var(--text-color-main);
  margin-bottom: 15px;
  position: relative;
}

.offices-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--primary-color);
}

.offices-subtitle {
  font-size: 18px;
  color: var(--text-color-accent);
  opacity: 0.9;
}

.offices-grid {
  display: flex;
  flex-direction: column;
  gap: 50px;
}

.offices-group {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.group-title {
  font-size: 24px;
  font-weight: 400;
  color: var(--primary-color);
  text-align: center;
  position: relative;
  padding-bottom: 15px;
}

.group-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: var(--tertiary-color);
}

.office-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  animation: fadeInUp 0.8s ease-out;
}

.office-cards.representatives {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.office-card {
  background: var(--white);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.office-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--tertiary-color)
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.office-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.office-card:hover::before {
  opacity: 1;
}

.office-card.main-office {
  min-height: 280px;
}

.office-card.rep-office {
  min-height: 240px;
  padding: 25px;
}

.office-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(
    135deg,
    var(--primary-light),
    var(--primary-color)
  );
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 24px;
  margin-bottom: 20px;
  box-shadow: 0 5px 15px rgba(238, 10, 16, 0.3);
}

.office-logo {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
}

.office-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}

.office-card:hover .office-logo {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.office-region {
  font-size: 14px;
  color: var(--tertiary-color);
  margin-top: -10px;
  margin-bottom: 20px;
  font-style: italic;
}

.office-name {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-color-main);
  margin-bottom: 5px; /* Уменьшил отступ, так как теперь есть регион */
}

.office-contacts {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.office-contacts.compact {
  gap: 12px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.contact-item i {
  color: var(--tertiary-color);
  font-size: 16px;
  margin-top: 3px;
  width: 20px;
  text-align: center;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.contact-item span {
  font-size: 14px;
  color: var(--text-color-main);
  line-height: 1.5;
}

.offices-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  margin-top: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  animation: fadeIn 0.8s ease-out 0.5s both;
}

.footer-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-color-main);
}

.footer-info i {
  color: var(--primary-color);
  font-size: 18px;
}

/* Анимации */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

/* Адаптив для планшетов */
@media (max-width: 1024px) {
  .offices-section {
    padding: 50px 0;
  }

  .offices-container {
    width: 90%;
  }

  .office-cards {
    grid-template-columns: 1fr;
    max-width: 600px;
    margin: 0 auto;
  }

  .office-cards.representatives {
    grid-template-columns: 1fr;
  }
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
  .offices-section {
    padding: 40px 0;
    min-height: auto;
  }

  .offices-title {
    font-size: 32px;
  }

  .offices-subtitle {
    font-size: 16px;
  }

  .group-title {
    font-size: 20px;
  }

  .office-cards {
    gap: 20px;
  }

  .office-card {
    padding: 25px 20px;
  }

  .office-card.rep-office {
    padding: 20px;
    min-height: 220px;
  }

  .office-card.main-office {
    min-height: 260px;
  }

  .office-icon {
    width: 50px;
    height: 50px;
    font-size: 20px;
    margin-bottom: 15px;
  }

  .office-logo {
    width: 70px;
    height: 70px;
    margin-bottom: 15px;
  }

  .office-logo img {
    padding: 8px;
  }

  .office-region {
    font-size: 13px;
    margin-bottom: 15px;
  }
}

/* Адаптив для маленьких экранов */
@media (max-width: 480px) {
  .offices-section {
    padding: 30px 0;
  }

  .offices-container {
    width: 95%;
    gap: 30px;
  }

  .offices-title {
    font-size: 28px;
  }

  .offices-subtitle {
    font-size: 14px;
  }

  .group-title {
    font-size: 18px;
  }

  .office-card {
    padding: 20px 15px;
  }

  .office-card.rep-office {
    min-height: 200px;
  }

  .office-card.main-office {
    min-height: 240px;
  }

  .contact-item {
    gap: 10px;
  }

  .contact-item i {
    font-size: 14px;
  }

  .contact-item span {
    font-size: 12px;
  }

  .office-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 12px;
  }

  .office-logo img {
    padding: 6px;
  }

  .office-region {
    font-size: 12px;
    margin-bottom: 12px;
  }
}
