/* Unidades Page Specific Styles - Mobile First Approach */
:root {
  --unit-card-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  --unit-card-hover-shadow: 0 8px 25px rgba(193, 52, 118, 0.15);
}

/* Units Section */
.info-sections {
  padding: 40px 0 60px;
  background: #f9f9f9;
}

.info-sections .container > p {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 40px;
  padding: 0 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-color);
}

/* Units Grid - Mobile First */
.units-grid {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 0 20px;
}

/* Unit Card Wrapper */
.units-grid > .unit-card {
  text-decoration: none;
  display: flex;
}

/* Unit Card */
.unit-card {
  background: transparent;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  padding-bottom: 40px;
  border-bottom: 1px solid #eaeaea;
}

.units-grid > .unit-card:last-child {
  border-bottom: none;
}

.unit-card:hover {
  transform: translateY(-2px);
}

/* Unit Image */
.unit-image {
  width: 100%;
  height: 280px;
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.unit-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.img-top img {
  object-position: top;
}

/* Placeholder styling - quando usar logo como placeholder */
.unit-image img[src*="LogoLab"] {
  object-fit: contain;
  padding: 40px;
  max-width: 250px;
  max-height: 150px;
  width: auto;
  height: auto;
}

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

/* Unit Content */
.unit-content {
  padding: 25px 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Unit Badge */
.unit-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

/* Unit Title */
.unit-content h3 {
  font-size: 24px;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0 0 15px 0;
  line-height: 1.2;
}

/* Unit Info Items */
.unit-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.unit-info-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--text-color);
  font-size: 14px;
  line-height: 1.5;
}

.unit-info-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  fill: var(--primary-color);
}

/* Contact Button */
.unit-contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary-color);
  color: white;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  margin-top: 10px;
  align-self: flex-start;
}

.unit-contact-btn:hover {
  background: var(--primary-hover);
  transform: translateX(5px);
}

.unit-contact-btn svg {
  width: 18px;
  height: 18px;
  fill: white;
}

/* Tablets (768px e acima) */
@media (min-width: 768px) {
  .info-sections {
    padding: 60px 0 80px;
  }

  .info-sections .container > p {
    font-size: 16px;
    margin-bottom: 50px;
  }

  .units-grid {
    gap: 60px;
    padding: 0 40px;
  }

  /* Alternar layout */
  .unit-card {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding-bottom: 60px;
    gap: 20px;
  }

  /* Unidades ímpares - imagem à esquerda */
  .units-grid > .unit-card:nth-child(odd) .unit-card {
    flex-direction: row;
  }

  /* Unidades pares - imagem à direita */
  .units-grid > .unit-card:nth-child(even) .unit-card {
    flex-direction: row-reverse;
  }

  .unit-image {
    width: 55%;
    aspect-ratio: 4 / 3;
    height: auto;
  }

  .unit-content {
    width: 45%;
    padding: 0;
    justify-content: center;
  }

  .unit-content h3 {
    font-size: 38px;
    font-weight: 400;
  }

  .unit-info-item {
    font-size: 15px;
  }

  .unit-contact-btn {
    font-size: 15px;
    padding: 14px 28px;
    border-radius: 30px;
  }
}

/* Desktops (1024px e acima) */
@media (min-width: 1024px) {
  .units-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 30px;
    padding: 0;
  }

  .unit-card {
    align-items: center;
    gap: 20px;
    padding-bottom: 30px;
  }

  .units-grid > .unit-card:nth-child(odd) {
    flex-direction: row;
  }

  .units-grid > .unit-card:nth-child(even) {
    flex-direction: row-reverse;
  }

  .unit-image {
    width: 45%;
    aspect-ratio: 4 / 3;
    height: auto;
  }

  .unit-content {
    width: 55%;
    padding: 0;
  }

  .unit-content h3 {
    font-size: 26px;
    font-weight: 600;
  }

  .unit-badge {
    font-size: 11px;
    margin-bottom: 5px;
  }

  .unit-info-item {
    font-size: 14px;
  }

  .unit-contact-btn {
    font-size: 14px;
    padding: 12px 24px;
  }
}

/* ===== CONVÊNIOS SECTION ===== */

/* Convênios Section */
.convenios-section {
  background: linear-gradient(135deg, #f8f9ff 0%, #fdf5f8 50%, #f8f9ff 100%);
  padding: 60px 0;
  position: relative;
  overflow: hidden;
}

.convenios-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 100%;
  background: radial-gradient(
    circle at 70% 30%,
    rgba(193, 52, 118, 0.05) 0%,
    transparent 60%
  );
  animation: floatReverse 8s ease-in-out infinite;
}

