/* =========================================================
   Horticola Table to Cards
   - Desktop (>=768px): tabel re-stilizat
   - Mobile  (<768px):  carduri responsive
   ========================================================= */

.htc-wrap {
    margin: 1.25rem 0 1.75rem;
}

.htc-wrap__hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.htc-wrap__hint svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: #16a34a;
}

/* =========================================================
   DESKTOP: tabel curat și frumos (default)
   ========================================================= */

.htc-cards {
    display: none;
}

.htc-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
    font-size: 0.9375rem;
    line-height: 1.5;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    /* table-layout auto = coloanele se adaptează la conținut, nu sunt forțate egale */
    table-layout: auto;
}

.htc-table thead {
    background: #f0fdf4;
}

.htc-table thead th {
    color: #166534;
    font-weight: 600;
    text-align: center;
    padding: 0.75rem 0.875rem;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: none;
    border-right: 1px solid #dcfce7;
    border-bottom: 2px solid #16a34a;
    vertical-align: middle;
    white-space: nowrap;
}

.htc-table thead th:last-child {
    border-right: none;
}

.htc-table tbody td {
    padding: 0.75rem 0.875rem;
    border-top: 1px solid #f1f5f9;
    border-right: 1px solid #f8fafc;
    vertical-align: top;
    color: #1f2937;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.htc-table tbody td:last-child {
    border-right: none;
}

/* Coloane scurte (<= 30 caractere în toate celulele) — se comprimă la lățimea conținutului */
.htc-table th.htc-col-narrow,
.htc-table td.htc-col-narrow {
    width: 1%;
    white-space: nowrap;
}

.htc-table tbody tr:nth-child(even) td {
    background: #fafafa;
}

.htc-table tbody tr:hover td {
    background: #f0fdf4;
}

.htc-table__title {
    font-weight: 600;
    color: #111827;
    background: #ffffff;
    border-left: 3px solid #16a34a;
    width: 1%;
    white-space: nowrap;
}

.htc-table tbody tr:nth-child(even) .htc-table__title {
    background: #fafafa;
}

.htc-table tbody tr:hover .htc-table__title {
    background: #f0fdf4;
}

/* Permite "wrap" pe titlu doar dacă e foarte lung (peste ~25 caractere) */
.htc-table__title.htc-wrap-allowed {
    white-space: normal;
    width: auto;
    min-width: 12rem;
    max-width: 22rem;
}

.htc-table .htc-line {
    display: block;
    padding: 0.125rem 0;
}

.htc-table .htc-line + .htc-line {
    margin-top: 0.25rem;
    padding-top: 0.375rem;
    border-top: 1px dashed #e5e7eb;
}

.htc-table td p,
.htc-table th p,
.htc-table td div,
.htc-table th div {
    margin: 0 0 0.25rem 0;
    padding: 0;
}

.htc-table td p:last-child,
.htc-table th p:last-child,
.htc-table td div:last-child,
.htc-table th div:last-child {
    margin-bottom: 0;
}

/* =========================================================
   MOBILE: carduri (sub 768px)
   ========================================================= */

@media (max-width: 767px) {
    .htc-table {
        display: none;
    }

    .htc-cards {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .htc-card {
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        padding: 0.875rem 1rem;
        display: flex;
        flex-direction: column;
        gap: 0.625rem;
    }

    .htc-card__title {
        font-weight: 700;
        font-size: 1.0625rem;
        color: #111827;
        line-height: 1.35;
        padding-bottom: 0.625rem;
        border-bottom: 3px solid #16a34a;
    }

    .htc-card__title p,
    .htc-card__title div {
        margin: 0;
        padding: 0;
    }

    .htc-card__title p + p {
        font-weight: 500;
        font-size: 0.875rem;
        color: #6b7280;
        margin-top: 0.125rem;
    }

    .htc-card__rows {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .htc-card__row {
        display: flex;
        flex-direction: column;
        gap: 0.125rem;
        font-size: 0.9375rem;
        line-height: 1.45;
        padding-bottom: 0.5rem;
        border-bottom: 1px dashed #f3f4f6;
    }

    .htc-card__row:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .htc-card__label {
        color: #16a34a;
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .htc-card__value {
        color: #1f2937;
        word-wrap: break-word;
        overflow-wrap: anywhere;
        font-size: 0.9375rem;
    }

    .htc-card__value p,
    .htc-card__value div {
        margin: 0 0 0.25rem 0;
        padding: 0;
    }

    .htc-card__value p:last-child,
    .htc-card__value div:last-child {
        margin-bottom: 0;
    }

    .htc-card__value .htc-line {
        display: block;
        padding: 0.125rem 0;
    }

    .htc-card__value .htc-line + .htc-line {
        margin-top: 0.125rem;
        border-top: 1px dashed #e5e7eb;
        padding-top: 0.375rem;
    }

    .htc-card__subrows {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .htc-card__subrow {
        background: #f9fafb;
        border-radius: 8px;
        padding: 0.625rem 0.875rem;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .htc-card__subrow .htc-card__row {
        border-bottom: none;
        padding-bottom: 0;
    }
}
