/* ============================================================
   Global plan comparison table
   ------------------------------------------------------------
   Markup:    resources/views/frontend/inc/compare-section.blade.php
   Behaviour: public/frontend/js/compare-section.js
   Self-contained; mobile-first. Lists are spaced with padding (the site resets list margins).
   The feature column is sticky; the table scrolls sideways inside .cmp-scroll only.
   ============================================================ */

.cmp {
    --cm-navy: #061634;
    --cm-blue: #2563eb;
    --cm-blue-soft: #eff5ff;
    --cm-orange: #f97316;
    --cm-orange-d: #ea580c;
    --cm-green: #16a34a;
    --cm-ink: #0f172a;
    --cm-text: #475569;
    --cm-muted: #64748b;
    --cm-line: #e6ebf3;
    --cm-line-soft: #eef2f7;
    --cm-soft: #f7f9fd;
    --cm-featured: #f5f8ff;
    --cm-hover: #f8fbff;
    --cm-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px rgba(15, 23, 42, .07);
    --label-w: 132px;
    --col-w: 132px;
    padding: 56px 0;
    background: #fff;
    color: var(--cm-text);
}
.cmp--soft { background: var(--cm-soft); }
.cmp *, .cmp *::before, .cmp *::after { box-sizing: border-box; }
.cmp a { text-decoration: none; }
.cmp [hidden] { display: none !important; }
.cmp :focus-visible { outline: 3px solid rgba(37, 99, 235, .45); outline-offset: 2px; border-radius: 6px; }
.cmp-sr {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Heading + summary chips ──────────────────────────────── */
.cmp-head { max-width: 700px; margin: 0 auto; padding-bottom: 18px; text-align: center; }
.cmp-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--cm-blue-soft);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--cm-blue);
}
.cmp-head h2 { margin: 0 0 10px; font-size: clamp(1.5rem, 1.15rem + 1.3vw, 2.2rem); font-weight: 900; line-height: 1.2; letter-spacing: -.01em; color: var(--cm-ink); }
.cmp-head p { margin: 0; font-size: 15.5px; line-height: 1.65; }

.cmp-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; margin: 0; padding: 0 0 24px; list-style: none; }
.cmp-meta li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 6px 14px;
    border: 1px solid var(--cm-line);
    border-radius: 999px;
    background: #fff;
    font-size: 13.5px;
}
.cmp-meta i { color: var(--cm-blue); }
.cmp-meta b { color: var(--cm-ink); }

/* ── Toolbar: type tabs, billing switch, differences toggle ── */
.cmp-toolbar { display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; }

.cmp-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px;
    border: 1px solid var(--cm-line);
    border-radius: 14px;
    background: #fff;
    scrollbar-width: none;
}
.cmp-tabs::-webkit-scrollbar { display: none; }
.cmp-tab {
    flex: 1 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--cm-text);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .2s, color .2s;
}
.cmp-tab span {
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--cm-line-soft);
    color: var(--cm-muted);
    font-size: 12px;
    font-weight: 800;
}
.cmp-tab:hover { background: var(--cm-soft); color: var(--cm-ink); }
.cmp-tab.is-active { background: var(--cm-navy); color: #fff; }
.cmp-tab.is-active span { background: rgba(255, 255, 255, .16); color: #fff; }

.cmp-switches { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }

.cmp-billing { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--cm-line); border-radius: 12px; background: #fff; }
.cmp-billing__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--cm-text);
    font: inherit;
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .2s, color .2s;
}
.cmp-billing__btn small { padding: 1px 7px; border-radius: 999px; background: #dcfce7; color: #15803d; font-size: 11px; font-weight: 800; }
.cmp-billing__btn:hover { color: var(--cm-ink); }
.cmp-billing__btn.is-active { background: var(--cm-blue); color: #fff; }
.cmp-billing__btn.is-active small { background: rgba(255, 255, 255, .2); color: #fff; }

.cmp-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; font-weight: 700; color: var(--cm-ink); cursor: pointer; user-select: none; }
.cmp-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cmp-switch__track {
    position: relative;
    flex-shrink: 0;
    width: 42px; height: 24px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background-color .2s;
}
.cmp-switch__track::after {
    content: "";
    position: absolute;
    top: 3px; left: 3px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .25);
    transition: transform .2s;
}
.cmp-switch input:checked + .cmp-switch__track { background: var(--cm-green); }
.cmp-switch input:checked + .cmp-switch__track::after { transform: translateX(18px); }
.cmp-switch input:focus-visible + .cmp-switch__track { outline: 3px solid rgba(37, 99, 235, .45); outline-offset: 2px; }
.cmp-switch__text small { margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--cm-line-soft); color: var(--cm-muted); font-size: 11.5px; font-weight: 700; }

