/*
 * CWS Suite product info tabs.
 *
 * Five designs in one sheet, selected by the .cwspt--<layout> modifier the
 * widget puts on the root. Every colour is a --cwspt-* custom property written
 * inline by render(), so the values below are only fallbacks.
 */

.cwspt {
    --cwspt-ink: #16181d;
    --cwspt-ink-2: #3c4149;
    --cwspt-muted: #767c85;
    --cwspt-faint: #a4a9b0;
    --cwspt-line: #e8e7e4;
    --cwspt-line-soft: #f1f0ed;
    --cwspt-surface: #faf9f7;
    --cwspt-track: #f6f5f2;
    --cwspt-paper: #ffffff;
    --cwspt-indicator: #16181d;
    --cwspt-accent: #3b5bdb;
    --cwspt-radius: 10px;
    --cwspt-tab-gap: 34px;
    --cwspt-panel-gap: 34px;
    --cwspt-rail-w: 236px;
    --cwspt-ease: cubic-bezier(.22, .61, .36, 1);

    color: var(--cwspt-ink);
    box-sizing: border-box;
}

.cwspt *,
.cwspt *::before,
.cwspt *::after {
    box-sizing: border-box;
}

/* ── shared content bits ───────────────────────────────────────────────── */

.cwspt .cwspt-sec {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.3;
    margin: 0 0 16px;
    color: var(--cwspt-ink);
}

.cwspt .cwspt-body {
    font-size: 15px;
    line-height: 1.65;
    color: var(--cwspt-ink-2);
    max-width: 74ch;
    text-wrap: pretty;
}

.cwspt .cwspt-body > *:last-child {
    margin-bottom: 0;
}

.cwspt .cwspt-body p {
    margin: 0 0 14px;
}

.cwspt .cwspt-body a {
    color: var(--cwspt-accent);
}

.cwspt .cwspt-subhead {
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--cwspt-faint);
    font-weight: 700;
    margin: 0 0 18px;
}

.cwspt .cwspt-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 26px;
    align-items: center;
    border-top: 1px solid var(--cwspt-line-soft);
    margin-top: 34px;
    padding-top: 18px;
    font-size: 13px;
    color: var(--cwspt-muted);
}

.cwspt .cwspt-meta b {
    font-weight: 600;
    color: var(--cwspt-ink-2);
}

.cwspt .cwspt-meta a {
    color: var(--cwspt-accent);
    text-decoration: none;
}

.cwspt .cwspt-meta a:hover {
    color: var(--cwspt-ink);
}

.cwspt .cwspt-sku {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12.5px;
    letter-spacing: .02em;
}

/* ── specs: hairline rows ──────────────────────────────────────────────── */

.cwspt .cwspt-rows {
    display: grid;
    gap: 0;
    max-width: 640px;
    margin: 0;
}

.cwspt .cwspt-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 24px;
    padding: 13px 12px;
    border-bottom: 1px solid var(--cwspt-line-soft);
    border-radius: 6px;
    transition: background .18s;
}

.cwspt .cwspt-row.is-last {
    border-bottom: 0;
}

.cwspt .cwspt-row:hover {
    background: var(--cwspt-surface);
}

.cwspt .cwspt-row dt {
    font-size: 13px;
    color: var(--cwspt-muted);
    font-weight: 500;
    margin: 0;
}

.cwspt .cwspt-row dd {
    margin: 0;
    font-size: 14.5px;
    color: var(--cwspt-ink);
    font-weight: 500;
}

/* ── specs: card grid ──────────────────────────────────────────────────── */

.cwspt .cwspt-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    text-align: left;
}

.cwspt .cwspt-cell {
    background: var(--cwspt-surface);
    border: 1px solid var(--cwspt-line-soft);
    border-radius: var(--cwspt-radius);
    padding: 16px 16px 18px;
}

.cwspt .cwspt-cell-k {
    font-size: 10.5px;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--cwspt-faint);
    font-weight: 700;
    display: block;
    margin-bottom: 8px;
}

.cwspt .cwspt-cell-v {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.01em;
    display: block;
}

/* ── specs: chips ──────────────────────────────────────────────────────── */

.cwspt .cwspt-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
}

.cwspt .cwspt-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    border: 1px solid var(--cwspt-line);
    border-radius: 999px;
    padding: 8px 15px;
    font-size: 13px;
    background: var(--cwspt-paper);
    transition: border-color .2s, background .2s;
}

