/* Post-office directory: a region-wise accordion (Dhaka, Chittagong, …) shown on
   every screen size. Each open region renders a table on desktop and stacked
   cards on mobile. Brand colours: #ea2325 / #212121. */

.po-directory-accordion {
  display: block;
}

/* --- Accordion --- */
.po-acc-item {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin: 0 0 10px;
  overflow: hidden;
  background: #ffffff;
}

.po-acc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: 16px 20px;
  border: none;
  background: #f7f7f7;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.2s ease;
}
.po-acc-header:hover {
  background: #efefef;
}
.po-acc-item.is-open .po-acc-header,
.po-acc-item.is-open .po-acc-header:hover {
  background: #ea2325;
}

.po-acc-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: Montserrat, sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: #212121;
}
.po-acc-item.is-open .po-acc-title {
  color: #ffffff;
}

.po-acc-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  background: #ea2325;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}
.po-acc-item.is-open .po-acc-count {
  background: #ffffff;
  color: #ea2325;
}

/* Chevron icon */
.po-acc-icon {
  position: relative;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}
.po-acc-icon::before,
.po-acc-icon::after {
  content: "";
  position: absolute;
  top: 6px;
  width: 9px;
  height: 2px;
  background: #212121;
  transition: transform 0.2s ease, background 0.2s ease;
}
.po-acc-icon::before {
  left: 0;
  transform: rotate(45deg);
}
.po-acc-icon::after {
  right: 0;
  transform: rotate(-45deg);
}
.po-acc-item.is-open .po-acc-icon::before,
.po-acc-item.is-open .po-acc-icon::after {
  background: #ffffff;
}
.po-acc-item.is-open .po-acc-icon::before {
  transform: rotate(-45deg);
}
.po-acc-item.is-open .po-acc-icon::after {
  transform: rotate(45deg);
}

.po-acc-panel {
  padding: 16px 20px 20px;
}

/* --- Per-region table (desktop) --- */
.po-region-table {
  width: 100%;
  border-collapse: collapse;
}
.po-region-table th,
.po-region-table td {
  padding: 10px 14px;
  text-align: left;
  border: 1px solid #e8e8e8;
  font-size: 14px;
  line-height: 1.5;
  vertical-align: top;
}
.po-region-table thead th {
  background: #212121;
  color: #ffffff;
  font-weight: 700;
  white-space: nowrap;
}
.po-region-table tbody tr:nth-child(even) {
  background: #fafafa;
}
.po-region-table tbody td {
  color: #424242;
}

/* --- Mobile (≤575px): rows become stacked cards --- */
@media (max-width: 575px) {
  .po-acc-panel {
    padding: 12px;
  }
  .po-region-table,
  .po-region-table tbody {
    display: block;
    width: 100%;
  }
  .po-region-table thead {
    display: none;
  }
  .po-region-table tbody tr {
    display: block;
    margin: 0 0 12px;
    padding: 4px 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  }
  .po-region-table tbody tr:nth-child(even) {
    background: #ffffff;
  }
  .po-region-table tbody td {
    display: flex;
    align-items: flex-start;
    width: auto;
    padding: 7px 14px;
    border: none;
  }
  .po-region-table tbody td::before {
    content: attr(data-label);
    flex: 0 0 96px;
    padding-right: 10px;
    font-weight: 700;
    color: #212121;
  }
}
/* Row highlight when deep-linked from site search (?office=<sl>). */
.po-region-table tr.po-row-highlight td {
  background-color: #fff3cd;
  animation: po-row-flash 3.5s ease-out;
}
@keyframes po-row-flash {
  0%, 30% { background-color: #ffe39a; }
  100% { background-color: transparent; }
}
