/* =========================================
   XMART Policy — redesigned long-form legal
   pages (Terms of Service, Refund Policy).

   Loaded ONLY by policy_terms.blade.php and
   policy_refund.blade.php, never by the shared
   policy.blade.php used for Privacy Policy /
   any other policy_pages row. Reuses the
   --xmart-store-* tokens defined in
   xmart-storefront.css (already loaded by the
   frontend layout) instead of redefining colors.
========================================= */

.policy-page-page {
    padding: 48px 0 72px;
    background: var(--xmart-store-surface-alt);
}

.policy-page-container {
    max-width: 1140px;
}

/* Intro card ------------------------------------------------------ */

.policy-page-intro {
    position: relative;
    padding: 36px 40px;
    margin-bottom: 32px;
    background: var(--xmart-store-navy);
    border-radius: var(--xmart-store-radius);
    box-shadow: var(--xmart-store-shadow);
    overflow: hidden;
}

.policy-page-intro::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(720px 220px at 100% 0%, hsl(var(--base) / 0.35), transparent 70%);
    pointer-events: none;
}

.policy-page-eyebrow {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    margin-bottom: 14px;
    border-radius: 999px;
    background: hsl(var(--base) / 0.16);
    color: hsl(var(--base-200));
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.policy-page-title {
    position: relative;
    margin: 0 0 12px;
    color: hsl(var(--white));
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.policy-page-lede {
    position: relative;
    max-width: 68ch;
    margin: 0 0 18px;
    color: hsl(var(--white) / 0.78);
    font-size: 15.5px;
    line-height: 1.7;
}

.policy-page-lead-meta {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    padding-top: 16px;
    border-top: 1px solid hsl(var(--white) / 0.14);
    color: hsl(var(--white) / 0.85);
    font-size: 13.5px;
}

.policy-page-lead-meta p {
    margin: 0;
}

.policy-page-lead-meta strong {
    color: hsl(var(--white));
}

/* Layout: TOC + content -------------------------------------------- */

.policy-page-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: start;
    gap: 32px;
}

.policy-page-toc {
    position: sticky;
    top: 24px;
    padding: 22px 22px;
    background: var(--xmart-store-surface);
    border: 1px solid var(--xmart-store-border-strong);
    border-radius: var(--xmart-store-radius);
    box-shadow: var(--xmart-store-shadow);
}

.policy-page-toc__title {
    margin: 0 0 12px;
    color: var(--xmart-store-navy);
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.policy-page-toc__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.policy-page-toc__list a {
    display: block;
    padding: 7px 10px;
    border-radius: var(--xmart-store-radius-sm);
    color: var(--xmart-store-muted);
    font-size: 13.5px;
    line-height: 1.5;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.policy-page-toc__list a:hover,
.policy-page-toc__list a:focus-visible {
    background: var(--xmart-store-surface-alt);
    color: var(--xmart-store-navy);
}

/* Content card ------------------------------------------------------ */

.policy-page-content {
    padding: 40px 44px;
    background: var(--xmart-store-surface);
    border: 1px solid var(--xmart-store-border-strong);
    border-radius: var(--xmart-store-radius);
    box-shadow: var(--xmart-store-shadow);
    color: var(--xmart-store-text);
    font-size: 15.5px;
    line-height: 1.75;
}

.policy-page-content hr {
    display: none;
}

.policy-page-content h2 {
    scroll-margin-top: 24px;
    margin: 40px 0 14px;
    padding-top: 28px;
    border-top: 1px solid var(--xmart-store-border-strong);
    color: var(--xmart-store-navy);
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.policy-page-content > *:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.policy-page-content p {
    margin: 0 0 14px;
    color: var(--xmart-store-text);
}

.policy-page-content ul {
    margin: 0 0 16px;
    padding-left: 4px;
    list-style: none;
}

.policy-page-content li {
    position: relative;
    margin-bottom: 8px;
    padding-left: 20px;
    color: var(--xmart-store-text);
}

.policy-page-content li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--xmart-store-accent);
}

.policy-page-content li p {
    margin: 0;
}

.policy-page-content strong {
    color: var(--xmart-store-navy);
}

.policy-page-content a {
    color: var(--xmart-store-accent-strong);
    font-weight: 600;
}

/* Responsive --------------------------------------------------------- */

@media (max-width: 991.98px) {
    .policy-page-layout {
        grid-template-columns: 1fr;
    }

    .policy-page-toc {
        position: relative;
        top: 0;
    }

    .policy-page-toc__list {
        max-height: none;
    }

    .policy-page-content {
        padding: 32px 26px;
    }

    .policy-page-intro {
        padding: 28px 26px;
    }

    .policy-page-title {
        font-size: 26px;
    }
}

@media (max-width: 575.98px) {
    .policy-page-page {
        padding: 32px 0 48px;
    }

    .policy-page-content {
        padding: 24px 18px;
        font-size: 15px;
    }

    .policy-page-content h2 {
        font-size: 18.5px;
    }

    .policy-page-intro {
        padding: 22px 18px;
    }

    .policy-page-title {
        font-size: 23px;
    }

    .policy-page-toc {
        padding: 18px 16px;
    }
}