.cwspt .cwspt-chip:hover {
    border-color: var(--cwspt-accent);
    background: var(--cwspt-surface);
}

.cwspt .cwspt-chip i {
    font-style: normal;
    color: var(--cwspt-muted);
    font-size: 11px;
    letter-spacing: .09em;
    text-transform: uppercase;
    font-weight: 600;
}

.cwspt .cwspt-chip b {
    font-weight: 600;
}

/* ── panels ────────────────────────────────────────────────────────────── */

.cwspt .cwspt-panel {
    display: none;
}

.cwspt .cwspt-panel.is-on {
    display: block;
    animation: cwspt-fade .32s var(--cwspt-ease);
}

@keyframes cwspt-fade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.cwspt .cwspt-panel--centered {
    text-align: center;
}

.cwspt .cwspt-panel--centered .cwspt-body {
    margin-left: auto;
    margin-right: auto;
}

.cwspt .cwspt-panel--centered .cwspt-grid {
    margin-top: 26px;
}

.cwspt .cwspt-panel--centered .cwspt-rows,
.cwspt .cwspt-panel--centered .cwspt-facts {
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.cwspt .cwspt-panel--centered .cwspt-facts {
    justify-content: center;
}

/* Third-party tab output: give it breathing room, leave its markup alone. */
.cwspt .cwspt-panel--foreign > h2:first-child,
.cwspt .cwspt-panel--foreign > h3:first-child {
    margin-top: 0;
}

/* ── A. underline tabs ─────────────────────────────────────────────────── */

.cwspt--underline .cwspt-tabs {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--cwspt-tab-gap);
    border-bottom: 1px solid var(--cwspt-line);
    margin-bottom: var(--cwspt-panel-gap);
}

/* kit-armour-ignore: the root always carries a cwspt--<layout> modifier
   (wooproducttabs.php:993), and every layout that renders .cwspt-tab or
   .cwspt-more has a (0,2,0) rule for it, so the kit never wins. The accordion
   layout uses <details>/<summary> and renders neither. Variant-gated defence
   that is nevertheless total — no separate armour block needed. */
.cwspt--underline .cwspt-tab {
    border: 0;
    background: none;
    padding: 0 0 16px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--cwspt-faint);
    cursor: pointer;
    transition: color .2s;
}

.cwspt--underline .cwspt-tab:hover {
    color: var(--cwspt-ink-2);
}

.cwspt--underline .cwspt-tab[aria-selected="true"] {
    color: var(--cwspt-ink);
}

.cwspt--underline .cwspt-bar {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--cwspt-indicator);
    transition: transform .38s var(--cwspt-ease), width .38s var(--cwspt-ease);
}

.cwspt .cwspt-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--cwspt-faint);
    background: var(--cwspt-track);
    border-radius: 20px;
    padding: 2px 7px;
    margin-left: 7px;
    vertical-align: 1px;
}

.cwspt .cwspt-count-inline {
    font-weight: 500;
    opacity: .7;
}

/* ── B. segmented ──────────────────────────────────────────────────────── */

.cwspt--segmented .cwspt-segwrap {
    display: flex;
    justify-content: center;
    margin-bottom: var(--cwspt-panel-gap);
}

.cwspt--segmented .cwspt-seg {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    background: var(--cwspt-track);
    border: 1px solid var(--cwspt-line-soft);
    border-radius: 999px;
    padding: 5px;
    max-width: 100%;
}

.cwspt--segmented .cwspt-tab {
    position: relative;
    z-index: 1;
    border: 0;
    background: none;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--cwspt-muted);
    padding: 10px 22px;
    border-radius: 999px;
    cursor: pointer;
    transition: color .22s;
}

.cwspt--segmented .cwspt-tab[aria-selected="true"] {
    color: var(--cwspt-ink);
}

.cwspt--segmented .cwspt-pill {
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 0;
    width: 0;
    background: var(--cwspt-paper);
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(20, 22, 26, .08), 0 4px 12px rgba(20, 22, 26, .06);
    transition: transform .4s var(--cwspt-ease), width .4s var(--cwspt-ease);
}

/* ── C. accordion ──────────────────────────────────────────────────────── */

.cwspt--accordion .cwspt-acc {
    border-top: 1px solid var(--cwspt-line);
}

.cwspt--accordion details {
    border-bottom: 1px solid var(--cwspt-line);
}

