/*
 * Availability signals for listings and for the units inside a project.
 *
 * These rules are hand-written and served as a plain static file instead of
 * going through Tailwind on purpose. The colours that carry "sold" used to be
 * utility classes (bg-rose-600 and friends); when an asset bundle was not
 * rebuilt after a template change those classes were absent, the pill kept its
 * white text on a white card, and every sold unit read as still for sale.
 *
 * That failure is silent and it always points the wrong way: it tells a visitor
 * something is available when it is not. So the availability colours must not
 * depend on a build step.
 */

.listing-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1px solid transparent;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.listing-status--available {
    background-color: #047857;
    border-color: #047857;
    color: #ffffff;
}

.listing-status--option {
    background-color: #b45309;
    border-color: #b45309;
    color: #ffffff;
}

.listing-status--sold {
    background-color: #be123c;
    border-color: #be123c;
    color: #ffffff;
}

.listing-status--rented {
    background-color: #334155;
    border-color: #334155;
    color: #ffffff;
}

/* A whole project that is largely gone: "75% verkocht" on a listing card. */
.listing-status--progress {
    background-color: #be123c;
    border-color: #be123c;
    color: #ffffff;
    text-transform: none;
    letter-spacing: 0;
}

/* A unit that can no longer be bought or rented. Muted, never hidden: the
   price stays readable so the range of the project still makes sense. */
.unit-card--unavailable {
    background-color: #f8fafc;
}

.unit-card--unavailable .unit-card__price {
    color: #64748b;
}

/* Only the amount is struck through -- a suffix like "(excl. kosten)" is not
   part of the offer that lapsed, and a line through it just reads as noise. */
.unit-card--unavailable .unit-card__amount {
    text-decoration: line-through;
    text-decoration-color: #be123c;
    text-decoration-thickness: 2px;
}

/* The one line that answers "what is actually left?" above the unit grid. */
.unit-availability-summary {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    background-color: #ffffff;
    font-size: 0.875rem;
    color: #334155;
}

.unit-availability-summary__count {
    font-weight: 700;
    color: #0f172a;
}

.unit-availability-summary--sold-out {
    border-color: #fecdd3;
    background-color: #fff1f2;
    color: #9f1239;
}

.unit-availability-summary--sold-out .unit-availability-summary__count {
    color: #9f1239;
}