/* ── Plan picker chips ────────────────────────────────────── */
.cmp-picker { display: flex; flex-direction: column; gap: 8px; padding-bottom: 16px; }
.cmp-picker__label { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--cm-muted); }
.cmp-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.cmp-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid var(--cm-line);
    border-radius: 999px;
    background: #fff;
    color: var(--cm-muted);
    font: inherit;
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .2s, border-color .2s, color .2s;
}
.cmp-chip i {
    width: 16px; height: 16px;
    display: grid;
    place-items: center;
    border: 1.5px solid #cbd5e1;
    border-radius: 5px;
    font-size: 9px;
    color: transparent;
    transition: background-color .2s, border-color .2s, color .2s;
}
.cmp-chip:hover { border-color: #c7d6f0; color: var(--cm-ink); }
.cmp-chip.is-on { border-color: #bfd3fb; background: var(--cm-blue-soft); color: var(--cm-ink); }
.cmp-chip.is-on i { border-color: var(--cm-blue); background: var(--cm-blue); color: #fff; }
.cmp-chip[aria-disabled="true"] { cursor: not-allowed; }

/* ── Table card ───────────────────────────────────────────── */
.cmp-card { overflow: hidden; border: 1px solid var(--cm-line); border-radius: 20px; background: #fff; box-shadow: var(--cm-shadow); }
.cmp-card__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 8px 12px 8px 16px;
    border-bottom: 1px solid var(--cm-line);
    background: #fbfcfe;
}
.cmp-status { margin: 0; font-size: 13px; font-weight: 700; color: var(--cm-ink); }
.cmp-nav { display: none; align-items: center; gap: 6px; }
.cmp.is-scrollable .cmp-nav { display: flex; }
.cmp-swipe { display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; font-size: 12px; color: var(--cm-muted); white-space: nowrap; }
.cmp-nav__btn {
    width: 34px; height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--cm-line);
    border-radius: 10px;
    background: #fff;
    color: var(--cm-ink);
    font-size: 12px;
    cursor: pointer;
    transition: background-color .2s, border-color .2s, opacity .2s;
}
.cmp-nav__btn:hover:not(:disabled) { border-color: #c7d6f0; background: var(--cm-blue-soft); color: var(--cm-blue); }
.cmp-nav__btn:disabled { opacity: .4; cursor: default; }

.cmp-card__body { position: relative; }
/* Edge shadows hint that more columns are hidden. */
.cmp-card__body::before,
.cmp-card__body::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    z-index: 4;
    width: 22px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
}
.cmp-card__body::before { left: var(--label-w); background: linear-gradient(90deg, rgba(15, 23, 42, .1), transparent); }
.cmp-card__body::after { right: 0; background: linear-gradient(270deg, rgba(15, 23, 42, .1), transparent); }
.cmp-card.can-left .cmp-card__body::before,
.cmp-card.can-right .cmp-card__body::after { opacity: 1; }

.cmp-scroll { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.cmp-scroll:focus-visible { outline-offset: -3px; border-radius: 0; }

.cmp-table {
    width: max(100%, calc(var(--label-w) + var(--visible) * var(--col-w)));
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 14px;
}
.cmp-table th,
.cmp-table td { padding: 12px 10px; border-bottom: 1px solid var(--cm-line-soft); vertical-align: middle; text-align: center; background-clip: padding-box; }

/* Sticky feature column */
.cmp-corner,
.cmp-label {
    position: sticky;
    left: 0;
    z-index: 2;
    width: var(--label-w);
    text-align: left !important;
    background: #fff;
    border-right: 1px solid var(--cm-line);
}
.cmp-corner { z-index: 3; vertical-align: bottom !important; }

/* Plan header cells */
.cmp-table thead th { padding: 16px 10px 14px; border-bottom: 1px solid var(--cm-line); background: #fff; vertical-align: bottom; }
.cmp-corner__title { display: block; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--cm-ink); }
.cmp-corner__hint { display: block; padding-top: 2px; font-size: 12px; font-weight: 500; color: var(--cm-muted); }
.cmp-plan { position: relative; }
.cmp-plan__badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
    padding: 3px 9px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cm-orange), #fbbf24);
    color: #fff;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(249, 115, 22, .28);
}
.cmp-plan__name { display: block; font-size: 15px; font-weight: 900; line-height: 1.25; color: var(--cm-ink); overflow-wrap: anywhere; }
.cmp-plan__meta { display: block; padding-top: 2px; font-size: 11.5px; font-weight: 600; color: var(--cm-muted); }
.cmp-price { display: block; padding-top: 10px; line-height: 1.2; }
.cmp-price b { font-size: 19px; font-weight: 900; color: var(--cm-ink); letter-spacing: -.01em; }
.cmp-price small { font-size: 12px; font-weight: 600; color: var(--cm-muted); }
.cmp-price em { display: block; padding-top: 3px; font-size: 11.5px; font-style: normal; font-weight: 600; color: var(--cm-muted); }
.cmp-price[data-period="yearly"] em { color: #15803d; }

/* Featured column */
.cmp-table .is-featured { background: var(--cm-featured); }
.cmp-table thead .is-featured { background: linear-gradient(180deg, #eaf1ff, var(--cm-featured)); box-shadow: inset 0 3px 0 var(--cm-blue); }
.cmp-table thead .is-featured .cmp-price b { color: var(--cm-blue); }

/* Row groups */
.cmp-group__head th {
    padding: 9px 16px;
    border-top: 1px solid var(--cm-line);
    border-bottom: 1px solid var(--cm-line);
    background: var(--cm-soft);
    text-align: left;
}
.cmp-group:first-of-type .cmp-group__head th { border-top: 0; }
.cmp-group__head span {
    position: sticky;
    left: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--cm-blue);
}

/* Feature labels */
.cmp-label { padding-left: 14px !important; font-weight: 700; color: var(--cm-ink); }
.cmp-label__inner { display: flex; align-items: center; gap: 10px; }
.cmp-label__icon {
    flex-shrink: 0;
    width: 30px; height: 30px;
    display: none;
    place-items: center;
    border-radius: 9px;
    background: var(--cm-blue-soft);
    color: var(--cm-blue);
    font-size: 13px;
}
.cmp-label__text { display: block; min-width: 0; font-size: 13.5px; line-height: 1.3; overflow-wrap: anywhere; }
.cmp-label__text small { display: block; padding-top: 2px; font-size: 11.5px; font-weight: 500; color: var(--cm-muted); }
.cmp-label__same {
    display: none;
    width: max-content;
    margin-top: 4px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--cm-line-soft);
    color: var(--cm-muted);
    font-size: 10.5px;
    font-weight: 700;
}
.cmp-row.is-same .cmp-label__same { display: block; }

/* Values */
.cmp-val { font-weight: 700; color: var(--cm-ink); overflow-wrap: anywhere; }
.cmp-val small { font-size: 12px; font-weight: 600; color: var(--cm-muted); }
.cmp-note { display: block; padding-top: 3px; font-size: 11.5px; line-height: 1.35; color: var(--cm-muted); }
.cmp-row.is-same td .cmp-val { font-weight: 600; color: var(--cm-text); }
.cmp-yes,
.cmp-no {
    width: 26px; height: 26px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    font-size: 11px;
}
.cmp-yes { background: #dcfce7; color: var(--cm-green); }
.cmp-no { background: var(--cm-line-soft); color: #94a3b8; }
.cmp-na { color: #94a3b8; font-weight: 700; }
.cmp-best {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #dcfce7;
    color: #15803d;
    font-size: 10.5px;
    font-weight: 800;
    white-space: nowrap;
}
.cmp-best i { font-size: 9px; }
.cmp-table td.is-best .cmp-val { color: #15803d; }

/* Row + column hover */
.cmp-row:hover td,
.cmp-row:hover .cmp-label { background: var(--cm-hover); }
.cmp-row:hover td.is-featured { background: #edf3ff; }
.cmp-table .is-col-hover { background: var(--cm-hover); }
.cmp-table .is-col-hover.is-featured { background: #edf3ff; }

/* Footer: order buttons */
.cmp-table tfoot th,
.cmp-table tfoot td { padding: 14px 10px; border-bottom: 0; }
.cmp-label--foot { font-size: 13px; color: var(--cm-muted); }
.cmp-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    max-width: 150px;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid #bfd3fb;
    border-radius: 10px;
    background: #fff;
    color: var(--cm-blue);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    transition: background-color .2s, border-color .2s, color .2s, transform .2s;
}
.cmp-cta i { font-size: 11px; transition: transform .2s; }
.cmp-cta:hover { border-color: var(--cm-blue); background: var(--cm-blue); color: #fff; }
.cmp-cta:hover i { transform: translateX(2px); }
.cmp-cta--primary { border-color: var(--cm-orange); background: var(--cm-orange); color: #fff; }
.cmp-cta--primary:hover { border-color: var(--cm-orange-d); background: var(--cm-orange-d); color: #fff; }
.cmp-cta.is-disabled { border-color: var(--cm-line); background: var(--cm-soft); color: var(--cm-muted); cursor: not-allowed; }

/* ── Below the table ──────────────────────────────────────── */
.cmp-foot { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 20px; }
.cmp-included { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.cmp-included__title { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: var(--cm-ink); }
.cmp-included__title i { color: var(--cm-green); }
.cmp-included ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cmp-included li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 5px 12px;
    border: 1px solid var(--cm-line);
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: var(--cm-ink);
}
.cmp-included li i { color: var(--cm-green); font-size: 11px; }
.cmp-link {
    display: inline-flex;
    flex-shrink: 0;
    white-space: nowrap;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--cm-line);
    border-radius: 10px;
    background: #fff;
    color: var(--cm-ink);
    font-size: 14px;
    font-weight: 700;
    transition: background-color .2s, border-color .2s, color .2s;
}
.cmp-link i { color: var(--cm-blue); }
.cmp-link:hover { border-color: #c7d6f0; background: var(--cm-blue-soft); color: var(--cm-ink); }

/* ── ≥576px ───────────────────────────────────────────────── */
@media (min-width: 576px) {
    .cmp { --label-w: 170px; --col-w: 142px; }
    .cmp-label__icon { display: grid; }
    .cmp-picker { flex-direction: row; align-items: flex-start; gap: 12px; }
    .cmp-picker__label { flex-shrink: 0; padding-top: 10px; }
}

/* ── ≥768px ───────────────────────────────────────────────── */
@media (min-width: 768px) {
    .cmp { --label-w: 196px; --col-w: 150px; padding: 72px 0; }
    .cmp-toolbar { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
    .cmp-tabs { flex: 0 1 auto; }
    .cmp-tab { flex: 0 0 auto; }
    .cmp-switches { justify-content: flex-end; margin-left: auto; }
    .cmp-table th,
    .cmp-table td { padding: 14px 12px; }
    .cmp-table thead th { padding: 18px 12px 16px; }
    .cmp-label { padding-left: 18px !important; }
    .cmp-label__text { font-size: 14px; }
    .cmp-price b { font-size: 21px; }
    .cmp-foot { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; }
    .cmp-included { flex-direction: row; flex-wrap: wrap; text-align: left; }
    .cmp-included ul { justify-content: flex-start; }
    .cmp-foot > .cmp-link:only-child { margin: 0 auto; }
}

/* ── ≥992px ───────────────────────────────────────────────── */
@media (min-width: 992px) {
    .cmp { --label-w: 214px; --col-w: 132px; padding: 88px 0; }
    .cmp-swipe { display: none; }
    .cmp-chips { flex-wrap: wrap; overflow: visible; padding-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .cmp *, .cmp *::before, .cmp *::after { transition: none !important; }
}
