/**
 * Price Table — kabdalis2 design system.
 *
 * Token-based (tokens.css via body[data-dir]); var() fallbacks mirror the
 * "warm" direction so the table reads correctly even before the theme
 * cascade resolves. Loaded on the frontend (block present) and in the editor.
 *
 * Class map (kept in sync with index.js + view.js):
 *   .pt .pt--bare           wrapper (rides .b-card unless bare)
 *   .pt__head .pt__title    eyebrow + display title
 *   .pt__tabs .pt__tab      day-length tabs (rental source)
 *   .pt__body               fetch target
 *   .pt__group(-cap/-name/-range)  season / pre-season groups (lift source)
 *   .pt__table .pt__row .pt__c     CSS-grid "table"
 *   .pt__empty .pt__loading .pt__spin   states
 *   .pt__note .pt__editor-hint .pt__skel
 */

.kabdalis-price-table.pt {
    padding: clamp(18px, 2.6vw, 26px);
    box-sizing: border-box;
}
.kabdalis-price-table.pt--bare {
    padding: 0;
    background: none;
    border: 0;
}

/* ── Head ─────────────────────────────────────────────────────────── */
.pt__head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}
.pt__head .b-kicker {
    margin: 0;
}
.pt__title {
    margin: 0;
    font-family: var(--font-display, 'Source Serif 4', Georgia, serif);
    font-weight: var(--display-w, 540);
    letter-spacing: var(--display-ls, -0.012em);
    line-height: 1.12;
    font-size: clamp(1.3rem, 2.4vw, 1.7rem);
    color: var(--ink, #25211b);
}

/* ── Day tabs (rental) ────────────────────────────────────────────── */
.pt__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 16px;
}
.pt__tab {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    font: 600 .85rem var(--font-body, system-ui, sans-serif);
    color: var(--ink-soft, #564e42);
    background: var(--surface2, #f5f1ea);
    border: 1px solid var(--line, #e4ded2);
    border-radius: 999px;
    padding: 7px 14px;
    line-height: 1;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .12s ease;
}
.pt__tab:hover {
    border-color: color-mix(in srgb, var(--accent, #9c3a52) 45%, var(--line, #e4ded2));
    color: var(--ink, #25211b);
}
.pt__tab:active {
    transform: scale(.96);
}
.pt__tab.is-active {
    background: var(--accent, #9c3a52);
    border-color: var(--accent, #9c3a52);
    color: var(--on-accent, #fff);
}
.pt__tab:focus-visible {
    outline: 2px solid var(--accent, #9c3a52);
    outline-offset: 2px;
}

/* ── Season / pre-season groups (lift) ────────────────────────────── */
.pt__group + .pt__group {
    margin-top: 22px;
}
.pt__group-cap {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.pt__group-name {
    font: 600 .95rem var(--font-body, system-ui, sans-serif);
    color: var(--ink, #25211b);
}
.pt__group-range {
    font-family: var(--font-mono, 'Space Mono', monospace);
    font-size: .76rem;
    color: var(--muted, #8a8070);
}

/* ── Table (CSS grid so it wraps cleanly on mobile) ───────────────── */
.pt__table {
    display: grid;
    grid-template-columns: 1fr auto auto;
    width: 100%;
}
.pt__row {
    display: contents;
}
.pt__c {
    padding: 11px 10px;
    border-bottom: 1px solid var(--line, #e4ded2);
    color: var(--ink, #25211b);
    font-size: .92rem;
    line-height: 1.35;
    min-width: 0;
}
.pt__c--name {
    padding-left: 0;
    font-weight: 500;
}
.pt__c--price {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    padding-right: 0;
    padding-left: 18px;
    color: var(--ink-soft, #564e42);
}
.pt__row:last-child .pt__c {
    border-bottom: 0;
}

/* Header row — mono eyebrow style, prices right-aligned */
.pt__row--head .pt__c {
    font-family: var(--font-mono, 'Space Mono', monospace);
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
    color: var(--muted, #8a8070);
    border-bottom-color: color-mix(in srgb, var(--ink, #25211b) 22%, var(--line, #e4ded2));
    padding-top: 0;
}

/* Body-row stagger fade-in (skipped for reduced motion) */
@media (prefers-reduced-motion: no-preference) {
    .pt__table .pt__row:not(.pt__row--head) .pt__c {
        animation: ptRowIn .4s var(--ease, cubic-bezier(.22, .9, .3, 1)) backwards;
        animation-delay: calc(var(--i, 0) * 45ms);
    }
    @keyframes ptRowIn {
        from { opacity: 0; transform: translateY(6px); }
        to   { opacity: 1; transform: none; }
    }
}

/* ── States ───────────────────────────────────────────────────────── */
.pt__loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 0;
    color: var(--muted, #8a8070);
    font-size: .9rem;
}
.pt__spin {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--line, #e4ded2);
    border-top-color: var(--accent, #9c3a52);
    /* rotation keyframe (b-spin) lives in the theme's widget-frame.css */
    animation: b-spin .8s linear infinite;
}

.pt__empty {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: var(--surface2, #f5f1ea);
    border: 1px dashed var(--line, #e4ded2);
    border-radius: var(--radius-sm, 12px);
}
.pt__empty-ico {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent, #9c3a52) 12%, transparent);
    color: var(--accent, #9c3a52);
    font-size: 1.05rem;
}
.pt__empty-text {
    min-width: 0;
}
.pt__empty-title {
    font-weight: 600;
    font-size: .98rem;
    color: var(--ink, #25211b);
    margin-bottom: 2px;
}
.pt__empty-body {
    margin: 0;
    color: var(--ink-soft, #564e42);
    font-size: .88rem;
    line-height: 1.5;
}

/* ── Last-season notice ───────────────────────────────────────────────
   Shown above the table when the coming season's prices aren't published yet
   and we're falling back to last season's figures. Warn tone so it's clearly
   visible but not alarming. */
.pt__stale {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 16px;
    padding: 11px 14px;
    border-radius: var(--radius-sm, 12px);
    background: var(--warn-bg, #f6edda);
    color: var(--warn, #b07d27);
    border: 1px solid color-mix(in srgb, var(--warn, #b07d27) 35%, transparent);
    font-size: .86rem;
    line-height: 1.45;
}
.pt__stale i { margin-top: .12em; flex: 0 0 auto; font-size: 1rem; }
.pt__stale strong { font-weight: 700; }

/* ── Footnote ─────────────────────────────────────────────────────── */
.pt__note {
    margin: 14px 0 0;
    font-size: .78rem;
    line-height: 1.5;
    color: var(--muted, #8a8070);
}

/* ── Editor-only affordances ──────────────────────────────────────── */
.pt__editor-hint {
    margin: 12px 0 0;
    font-size: .8rem;
    font-style: italic;
    color: var(--muted, #8a8070);
}
.pt__skel {
    position: relative;
    min-height: 1.1em;
    border-radius: 6px;
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--ink, #25211b) 6%, transparent) 25%,
        color-mix(in srgb, var(--ink, #25211b) 11%, transparent) 50%,
        color-mix(in srgb, var(--ink, #25211b) 6%, transparent) 75%);
    background-size: 200% 100%;
}
.pt__skel.pt__c--name { width: 60%; }
.pt__skel.pt__c--price { width: 48px; margin-left: auto; }
@media (prefers-reduced-motion: no-preference) {
    .pt__skel { animation: ptShimmer 1.3s ease-in-out infinite; }
    @keyframes ptShimmer {
        from { background-position: 200% 0; }
        to   { background-position: -200% 0; }
    }
}