@keyframes floatReverse {
  0%,
  100% {
    transform: translateX(0px) rotate(0deg);
  }
  50% {
    transform: translateX(-30px) rotate(1deg);
  }
}

/* Convênios Header */
.convenios-header {
  text-align: center;
  margin-bottom: 50px;
  position: relative;
  z-index: 2;
}

.convenios-header h2 {
  font-size: 28px;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 15px;
  position: relative;
}

.convenios-header h2::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--primary-hover)
  );
  border-radius: 2px;
}

.convenios-header p {
  font-size: 16px;
  color: var(--text-color);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Convênios Wrapper */
.convenios-wrapper {
  position: relative;
  z-index: 2;
}

/* Convênios Grid */
.convenios-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 0 15px;
}

/* Convênio Card */
.convenio-card {
  background: #fff;
  border: 2px solid #f0f0f0;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.convenio-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(193, 52, 118, 0.1),
    transparent
  );
  transition: left 0.6s ease;
}

.convenio-card:hover::before {
  left: 100%;
}

.convenio-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-color);
  box-shadow: 0 8px 20px rgba(193, 52, 118, 0.15);
}

.convenio-card img {
  max-width: 100%;
  max-height: 50px;
  object-fit: contain;
  transition: transform 0.3s ease;
  filter: grayscale(0.3);
}

.convenio-card:hover img {
  transform: scale(1.05);
  filter: grayscale(0);
}

/* Convenios Info */
.convenios-info {
  text-align: center;
  margin-top: 50px;
  padding: 30px 20px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(193, 52, 118, 0.1);
  position: relative;
  z-index: 2;
}

.convenios-info p {
  font-size: 16px;
  color: var(--text-color);
  margin-bottom: 20px;
}

.convenios-info strong {
  color: var(--primary-color);
}

/* Responsive Convenios - Tablets */
@media (min-width: 600px) {
  .convenios-header h2 {
    font-size: 32px;
  }

  .convenios-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
  }

  .convenio-card {
    padding: 25px;
    min-height: 90px;
  }

  .convenio-card img {
    max-height: 55px;
  }
}

/* Responsive Convenios - Desktop Small */
@media (min-width: 900px) {
  .convenios-section {
    padding: 80px 0;
  }

  .convenios-header h2 {
    font-size: 36px;
  }

  .convenios-header p {
    font-size: 18px;
  }

  .convenios-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
  }

  .convenio-card {
    padding: 30px 25px;
    min-height: 100px;
  }

  .convenio-card img {
    max-height: 60px;
  }

  .convenios-info {
    margin-top: 60px;
    padding: 40px 30px;
  }

  .convenios-info p {
    font-size: 18px;
  }
}

/* Responsive Convenios - Desktop Large */
@media (min-width: 1200px) {
  .convenios-header h2 {
    font-size: 42px;
  }

  .convenios-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 35px;
  }

  .convenio-card {
    padding: 35px 30px;
    min-height: 110px;
  }

  .convenio-card img {
    max-height: 65px;
  }
}

