/*
 * FLOORA – Elementor Widget: Atrybuty kolekcji (tabelka/lista)
 * Domyślny wygląd można nadpisywać w kontrolkach stylu widgetu.
 */

.floora-collection-attrs {
  --floora-attr-icon-size: 22px;
  --floora-attr-col-gap: 22px;
  --floora-attr-row-pad-y: 18px;
  --floora-attr-row-pad-x: 0px;
  --floora-attr-divider-color: rgba(0,0,0,.18);
  --floora-attr-divider-width: 2px;
  --floora-attr-divider-style: dotted;
  --floora-attr-value-divider: 1;
  --floora-attr-row-divider: 1;
  /* Default widths for the label and value columns. Users can override these via the widget's Style controls. */
  --floora-attr-label-width: 1fr;
  --floora-attr-value-width: 1fr;
}

.floora-collection-attrs__table {
  display: flex;
  flex-direction: column;
}

.floora-collection-attrs__row {
  position: relative;
  display: grid;
  /* Use CSS variables for the label and value column widths to allow customization via Elementor controls. */
  grid-template-columns: var(--floora-attr-icon-size) minmax(0, var(--floora-attr-label-width)) minmax(0, var(--floora-attr-value-width));
  column-gap: var(--floora-attr-col-gap);
  align-items: center;
  padding: var(--floora-attr-row-pad-y) var(--floora-attr-row-pad-x);
}

/* When icons are disabled in the widget */
.floora-collection-attrs--no-icons .floora-collection-attrs__row {
  /* When icons are disabled, use the custom label and value widths. */
  grid-template-columns: minmax(0, var(--floora-attr-label-width)) minmax(0, var(--floora-attr-value-width));
}

.floora-collection-attrs--no-icons .floora-collection-attrs__icon {
  display: none;
}

.floora-collection-attrs--no-icons .floora-collection-attrs__row::after {
  left: 0;
}

/* Horizontal dotted divider (under the row) – does not cross the icon column */
.floora-collection-attrs__row::after {
  content: "";
  position: absolute;
  left: calc(var(--floora-attr-icon-size) + var(--floora-attr-col-gap));
  right: 0;
  bottom: 0;
  height: 0;
  border-bottom: calc(var(--floora-attr-row-divider) * var(--floora-attr-divider-width)) var(--floora-attr-divider-style) var(--floora-attr-divider-color);
}

.floora-collection-attrs__row:last-child::after {
  border-bottom-width: 0;
}

.floora-collection-attrs__icon {
  width: var(--floora-attr-icon-size);
  height: var(--floora-attr-icon-size);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .9;
}

.floora-collection-attrs__icon img,
.floora-collection-attrs__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.floora-collection-attrs__label {
  line-height: 1.2;
}

.floora-collection-attrs__value {
  line-height: 1.2;
  font-weight: 700;
  padding-left: 22px;
  border-left: calc(var(--floora-attr-value-divider) * var(--floora-attr-divider-width)) var(--floora-attr-divider-style) var(--floora-attr-divider-color);
}

/* Smaller screens: allow wrapping */
@media (max-width: 767px) {
  .floora-collection-attrs__row {
    /* Keep three columns on mobile: icon, label and value side by side. */
    grid-template-columns: var(--floora-attr-icon-size) minmax(0, var(--floora-attr-label-width)) minmax(0, var(--floora-attr-value-width));
    row-gap: 8px;
  }
  .floora-collection-attrs__value {
    /* Place the value in the third column and restore default spacing/border on mobile. */
    grid-column: 3 / 4;
    padding-left: var(--floora-attr-col-gap);
    border-left: calc(var(--floora-attr-value-divider) * var(--floora-attr-divider-width)) var(--floora-attr-divider-style) var(--floora-attr-divider-color);
  }
  .floora-collection-attrs__row::after {
    /* Align the horizontal separator to start after the icon column and gap, same as desktop. */
    left: calc(var(--floora-attr-icon-size) + var(--floora-attr-col-gap));
  }
}
