.branch-card {
  border-radius: 1.75rem;
  overflow: hidden;
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.12);
  background: var(--white);
}

.branch-hero {
  position: relative;
  min-height: 260px;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.branch-ribbon {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(70%, 460px);
  background: rgba(0, 0, 0, 0.65);
  color: var(--white);
  padding: 1rem 1.5rem;
  font-weight: 700;
  font-family: var(--h-font);
  font-size: clamp(1.25rem, 4vw, 2.25rem);
  line-height: 1;
  border-top-left-radius: 1.25rem;
}

.branch-ico {
  color: var(--orange-dark);
  font-size: 1.25rem;
  line-height: 1;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.branch-accent {
  color: var(--white);
  background-color: var(--color-primary);
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition:
    background-color 0.3s ease,
    transform 0.2s ease;
}

.text-viber,
.text-whatsapp {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--white) !important;
  font-size: 1.1rem;
  transition:
    transform 0.2s ease,
    filter 0.2s ease;
  text-decoration: none;
}

.text-viber i,
.text-whatsapp i {
  transition: transform 0.2s ease;
  display: inline-block;
}

.text-viber {
  background-color: #7360f2;
}

.text-whatsapp {
  background-color: #25d366;
}

@media (hover: hover) {
  .text-viber:hover,
  .text-whatsapp:hover {
    transform: scale(1.2);
    filter: brightness(1.1);
  }

  .text-viber:hover i,
  .text-whatsapp:hover i {
    transform: scale(
      0.833
    ); /* Counter-scale (1 / 1.2) to keep icon same size */
  }
}

@media (hover: hover) {
  .branch-accent:hover {
    text-decoration: none;
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
  }
}

.branch-save {
  color: var(--orange-dark);
  text-decoration: none;
  font-weight: 700;
  transition:
    color 0.3s ease,
    opacity 0.3s ease;
}

@media (hover: hover) {
  .branch-save:hover {
    color: var(--color-primary-dark);
    opacity: 0.8;
  }
}

.branch-info {
  background: var(--orange-dark);
  padding: 1.25rem 1.25rem 1.6rem;
}

.branch-info-title {
  margin: 0.25rem 0 1rem 0;
}

.branch-info-grid {
  display: grid;
  gap: 0.5rem;
  justify-content: center;
  grid-template-columns: repeat(6, 64px);
}

.branch-info-item {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    background-color 0.3s ease;
}

.branch-info-item i {
  color: var(--orange-dark);
  font-size: 1.6rem;
}

.branch-info-svg {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

@media (hover: hover) {
  .branch-info-item:hover {
    transform: scale(1.1);
  }
}

@media (max-width: 680px) {
  .branch-hero {
    min-height: 240px;
  }

  .branch-info-grid {
    grid-template-columns: repeat(4, 64px);
  }
}

@media (max-width: 420px) {
  .branch-info-grid {
    grid-template-columns: repeat(3, 64px);
  }
}

/* Map Styles */
#contact-branches .map-container {
  height: 100%;
  min-height: 100%;
  border-radius: 1.75rem;
  overflow: hidden;
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.12);
}

#contact-branches #google-maps {
  width: 100%;
  height: 100%;
  min-height: 500px;
}

@media (max-width: 991px) {
  #contact-branches #google-maps {
    min-height: 400px;
  }
}

/* Map Info Window Custom Styles */
.map-info-window {
  width: 260px;
  font-family: var(--body-font);
  color: var(--text-dark);
}

.map-info-hero {
  position: relative;
  height: 120px;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  border-radius: 0.75rem 0.75rem 0 0;
  margin: -1px -1px 0 -1px; /* Compensate for potential info window padding if needed */
}

.map-info-ribbon {
  position: absolute;
  right: 0;
  bottom: 0;
  background: rgba(255, 151, 12, 0.9);
  color: var(--white);
  padding: 0.4rem 0.8rem;
  font-weight: 700;
  font-family: var(--h-font);
  font-size: 1.1rem;
  line-height: 1;
  border-top-left-radius: 0.75rem;
}

.map-info-content {
  padding: 1rem 0.5rem 0.5rem;
}

.map-info-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.3;
}

.map-info-icon {
  color: var(--orange-dark);
  font-size: 1rem;
  width: 16px;
  text-align: center;
  flex: 0 0 16px;
  margin-top: 2px;
}

.map-info-link {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

@media (hover: hover) {
  .map-info-link:hover {
    color: var(--orange-dark);
    text-decoration: none;
  }
}

.map-info-text {
  color: var(--text-muted);
}

/* Adjust Google Maps InfoWindow container */
.gm-style-iw {
  padding: 0 !important;
  border-radius: 0.75rem !important;
  overflow: hidden !important;
  max-width: 300px !important;
}

.gm-style-iw-d {
  overflow: hidden !important;
  max-height: none !important;
}

.gm-style .gm-style-iw-c {
  padding: 0 !important;
}

.gm-style-iw-t::after {
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, 1) 50%,
    rgba(255, 255, 255, 0) 51%,
    rgba(255, 255, 255, 0) 100%
  ) !important;
}