/* Responsive Convenios - Extra Large */
@media (min-width: 1600px) {
  .convenios-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 40px;
  }

  .convenio-card {
    padding: 40px 35px;
    min-height: 120px;
  }

  .convenio-card img {
    max-height: 70px;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.unit-card {
  animation: fadeInUp 0.6s ease forwards;
}

.unit-card:nth-child(1) {
  animation-delay: 0.1s;
}
.unit-card:nth-child(2) {
  animation-delay: 0.2s;
}
.unit-card:nth-child(3) {
  animation-delay: 0.3s;
}
.unit-card:nth-child(4) {
  animation-delay: 0.4s;
}
.unit-card:nth-child(5) {
  animation-delay: 0.5s;
}
.unit-card:nth-child(6) {
  animation-delay: 0.6s;
}
.unit-card:nth-child(7) {
  animation-delay: 0.7s;
}
.unit-card:nth-child(8) {
  animation-delay: 0.8s;
}

.convenio-card {
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
}

.convenio-card:nth-child(1) {
  animation-delay: 0.1s;
}
.convenio-card:nth-child(2) {
  animation-delay: 0.15s;
}
.convenio-card:nth-child(3) {
  animation-delay: 0.2s;
}
.convenio-card:nth-child(4) {
  animation-delay: 0.25s;
}
.convenio-card:nth-child(5) {
  animation-delay: 0.3s;
}
.convenio-card:nth-child(6) {
  animation-delay: 0.35s;
}
.convenio-card:nth-child(7) {
  animation-delay: 0.4s;
}
.convenio-card:nth-child(8) {
  animation-delay: 0.45s;
}
.convenio-card:nth-child(9) {
  animation-delay: 0.5s;
}
.convenio-card:nth-child(10) {
  animation-delay: 0.55s;
}
.convenio-card:nth-child(11) {
  animation-delay: 0.6s;
}
.convenio-card:nth-child(12) {
  animation-delay: 0.65s;
}
.convenio-card:nth-child(13) {
  animation-delay: 0.7s;
}
.convenio-card:nth-child(14) {
  animation-delay: 0.75s;
}
.convenio-card:nth-child(15) {
  animation-delay: 0.8s;
}

/* ===== CONVÊNIOS SECTION ===== */

/* Convênios Section */
.convenios-section {
  background: linear-gradient(135deg, #f8f9ff 0%, #fdf5f8 50%, #f8f9ff 100%);
  padding: 60px 0;
  position: relative;
  overflow: hidden;
}

.convenios-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 100%;
  background: radial-gradient(
    circle at 70% 30%,
    rgba(193, 52, 118, 0.05) 0%,
    transparent 60%
  );
  animation: floatReverse 8s ease-in-out infinite;
}

@keyframes floatReverse {
  0%,
  100% {
    transform: translateX(0px) rotate(0deg);
  }
  50% {
    transform: translateX(-30px) rotate(1deg);
  }
}

/* Convênios Header */
.convenios-header {
  text-align: center;
  margin-bottom: 50px;
  position: relative;
  z-index: 2;
}

.convenios-header h2 {
  font-size: 28px;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 15px;
  position: relative;
}

.convenios-header h2::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--primary-hover)
  );
  border-radius: 2px;
}

.convenios-header p {
  font-size: 16px;
  color: var(--text-color);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Convênios Wrapper */
.convenios-wrapper {
  position: relative;
  z-index: 2;
}

/* Convênios Grid */
.convenios-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 0 15px;
}

/* Convênio Card */
.convenio-card {
  background: #fff;
  border: 2px solid #f0f0f0;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.convenio-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(193, 52, 118, 0.1),
    transparent
  );
  transition: left 0.6s ease;
}

.convenio-card:hover::before {
  left: 100%;
}

.convenio-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-color);
  box-shadow: 0 8px 20px rgba(193, 52, 118, 0.15);
}

.convenio-card img {
  max-width: 100%;
  max-height: 50px;
  object-fit: contain;
  transition: transform 0.3s ease;
  filter: grayscale(0.3);
}

.convenio-card:hover img {
  transform: scale(1.05);
  filter: grayscale(0);
}

/* Convenios Info */
.convenios-info {
  text-align: center;
  margin-top: 50px;
  padding: 30px 20px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(193, 52, 118, 0.1);
  position: relative;
  z-index: 2;
}

.convenios-info p {
  font-size: 16px;
  color: var(--text-color);
  margin-bottom: 20px;
}

.convenios-info strong {
  color: var(--primary-color);
}

/* Tablet */
@media (min-width: 600px) {
  .page-header h1 {
    font-size: 32px;
  }

  .units-grid {
    gap: 30px;
  }

  .unit-card {
    min-height: 350px;
  }

  .unit-card iframe {
    height: 220px;
  }

  .unit-content {
    padding: 25px;
  }

  .unit-content h3 {
    font-size: 20px;
  }

  .unit-content p {
    font-size: 15px;
  }

  /* Convênios Tablet */
  .convenios-header h2 {
    font-size: 32px;
  }

  .convenios-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
  }

  .convenio-card {
    padding: 25px;
    min-height: 90px;
  }

  .convenio-card img {
    max-height: 55px;
  }
}

/* Desktop Small */
@media (min-width: 900px) {
  .page-header {
    padding: 120px 0 50px 0;
  }

  .page-header h1 {
    font-size: 36px;
  }

  .info-sections {
    padding: 80px 0;
  }

  .info-sections p {
    font-size: 18px;
  }

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

  .unit-card {
    min-height: 370px;
  }

  .unit-card iframe {
    height: 240px;
  }

  /* Convênios Desktop Small */
  .convenios-section {
    padding: 80px 0;
  }

  .convenios-header h2 {
    font-size: 36px;
  }

  .convenios-header p {
    font-size: 18px;
  }

  .convenios-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
  }

  .convenio-card {
    padding: 30px 25px;
    min-height: 100px;
  }

  .convenio-card img {
    max-height: 60px;
  }

  .convenios-info {
    margin-top: 60px;
    padding: 40px 30px;
  }

  .convenios-info p {
    font-size: 18px;
  }
}

