/* ==========================================================================
  AIclinics Price Accordion & Table
  New row-based system with Schema.org Offer markup
  ========================================================================== */

.price-accordion {
  margin: 24px 0;
}

/* --- Group (accordion wrapper) --- */
.price-accordion__group {
  margin-bottom: 16px;
  border: 1px solid var(--border, #e9edf2);
  border-radius: var(--radius-card, 10px);
  overflow: hidden;
}

.price-accordion__group-title {
  padding: 14px 18px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  background: var(--bg-alt, #f4f6f8);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background .2s;
}

.price-accordion__group-title:hover {
  background: #eef1f4;
}

.price-accordion__group-title::after {
  content: '+';
  font-size: 20px;
  font-weight: 400;
  color: var(--text-light, #999);
  transition: transform .2s;
}

.price-accordion__group[open] > .price-accordion__group-title::after {
  content: '\2212'; /* minus sign */
}

.price-accordion__group-title::-webkit-details-marker {
  display: none;
}

/* --- Subgroup (child price category) --- */
.price-accordion__subgroup {
  margin: 8px 18px;
  border: 1px solid var(--border, #eef1f4);
  border-radius: 8px;
  overflow: hidden;
}

.price-accordion__subgroup-title {
  padding: 10px 14px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  background: var(--bg-alt, #f9fafb);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background .2s;
}

.price-accordion__subgroup-title:hover {
  background: #f0f2f5;
}

.price-accordion__subgroup-title::after {
  content: '+';
  font-size: 16px;
  font-weight: 400;
  color: var(--text-light, #aaa);
  transition: transform .2s;
}

.price-accordion__subgroup[open] > .price-accordion__subgroup-title::after {
  content: '\2212';
}

.price-accordion__subgroup-title::-webkit-details-marker {
  display: none;
}

/* --- Price Table Container --- */
.price-table {
  padding: 0 18px 12px;
}

.price-accordion__subgroup .price-table {
  padding: 0 14px 10px;
}

/* --- Price Row --- */
.price-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  gap: 12px;
  border-bottom: 1px solid var(--border, #eef1f4);
  transition: background .15s;
}

.price-row:last-child {
  border-bottom: none;
}

.price-row:hover {
  background: var(--bg-alt, #f9fafb);
}

/* Code (gray monospace) */
.price-row__code {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 13px;
  color: #999;
  min-width: 60px;
  flex-shrink: 0;
}

/* Name (bold, linked if page exists) */
.price-row__name {
  flex: 1;
  font-weight: 600;
  font-size: 15px;
  color: var(--text, #333);
}

.price-row__name a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
  transition: color .2s;
}

.price-row__name a:hover {
  color: var(--primary-color, #09CA8F);
}

/* Price (teal, right-aligned) */
.price-row__price {
  font-weight: 700;
  white-space: nowrap;
  color: var(--primary-color, #09CA8F);
  font-size: 15px;
  min-width: 80px;
  text-align: right;
  flex-shrink: 0;
}

/* Note */
.price-row__note {
  font-size: 13px;
  color: #888;
  max-width: 150px;
  flex-shrink: 0;
}

/* CTA Button */
.price-row__cta {
  display: inline-block;
  padding: 6px 14px;
  background: var(--primary-color, #09CA8F);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .2s, transform .15s;
  flex-shrink: 0;
}

.price-row__cta:hover {
  background: var(--primary-dark, #07a975);
  transform: translateY(-1px);
  color: #fff;
}

/* --- Old accordion styles (backward compat for TablePress fallback) --- */
.accordion-item {
  margin-bottom: 8px;
  border: 1px solid var(--border, #e9edf2);
  border-radius: 8px;
  overflow: hidden;
}

.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  background: var(--bg-alt, #f4f6f8);
  border: none;
  text-align: left;
  transition: background .2s;
}

.accordion-header:hover {
  background: #eef1f4;
}

.accordion-icon {
  transition: transform .3s;
  flex-shrink: 0;
}

.accordion-header[aria-expanded="true"] .accordion-icon {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease, padding .3s ease;
  padding: 0 18px;
}

.accordion-body.is-open {
  max-height: 2000px;
  padding: 12px 18px;
}

/* New-format price list inside accordion body (replaces TablePress tables) */
.price-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.price-list__row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 10px 6px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14.5px;
}
.price-list__row:last-child { border-bottom: 0; }
.price-list__name {
  color: var(--ds-text-primary, #1d1d1f);
  line-height: 1.35;
}
.price-list__amount {
  font-weight: 700;
  color: var(--primary-dark, #067A55);
  white-space: nowrap;
  font-size: 15px;
}
.price-list__cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: color-mix(in srgb, var(--primary-color, #09CA8F) 10%, transparent);
  color: var(--primary-dark, #067A55);
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s, transform .15s;
}
.price-list__cta:hover {
  background: var(--primary-dark, #067A55);
  color: #fff;
  transform: translateX(2px);
}
.price-list__empty {
  margin: 6px 0;
}
@media (max-width: 599px) {
  .price-list__row {
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
  }
  .price-list__cta {
    grid-column: 1 / -1;
    justify-self: flex-end;
    font-size: 12.5px;
    padding: 5px 11px;
  }
}

/* --- Mobile: stack code above name, price right --- */
@media (max-width: 599px) {
  .price-accordion__group-title {
    padding: 12px 14px;
    font-size: 15px;
  }

  .price-table {
    padding: 0 14px 8px;
  }

  .price-row {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0;
  }

  .price-row__code {
    width: 100%;
    min-width: 0;
    font-size: 12px;
    margin-bottom: -4px;
  }

  .price-row__name {
    flex: 1 1 60%;
    font-size: 14px;
  }

  .price-row__price {
    flex: 0 0 auto;
  }

  .price-row__note {
    width: 100%;
    max-width: none;
    font-size: 12px;
  }

  .price-row__cta {
    width: 100%;
    text-align: center;
    margin-top: 4px;
    padding: 8px 14px;
  }
}

/* --- Print styles --- */
@media print {
  .price-row__cta {
    display: none !important;
  }

  .price-accordion__group,
  .price-accordion__subgroup {
    break-inside: avoid;
    border-color: #ccc;
  }

  .price-row {
    border-bottom-color: #ddd;
  }

  .price-row__price {
    color: #333 !important;
  }

  .price-accordion__group-title::after,
  .price-accordion__subgroup-title::after {
    display: none;
  }

  .price-accordion__group,
  .price-accordion__subgroup {
    /* Force open for print */
  }

  details[open] > summary ~ * {
    display: block !important;
  }
}