.cwspt--accordion summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 4px;
    font-size: 16px;
    font-weight: 600;
    color: var(--cwspt-ink);
    transition: color .2s;
}

.cwspt--accordion summary::-webkit-details-marker {
    display: none;
}

.cwspt--accordion summary:hover {
    color: var(--cwspt-accent);
}

.cwspt--accordion details[open] summary {
    color: var(--cwspt-ink);
}

.cwspt--accordion .cwspt-idx {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    color: var(--cwspt-faint);
    letter-spacing: .06em;
}

.cwspt--accordion .cwspt-sign {
    margin-left: auto;
    position: relative;
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.cwspt--accordion .cwspt-sign::before,
.cwspt--accordion .cwspt-sign::after {
    content: "";
    position: absolute;
    background: var(--cwspt-ink);
    border-radius: 2px;
    transition: transform .32s var(--cwspt-ease), opacity .32s;
}

.cwspt--accordion .cwspt-sign::before {
    left: 0;
    top: 7px;
    width: 16px;
    height: 2px;
}

.cwspt--accordion .cwspt-sign::after {
    top: 0;
    left: 7px;
    width: 2px;
    height: 16px;
}

.cwspt--accordion details[open] .cwspt-sign::after {
    transform: rotate(90deg);
    opacity: 0;
}

.cwspt--accordion .cwspt-inner {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .38s var(--cwspt-ease);
}

.cwspt--accordion details[open] .cwspt-inner {
    grid-template-rows: 1fr;
}

.cwspt--accordion .cwspt-clip {
    overflow: hidden;
    min-height: 0;
}

.cwspt--accordion .cwspt-pad {
    padding: 2px 4px 30px;
}

/* ── D. side rail ──────────────────────────────────────────────────────── */

.cwspt--rail .cwspt-railwrap {
    display: grid;
    grid-template-columns: var(--cwspt-rail-w) minmax(0, 1fr);
    gap: 56px;
}

.cwspt--rail .cwspt-rail {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-left: 1px solid var(--cwspt-line);
    position: relative;
}

.cwspt--rail .cwspt-tab {
    position: relative;
    border: 0;
    background: none;
    text-align: left;
    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--cwspt-faint);
    padding: 14px 18px;
    cursor: pointer;
    transition: color .2s, background .2s;
    border-radius: 0 8px 8px 0;
}

.cwspt--rail .cwspt-tab:hover {
    color: var(--cwspt-ink-2);
    background: var(--cwspt-surface);
}

.cwspt--rail .cwspt-tab[aria-selected="true"] {
    color: var(--cwspt-ink);
}

.cwspt--rail .cwspt-tab small {
    display: block;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--cwspt-faint);
    margin-top: 3px;
}

.cwspt--rail .cwspt-mark {
    position: absolute;
    left: -1px;
    top: 0;
    width: 2px;
    height: 0;
    background: var(--cwspt-indicator);
    transition: transform .38s var(--cwspt-ease), height .38s var(--cwspt-ease);
}

/* ── E. flat ───────────────────────────────────────────────────────────── */

.cwspt--flat .cwspt-blocks {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 44px;
    align-items: start;
}

.cwspt--flat .cwspt-blocks--single {
    grid-template-columns: minmax(0, 1fr);
}

.cwspt--flat .cwspt-section {
    margin-top: 34px;
}

.cwspt--flat .cwspt-clamp {
    position: relative;
    max-height: 104px;
    overflow: hidden;
    transition: max-height .45s var(--cwspt-ease);
}

.cwspt--flat .cwspt-clamp::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 46px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--cwspt-paper));
    transition: opacity .3s;
    pointer-events: none;
}

/* The extra .cwspt on these two selectors is deliberate: the collapsed height
   is an Elementor `selectors` control, so its generated rule sits at the same
   specificity as a plain .cwspt--flat .cwspt-clamp.is-open and would win on
   source order. */
.cwspt.cwspt--flat .cwspt-clamp.is-open {
    max-height: 2000px;
}

.cwspt--flat .cwspt-clamp.is-open::after {
    opacity: 0;
}

/* No JS, or a description short enough not to need it: never leave the fade
   sitting over fully visible text. */
.cwspt.cwspt--flat .cwspt-clamp.is-unclamped {
    max-height: none;
}

.cwspt--flat .cwspt-clamp.is-unclamped::after {
    display: none;
}

