/*
 * E-Invoicing — product feature pages.
 *
 * Owns the redesigned feature heroes and the feature tour on:
 *   /features/digital-invoicing/
 *   /features/pos-invoicing/
 *
 * Every selector is prefixed product-. Shared tokens and the shared classes
 * (container, section, btn, record-line, setup__*, faq-*, cta__*) come from
 * site.css; the hero gradient comes from polish.css. No external libraries.
 */

/* ---------------- Hero ---------------- */

.product-hero {
    min-height: 100svh;
    display: grid;
    align-content: center;
    padding-top: calc(var(--header-h) + clamp(1.75rem, 4vw, 3rem));
    padding-bottom: clamp(2.75rem, 6vw, 4.5rem);
}

.product-hero + .section {
    padding-top: var(--section-y);
}

.product-hero__grid {
    display: grid;
    gap: clamp(2.25rem, 5vw, 4rem);
    align-items: center;
}

.product-hero__copy {
    display: grid;
    gap: 1.5rem;
    justify-items: start;
    max-width: 42rem;
}

.product-hero h1 {
    margin: 0;
    max-width: 22ch;
    font-size: var(--fs-page, clamp(2.1rem, 1.5rem + 2.4vw, 3.25rem));
    line-height: 1.04;
    letter-spacing: -0.035em;
}

.product-hero__lead {
    max-width: 40rem;
    font-size: var(--fs-lead, clamp(1.08rem, 1rem + 0.5vw, 1.3rem));
    line-height: 1.55;
    color: var(--ink-2);
}

.product-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.5rem;
}

/*
 * site.css gives .record-line a grid-row/column placement inside the homepage
 * hero grid. Neutralise that here so the proof strip stays in DOM order.
 */
.product-hero__proof.record-line {
    grid-column: auto;
    grid-row: auto;
    width: 100%;
    margin-top: 0.25rem;
    gap: 0.55rem 1.75rem;
}

.product-hero__proof li + li {
    padding-left: 0;
    border-left: 0;
}

.product-hero--split .product-hero__proof {
    flex-direction: column;
    gap: 0.55rem;
}

.product-hero__visual {
    position: relative;
    margin: 0;
    display: grid;
    gap: 0.9rem;
    min-width: 0;
}

.product-hero__frame {
    position: relative;
    padding: 0.75rem;
    background: var(--c-teal-ultra);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lift);
}

.product-hero__frame img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.product-hero__caption {
    font-size: 0.9375rem;
    color: var(--ink-2);
}

.product-hero__chips {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.product-hero__chip {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    background: var(--paper);
    border: 1px solid var(--rule);
    box-shadow: var(--shadow-float);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
}

.product-hero__chip .icon {
    width: 1rem;
    height: 1rem;
}

.product-hero__chip--accent {
    border-color: rgba(38, 166, 154, 0.45);
    color: var(--accent-ink);
}

.product-hero__chip--a {
    top: -0.85rem;
    left: -0.85rem;
}

.product-hero__chip--b {
    bottom: -0.85rem;
    right: -0.85rem;
}

/* Digital Invoicing: split hero, copy left, product plate right. */

@media (min-width: 62rem) {
    .product-hero--split .product-hero__grid {
        grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
    }
}

/* POS Invoicing: centered hero, copy centered, product plate beneath. */

.product-hero--center .product-hero__grid {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
}

.product-hero--center .product-hero__copy {
    justify-items: center;
    max-width: 54rem;
}

.product-hero--center .product-hero__lead {
    max-width: 48rem;
}

.product-hero--center .product-hero__proof {
    justify-content: center;
}

.product-hero--center .product-hero__visual {
    width: 100%;
    max-width: 46rem;
    justify-self: center;
}

.product-hero--center .product-hero__frame {
    display: grid;
    place-items: center;
    width: fit-content;
    margin-inline: auto;
}

.product-hero--center .product-hero__frame img {
    width: auto;
    max-width: 100%;
    max-height: 40vh;
}

@media (min-width: 62rem) {
    .product-hero--center .product-hero__grid {
        gap: clamp(1.75rem, 3.5vw, 2.75rem);
    }
}

/* ---------------- Feature tour ---------------- */

.product-tour__layout {
    display: grid;
    gap: 2.25rem;
    align-items: start;
}

.product-tour__nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-tour__tab {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
    width: 100%;
    padding: 1.15rem 1.25rem;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    text-align: left;
    color: var(--ink);
    font: inherit;
    cursor: pointer;
    transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

.product-tour__num {
    display: grid;
    place-items: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 50%;
    background: var(--paper-soft);
    color: var(--ink-2);
    font-size: 0.9375rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}

.product-tour__tab-title {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.012em;
    line-height: 1.3;
}

.product-tour__tab-desc {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--ink-2);
}

.product-tour__tab:hover {
    background: var(--paper-soft);
}

.product-tour__tab:focus-visible {
    outline: 2px solid var(--accent-ink);
    outline-offset: 2px;
}

.product-tour__tab.is-active {
    background: var(--c-teal-ultra);
    border-color: rgba(38, 166, 154, 0.35);
}

.product-tour__tab.is-active .product-tour__num {
    background: var(--accent-ink);
    color: var(--paper);
}

.product-tour__tab.is-active .product-tour__tab-title {
    color: var(--accent-press);
}

.product-tour__stage {
    min-width: 0;
}

.product-tour__panel {
    display: none;
    margin: 0;
}

.product-tour__panel.is-active {
    display: block;
    animation: product-panel-in 240ms var(--ease-out);
}

@keyframes product-panel-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.product-tour__panel:focus-visible {
    outline: 2px solid var(--accent-ink);
    outline-offset: 4px;
    border-radius: 12px;
}

.product-tour__frame {
    margin: 0;
    padding: 0.85rem;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 14px;
    overflow: hidden;
}

.product-tour__frame img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.product-tour__caption {
    display: block;
    margin-top: 1rem;
    font-size: 0.9375rem;
    color: var(--ink-2);
}

.product-tour__panel-copy {
    display: none;
}

.product-tour__panel-copy h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.012em;
}

.product-tour__panel-copy p {
    margin: 0.5rem 0 1rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--ink-2);
}

@media (min-width: 62rem) {
    .product-tour__layout {
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
        gap: clamp(2.5rem, 5vw, 4.5rem);
    }

    .product-tour__stage {
        position: sticky;
        top: calc(var(--header-h) + 1.5rem);
    }
}

@media (max-width: 61.99rem) {
    .product-tour__nav {
        flex-direction: row;
        gap: 0.5rem;
        margin-inline: calc(var(--gutter, 1.5rem) * -1);
        padding: 0.25rem var(--gutter, 1.5rem) 0.65rem;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .product-tour__tab {
        flex: 0 0 auto;
        scroll-snap-align: start;
        width: auto;
        min-width: 12rem;
        max-width: 15rem;
        padding: 0.85rem 1rem;
        border-color: var(--rule);
        background: var(--paper);
    }

    .product-tour__tab-desc {
        display: none;
    }

    .product-tour__num {
        width: 1.9rem;
        height: 1.9rem;
        font-size: 0.8125rem;
    }

    .product-tour__panel-copy {
        display: block;
    }
}

@media (max-width: 40rem) {
    .product-hero h1 {
        max-width: none;
    }

    .product-hero--center .product-hero__frame img {
        max-height: none;
    }

    .product-hero__chips {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .product-hero__chip {
        position: static;
    }

    .product-tour__tab {
        min-width: 10.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-tour__tab,
    .product-tour__num {
        transition: none;
    }

    .product-tour__panel.is-active {
        animation: none;
    }
}
