.block-branches {
    margin-top: 40px;
}

.block-branches .container-branches {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 120px;
}

.section-title {
    margin: 0 23px 35px 43px;
    font-size: 28px;
    line-height: 1.2;
}

.branches-list {
    display: flex;
    flex-direction: column;
}

.branch-item {
    border-bottom: 1px solid #D1D5DB;
    padding: 32px 41px;
    background-color: transparent;
    cursor: pointer;
    transition: background 0.3s ease;
}

.branch-item:hover {
    background-color: #f1f1f1;
}

.branch-header {
    font-size: 20px;
    font-weight: 600;
    line-height: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #212529;
}

.branch-toggle-icon {
    width: 32px;
    height: 32px;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.branch-item.open .branch-toggle-icon {
    transform: rotate(45deg);
    filter: none;
    filter: brightness(0) saturate(100%) invert(33%) sepia(72%) saturate(526%) hue-rotate(94deg) brightness(91%) contrast(95%);
}

.branch-item:hover .branch-toggle-icon {
    filter: brightness(0) saturate(100%) invert(33%) sepia(72%) saturate(526%) hue-rotate(94deg) brightness(91%) contrast(95%);
}

.branch-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  transition:
    max-height 0.4s ease,
    opacity 0.3s ease 0.1s,
    margin-top 0.4s ease;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 20px;
  align-items: center;
}

.branch-item.open .branch-content {
  max-height: 500px;
  opacity: 1;
  margin-top: 30px;
  pointer-events: auto;
}

.branch-address {
    flex: 1 1 50%;
    font-size: 16px;
    color: #6B7280;
    line-height: 24px;
}

.branch-buttons {
    display: flex;
    gap: 10px;
    flex: 1 1 40%;
    justify-content: flex-end;
}

.branch-button {
    display: flex;
    flex: 1 1 30%;
    min-width: 200px;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 5px 15px;
    border: 3px solid #1F7A4F;
    border-radius: 12px;
    background-color: #f8f9fa;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
    text-decoration: none;
    color: #1F7A4F;
}

.branch-button:hover {
    background-color: #1F7A4F;
    color: #f8f9fa;
}

.branch-button img {
    width: 30px;
    height: 30px;
}

.branch-block {
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
  width: 100%;
  margin-bottom: 20px;
}

.branch-subitem {
  border-top: 1px dashed #D1D5DB;
  padding: 10px 0;
  cursor: pointer;
  transition: background 0.3s ease;
  width: 100%;
}

.branch-subheader {
  font-weight: 600;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #374151;
  margin-bottom: 10px;
}

.branch-subtoggle-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.branch-subitem.open .branch-subtoggle-icon {
  transform: rotate(45deg);
}

.branch-subcontent {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  padding-left: 10px;
}

.branch-subcontent.open,
.branch-subitem.open .branch-subcontent {
  max-height: 500px;
  opacity: 1;
}

.branch-subcontent .branch-address {
  font-size: 18px;
  margin: 25px 0;
  color: #6B7280;
}

@media (max-width: 1222px) {
    .block-branches .container-branches {
        padding: 0 20px;
    }

    .section-title {
        margin: 0 10px 20px;
        font-size: 24px;
    }

    .branch-item {
        padding: 20px;
    }

    .branch-header {
        font-size: 18px;
    }

    .branch-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .branch-address,
    .branch-buttons {
        flex: none;
        width: 100%;
        margin-bottom: 10px;
    }

    .branch-button {
        width: auto;
        min-width: unset;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .block-branches .container-branches {
        padding: 0 10px;
    }

    .section-title {
        margin: 0 5px 15px;
        font-size: 20px;
    }

    .branch-item {
        padding: 15px;
    }

    .branch-header {
        font-size: 16px;
    }

    .branch-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .branch-address,
    .branch-buttons {
        width: 100%;
        margin-bottom: 10px;
    }

    .branch-buttons {
        flex-direction: column;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }

    .branch-button {
        width: 100%;
        min-height: 50px;
        min-width: unset;
        padding: 0;
        justify-content: center;
        align-items: center;
        gap: 10px;
    }

    .branch-button img {
        width: 28px;
        height: 28px;
    }

    .branch-block {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 20px;
    }

    .branch-subheader {
        font-size: 15px;
    }

    .branch-subcontent {
        padding-left: 0;
    }
}