/* kit-armour-ignore: .cwspt-more only renders in the flat layout
   (templates/layout-flat.php:57), and the root always carries cwspt--flat
   there (wooproducttabs.php:993), so this (0,2,0) rule always applies. Same
   reasoning as the .cwspt-tab pragma above. */
.cwspt--flat .cwspt-more {
    border: 0;
    background: none;
    padding: 0;
    margin-top: 12px;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--cwspt-accent);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.cwspt--flat .cwspt-more:hover {
    color: var(--cwspt-ink);
}

.cwspt--flat .cwspt-arw {
    transition: transform .3s;
}

.cwspt--flat .cwspt-more[aria-expanded="true"] .cwspt-arw {
    transform: rotate(180deg);
}

/* ── editor placeholder ────────────────────────────────────────────────── */

.cwspt-empty-block {
    border: 1px dashed var(--cwspt-line, #e8e7e4);
    border-radius: 12px;
    padding: 22px 24px;
}

/* ── motion ────────────────────────────────────────────────────────────── */

.cwspt--no-motion .cwspt-bar,
.cwspt--no-motion .cwspt-pill,
.cwspt--no-motion .cwspt-mark,
.cwspt--no-motion .cwspt-inner,
.cwspt--no-motion .cwspt-clamp,
.cwspt--no-motion .cwspt-sign::before,
.cwspt--no-motion .cwspt-sign::after {
    transition: none;
}

.cwspt--no-motion .cwspt-panel.is-on {
    animation: none;
}

@media (prefers-reduced-motion: reduce) {

    .cwspt .cwspt-bar,
    .cwspt .cwspt-pill,
    .cwspt .cwspt-mark,
    .cwspt .cwspt-inner,
    .cwspt .cwspt-clamp,
    .cwspt .cwspt-row,
    .cwspt .cwspt-chip,
    .cwspt .cwspt-arw,
    .cwspt .cwspt-sign::before,
    .cwspt .cwspt-sign::after {
        transition: none;
    }

    .cwspt .cwspt-panel.is-on {
        animation: none;
    }
}

/* ── responsive ────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .cwspt .cwspt-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .cwspt--rail .cwspt-railwrap {
        gap: 32px;
    }
}

@media (max-width: 900px) {

    /* The rail becomes a horizontal scroller; the mark rides the bottom edge. */
    .cwspt--rail .cwspt-railwrap {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .cwspt--rail .cwspt-rail {
        flex-direction: row;
        gap: var(--cwspt-tab-gap);
        border-left: 0;
        border-bottom: 1px solid var(--cwspt-line);
        margin-bottom: var(--cwspt-panel-gap);
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }

    .cwspt--rail .cwspt-rail::-webkit-scrollbar {
        display: none;
    }

    .cwspt--rail .cwspt-tab {
        flex: 0 0 auto;
        padding: 0 0 16px;
        border-radius: 0;
    }

    .cwspt--rail .cwspt-tab:hover {
        background: none;
    }

    .cwspt--rail .cwspt-mark {
        left: 0;
        top: auto;
        bottom: -1px;
        width: 0;
        height: 2px;
        transition: transform .38s var(--cwspt-ease), width .38s var(--cwspt-ease);
    }

    .cwspt--flat .cwspt-blocks {
        grid-template-columns: minmax(0, 1fr);
        gap: 34px;
    }
}

@media (max-width: 782px) {
    .cwspt .cwspt-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cwspt--underline .cwspt-tabs {
        gap: 0 24px;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }

    .cwspt--underline .cwspt-tabs::-webkit-scrollbar {
        display: none;
    }

    .cwspt--underline .cwspt-tab {
        flex: 0 0 auto;
    }
}

@media (max-width: 560px) {
    .cwspt .cwspt-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 2px;
        padding: 11px 8px;
    }

    .cwspt .cwspt-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .cwspt--segmented .cwspt-seg {
        border-radius: var(--cwspt-radius);
        width: 100%;
    }

    .cwspt--segmented .cwspt-tab {
        flex: 1 0 auto;
        padding: 10px 14px;
    }

    /* Wrapped pills make a single sliding pill lie about where it is. */
    .cwspt--segmented .cwspt-pill {
        display: none;
    }

    .cwspt--segmented .cwspt-tab[aria-selected="true"] {
        background: var(--cwspt-paper);
        border-radius: 999px;
    }
}
