/* Redesigned "clinic location" cards (SP Page Builder listing pages, e.g. /layanan/layanan-klinik/*).
   Purely structural/visual — no content, links or images are modified.
   Scoped to the specific 5-column pattern each clinic card uses (photo + hours + services + buttons)
   so unrelated SP Page Builder rows elsewhere on the site are never matched. */

#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 200px;
  grid-template-areas:
    "card-image card-title   card-actions"
    "card-image card-hours   card-actions"
    "card-image card-services card-actions";
  column-gap: 28px;
  align-items: start;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(15, 40, 45, 0.08);
  padding: 24px;
  margin: 0 0 24px;
}

/* Each column was originally designed to sit side-by-side at 25% of a 12-col row;
   now that each one owns a dedicated grid area it must fill that area fully. */
#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div {
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
}

/* --- Column 1: name + address --- */
#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(1) {
  grid-area: card-title;
}

#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(1) .sppb-addon-content div {
  text-align: left !important;
}

#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(1) strong {
  font-size: 18px;
  color: #1c2b2e;
  line-height: 1.35;
}

#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(1) span {
  font-size: 14px;
  color: #6b7679;
  font-weight: 400;
}

/* --- Column 2: photo --- */
#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(2) {
  grid-area: card-image;
}

#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(2) .sppb-addon-content,
#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(2) .sppb-addon-single-image-container {
  display: block !important;
  width: 100% !important;
}

#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(2) .sppb-addon-single-image-container {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #f0f2f3;
}

#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(2) img.sppb-img-responsive {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

/* --- Column 3: jam operasional / column 4: layanan --- */
#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(3) {
  grid-area: card-hours;
}

#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(4) {
  grid-area: card-services;
}

#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(3) .sppb-addon-content,
#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(4) .sppb-addon-content {
  text-align: left;
}

#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(3) p,
#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(4) p {
  margin: 0 0 2px;
  font-size: 14px;
  line-height: 1.5;
}

#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(3) p:first-child,
#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(4) p:first-child {
  font-weight: 600;
  color: #1c2b2e;
  margin-bottom: 4px;
}

#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(3) p:first-child:before {
  font-family: FontAwesome;
  content: "\f017";
  color: #00a0af;
  margin-right: 7px;
}

#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(4) p:first-child:before {
  font-family: FontAwesome;
  content: "\f0f1";
  color: #00a0af;
  margin-right: 7px;
}

#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(3) p:not(:first-child),
#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(4) p:not(:first-child) {
  color: #6b7679;
}

/* --- Column 5: action buttons --- */
#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(5) {
  grid-area: card-actions;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(5) .sppb-column-addons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(5) .sppb-text-right {
  text-align: left !important;
}

#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(5) .sppb-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border-radius: 999px !important;
  padding: 11px 18px !important;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.3;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(5) .sppb-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 160, 175, 0.25);
  opacity: .96;
}

/* First button = "Selengkapnya" -> solid fill */
#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(5) .sppb-addon-wrapper:nth-of-type(1) .sppb-btn {
  background: #00a0af !important;
  border: 1px solid #00a0af !important;
  color: #ffffff !important;
}

#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(5) .sppb-addon-wrapper:nth-of-type(1) .sppb-btn:after {
  font-family: FontAwesome;
  content: "\f061";
  font-size: 13px;
}

/* Second button = "Lihat Peta" -> outline */
#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(5) .sppb-addon-wrapper:nth-of-type(2) .sppb-btn {
  background: #ffffff !important;
  border: 1.5px solid #00a0af !important;
  color: #00a0af !important;
}

#sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(5) .sppb-addon-wrapper:nth-of-type(2) .sppb-btn:before {
  font-family: FontAwesome;
  content: "\f041";
  font-size: 14px;
}

/* --- "First Aid Center" content: moved (by clinic-card-enhanced.js, at runtime, DOM-only —
   no data is changed) from its own separate row into the button column of the clinic card
   it belongs to, right below "Lihat Peta". Every card keeps full rounded corners; there is
   no visual "seam" between rows any more. --- */

.clinic-card-firstaid-inline {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed #e3e7e8;
}

.clinic-card-firstaid-inline .sppb-addon-content p {
  margin: 0 0 6px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #6b7679;
}

.clinic-card-firstaid-inline .sppb-addon-content ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.clinic-card-firstaid-inline .sppb-addon-content li {
  position: relative;
  padding: 2px 0 2px 15px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #5b6266;
}

.clinic-card-firstaid-inline .sppb-addon-content li:before {
  content: "";
  position: absolute;
  left: 1px;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #00a0af;
}

/* --- Responsive: stack the card on narrow screens --- */
@media (max-width: 767px) {
  #sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) {
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-areas:
      "card-image card-title"
      "card-hours card-hours"
      "card-services card-services"
      "card-actions card-actions";
    row-gap: 14px;
    padding: 18px;
  }

  #sp-page-builder .sppb-row:has(> div:nth-child(5):last-child) > div:nth-child(5) {
    flex-direction: column;
  }
}