/* Desktop Large */
@media (min-width: 1200px) {
  .page-header h1 {
    font-size: 42px;
  }

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

  .unit-card {
    min-height: 400px;
  }

  .unit-card iframe {
    height: 260px;
  }

  .unit-content {
    padding: 30px 25px;
  }

  .unit-content h3 {
    font-size: 22px;
    margin-bottom: 12px;
  }

  .unit-content p {
    font-size: 16px;
  }

  /* Convênios Desktop Large */
  .convenios-header h2 {
    font-size: 42px;
  }

  .convenios-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 35px;
  }

  .convenio-card {
    padding: 35px 30px;
    min-height: 110px;
  }

  .convenio-card img {
    max-height: 65px;
  }
}

/* Extra Large Screens */
@media (min-width: 1600px) {
  .unit-card iframe {
    height: 280px;
  }
}

/* Extra Large Screens */
@media (min-width: 1600px) {
  .units-grid {
    gap: 50px;
  }

  .unit-card {
    min-height: 420px;
  }

  .unit-card iframe {
    height: 280px;
  }

  /* Convênios Extra Large */
  .convenios-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 40px;
  }

  .convenio-card {
    padding: 40px 35px;
    min-height: 120px;
  }

  .convenio-card img {
    max-height: 70px;
  }
}

/* Fade in animation for cards */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.unit-card {
  animation: fadeInUp 0.6s ease forwards;
}

.unit-card:nth-child(1) {
  animation-delay: 0.1s;
}
.unit-card:nth-child(2) {
  animation-delay: 0.2s;
}
.unit-card:nth-child(3) {
  animation-delay: 0.3s;
}
.unit-card:nth-child(4) {
  animation-delay: 0.4s;
}
.unit-card:nth-child(5) {
  animation-delay: 0.5s;
}
.unit-card:nth-child(6) {
  animation-delay: 0.6s;
}
.unit-card:nth-child(7) {
  animation-delay: 0.7s;
}
.unit-card:nth-child(8) {
  animation-delay: 0.8s;
}

/* Convênio Cards Animation */
.convenio-card {
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
}

.convenio-card:nth-child(1) {
  animation-delay: 0.1s;
}
.convenio-card:nth-child(2) {
  animation-delay: 0.15s;
}
.convenio-card:nth-child(3) {
  animation-delay: 0.2s;
}
.convenio-card:nth-child(4) {
  animation-delay: 0.25s;
}
.convenio-card:nth-child(5) {
  animation-delay: 0.3s;
}
.convenio-card:nth-child(6) {
  animation-delay: 0.35s;
}
.convenio-card:nth-child(7) {
  animation-delay: 0.4s;
}
.convenio-card:nth-child(8) {
  animation-delay: 0.45s;
}
.convenio-card:nth-child(9) {
  animation-delay: 0.5s;
}
.convenio-card:nth-child(10) {
  animation-delay: 0.55s;
}
.convenio-card:nth-child(11) {
  animation-delay: 0.6s;
}
.convenio-card:nth-child(12) {
  animation-delay: 0.65s;
}
.convenio-card:nth-child(13) {
  animation-delay: 0.7s;
}
.convenio-card:nth-child(14) {
  animation-delay: 0.75s;
}
.convenio-card:nth-child(15) {
  animation-delay: 0.8s;
}
.convenio-card:nth-child(16) {
  animation-delay: 0.85s;
}
.convenio-card:nth-child(17) {
  animation-delay: 0.9s;
}
.convenio-card:nth-child(18) {
  animation-delay: 0.95s;
}
.convenio-card:nth-child(19) {
  animation-delay: 1s;
}
.convenio-card:nth-child(20) {
  animation-delay: 1.05s;
}
.convenio-card:nth-child(n + 21) {
  animation-delay: 1.1s;
}

/* Focus states for accessibility */
.unit-card:focus-within {
  outline: none;
}

.unit-card iframe:focus {
  outline: none;
}

.convenio-card:focus {
  outline: none;
}

/* Print styles */
@media print {
  .unit-card iframe {
    display: none;
  }

  .unit-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .unit-content::after {
    content: " - Visite nosso site para ver a localização no mapa";
    font-style: italic;
    color: #666;
  }

  .convenios-section {
    background: #fff !important;
  }

  .convenios-section::before {
    display: none;
  }

  .convenio-card {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 1px solid #ccc;
    background: #fff;
  }

  .convenios-info {
    background: #f9f9f9;
    border: 1px solid #ccc;
  }
}
