.terms-page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    color: var(--text);
}

.terms-container {
    width: var(--container);
    margin-inline: auto;
}

/* =========================================================
   HERO
   ========================================================= */

.terms-hero {
    position: relative;
    padding: 72px 0 56px;
    overflow: hidden;
}

.terms-hero::before {
    content: "";
    position: absolute;
    top: -160px;
    right: -120px;
    width: 430px;
    height: 430px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(185, 15, 20, 0.28),
        transparent 68%
    );
    pointer-events: none;
}

.terms-hero::after {
    content: "";
    position: absolute;
    left: -160px;
    bottom: -220px;
    width: 440px;
    height: 440px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(255, 59, 69, 0.13),
        transparent 68%
    );
    pointer-events: none;
}

.terms-hero .terms-container {
    position: relative;
    z-index: 1;
}

.terms-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 8px 13px;
    border: 1px solid rgba(185, 15, 20, 0.28);
    border-radius: 999px;
    background: rgba(185, 15, 20, 0.11);
    color: var(--accent-2);
    font-size: 13px;
    font-weight: 950;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 28px rgba(185, 15, 20, 0.12);
}

.terms-hero h1 {
    max-width: 850px;
    margin: 0 0 20px;
    color: var(--heading);
    font-size: clamp(42px, 7vw, 82px);
    font-weight: 950;
    line-height: 0.96;
    letter-spacing: -0.065em;
}

.terms-hero > .terms-container > p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    font-size: clamp(17px, 2vw, 21px);
    line-height: 1.75;
}

/* =========================================================
   SEARCH
   ========================================================= */

.terms-search {
    max-width: 820px;
    margin-top: 36px;
}

.terms-search label {
    display: block;
    margin-bottom: 10px;
    color: var(--heading);
    font-size: 14px;
    font-weight: 950;
}

.terms-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.terms-search-icon {
    position: absolute;
    left: 18px;
    z-index: 2;
    color: var(--muted);
    pointer-events: none;
}

.terms-search input {
    width: 100%;
    min-height: 60px;
    margin: 0;
    padding: 0 58px 0 54px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background:
        linear-gradient(
            135deg,
            var(--panel-solid),
            var(--panel)
        );
    color: var(--text);
    outline: none;
    box-shadow: var(--shadow-soft);
    transition:
        border-color 0.2s var(--ease),
        box-shadow 0.2s var(--ease),
        transform 0.2s var(--ease),
        background 0.2s var(--ease);
}

.terms-search input::placeholder {
    color: var(--muted);
    opacity: 0.8;
}

.terms-search input:focus {
    border-color: var(--accent-2);
    box-shadow:
        0 0 0 4px rgba(185, 15, 20, 0.13),
        var(--shadow-soft);
    transform: translateY(-1px);
}

.terms-search-clear {
    position: absolute;
    right: 12px;
    z-index: 2;
    width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    border: 1px solid var(--line) !important;
    border-radius: 50% !important;
    background: var(--panel-2) !important;
    color: var(--text) !important;
    font-size: 24px !important;
    line-height: 1 !important;
    box-shadow: none !important;
    cursor: pointer;
}

.terms-search-clear:hover {
    transform: rotate(5deg) scale(1.04) !important;
    background: rgba(185, 15, 20, 0.12) !important;
    border-color: rgba(185, 15, 20, 0.35) !important;
    color: var(--accent-2) !important;
    box-shadow: none !important;
}

.terms-search-status {
    min-height: 23px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

/* =========================================================
   PAGE LAYOUT
   ========================================================= */

.terms-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 30px;
    padding-top: 24px;
    padding-bottom: 80px;
}

/* =========================================================
   SIDEBAR
   ========================================================= */

.terms-sidebar {
    position: relative;
}

.terms-sidebar-card {
    position: sticky;
    top: 110px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(
            180deg,
            var(--panel),
            rgba(255, 255, 255, 0.025)
        );
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.terms-sidebar-card h2 {
    margin: 0 0 18px;
    color: var(--heading);
    font-size: 19px;
    font-weight: 950;
    letter-spacing: -0.035em;
}

.terms-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.terms-sidebar a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid transparent;
    border-radius: 13px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
    transition:
        color 0.2s var(--ease),
        background 0.2s var(--ease),
        border-color 0.2s var(--ease),
        transform 0.2s var(--ease);
}

.terms-sidebar a::before {
    content: "";
    width: 6px;
    height: 6px;
    margin-right: 10px;
    border-radius: 50%;
    background: var(--line);
    transition:
        background 0.2s var(--ease),
        box-shadow 0.2s var(--ease),
        transform 0.2s var(--ease);
}

.terms-sidebar a:hover {
    border-color: rgba(185, 15, 20, 0.22);
    background: rgba(185, 15, 20, 0.09);
    color: var(--text);
    transform: translateX(4px);
}

.terms-sidebar a:hover::before {
    background: var(--accent-2);
    box-shadow: 0 0 14px var(--glow);
    transform: scale(1.25);
}

/* =========================================================
   CONTENT
   ========================================================= */

.terms-content {
    min-width: 0;
}

.terms-section {
    position: relative;
    margin-bottom: 22px;
    padding: 34px;
    scroll-margin-top: 115px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(
            180deg,
            var(--panel),
            rgba(255, 255, 255, 0.025)
        );
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition:
        transform 0.25s var(--ease),
        border-color 0.25s var(--ease),
        box-shadow 0.25s var(--ease);
}

.terms-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(
        180deg,
        var(--accent),
        var(--accent-2)
    );
    opacity: 0.8;
}

.terms-section::after {
    content: "";
    position: absolute;
    top: -110px;
    right: -110px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(185, 15, 20, 0.12),
        transparent 70%
    );
    pointer-events: none;
}

.terms-section:hover {
    transform: translateY(-3px);
    border-color: rgba(185, 15, 20, 0.34);
    box-shadow:
        0 26px 70px rgba(0, 0, 0, 0.18),
        0 0 40px rgba(185, 15, 20, 0.08);
}

.terms-section[hidden] {
    display: none;
}

.terms-section > * {
    position: relative;
    z-index: 1;
}

.terms-section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    min-height: 32px;
    margin-bottom: 16px;
    padding: 6px 12px;
    border: 1px solid rgba(185, 15, 20, 0.25);
    border-radius: 999px;
    background: rgba(185, 15, 20, 0.1);
    color: var(--accent-2);
    font-size: 13px;
    font-weight: 950;
    letter-spacing: 0.04em;
}

.terms-section h2 {
    margin: 0 0 18px;
    color: var(--heading);
    font-size: clamp(27px, 4vw, 38px);
    font-weight: 950;
    line-height: 1.05;
    letter-spacing: -0.045em;
}

.terms-section h3 {
    margin: 30px 0 10px;
    color: var(--heading);
    font-size: 21px;
    font-weight: 950;
    letter-spacing: -0.025em;
}

.terms-section p {
    margin: 0 0 17px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.8;
}

.terms-section ul {
    display: grid;
    gap: 12px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.terms-section li {
    position: relative;
    padding-left: 28px;
    color: var(--muted);
    line-height: 1.72;
}

.terms-section li::before {
    content: "✓";
    position: absolute;
    top: 1px;
    left: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: rgba(185, 15, 20, 0.12);
    color: var(--accent-2);
    font-size: 11px;
    font-weight: 950;
}

/* =========================================================
   PAYMENT AND SHIPPING CARDS
   ========================================================= */

.terms-method-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    margin-top: 24px;
}

.terms-method-card {
    position: relative;
    padding: 21px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background:
        linear-gradient(
            135deg,
            var(--panel-2),
            rgba(185, 15, 20, 0.055)
        );
    transition:
        transform 0.22s var(--ease),
        border-color 0.22s var(--ease),
        box-shadow 0.22s var(--ease);
}

.terms-method-card::after {
    content: "";
    position: absolute;
    top: -55px;
    right: -55px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(185, 15, 20, 0.08);
    pointer-events: none;
}

.terms-method-card:hover {
    transform: translateY(-3px);
    border-color: rgba(185, 15, 20, 0.35);
    box-shadow: 0 18px 42px rgba(185, 15, 20, 0.11);
}

.terms-method-card h3 {
    position: relative;
    z-index: 1;
    margin: 0 0 8px;
    color: var(--heading);
    font-size: 18px;
}

.terms-method-card p {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: 14px;
    line-height: 1.65;
}

/* =========================================================
   NOTICE
   ========================================================= */

.terms-notice {
    position: relative;
    margin-top: 24px !important;
    padding: 17px 19px 17px 52px;
    overflow: hidden;
    border: 1px solid rgba(185, 15, 20, 0.25);
    border-radius: var(--radius-sm);
    background:
        linear-gradient(
            135deg,
            rgba(185, 15, 20, 0.11),
            var(--panel-2)
        );
    color: var(--text) !important;
}

.terms-notice::before {
    content: "!";
    position: absolute;
    top: 17px;
    left: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        var(--accent),
        var(--accent-2)
    );
    color: #ffffff;
    font-size: 13px;
    font-weight: 950;
    box-shadow: 0 8px 20px rgba(185, 15, 20, 0.28);
}

/* =========================================================
   LINKS AND BUTTONS
   ========================================================= */

.terms-action-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    color: var(--accent-2);
    font-weight: 950;
    text-decoration: none;
    transition:
        color 0.2s var(--ease),
        transform 0.2s var(--ease);
}

.terms-action-link::after {
    content: "→";
    transition: transform 0.2s var(--ease);
}

.terms-action-link:hover {
    color: var(--accent-3);
    transform: translateX(2px);
}

.terms-action-link:hover::after {
    transform: translateX(4px);
}

.terms-primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    margin-top: 8px;
    padding: 13px 20px;
    border-radius: 16px;
    background:
        linear-gradient(
            135deg,
            var(--accent),
            var(--accent-2)
        );
    color: #ffffff;
    font-weight: 950;
    text-decoration: none;
    box-shadow: 0 14px 34px rgba(185, 15, 20, 0.24);
    transition:
        transform 0.2s var(--ease),
        box-shadow 0.2s var(--ease),
        filter 0.2s var(--ease);
}

.terms-primary-button::after {
    content: "→";
}

.terms-primary-button:hover {
    transform: translateY(-2px);
    filter: saturate(1.08);
    box-shadow: 0 18px 44px rgba(185, 15, 20, 0.34);
}

/* =========================================================
   NO RESULTS
   ========================================================= */

.terms-no-results {
    margin-bottom: 22px;
    padding: 42px 30px;
    border: 1px dashed rgba(185, 15, 20, 0.35);
    border-radius: var(--radius);
    background:
        linear-gradient(
            135deg,
            var(--panel),
            rgba(185, 15, 20, 0.055)
        );
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.terms-no-results h2 {
    margin: 0 0 12px;
    color: var(--heading);
    font-size: 28px;
}

.terms-no-results p {
    margin: 0;
    color: var(--muted);
}

.terms-no-results strong {
    color: var(--accent-2);
}

/* =========================================================
   SEARCH HIGHLIGHT
   ========================================================= */

.terms-highlight {
    padding: 2px 4px;
    border: 1px solid rgba(245, 158, 11, 0.45);
    border-radius: 5px;
    background: rgba(245, 158, 11, 0.25);
    color: var(--heading);
    font-weight: 900;
}

/* =========================================================
   DARK MODE SPECIFIC
   ========================================================= */

html[data-theme="dark"] .terms-section,
html[data-theme="dark"] .terms-sidebar-card,
html[data-theme="dark"] .terms-no-results {
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.3),
        0 0 45px rgba(185, 15, 20, 0.035);
}

html[data-theme="dark"] .terms-search input {
    background:
        linear-gradient(
            135deg,
            var(--input),
            var(--panel-solid)
        );
}

html[data-theme="dark"] .terms-highlight {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.22);
    color: #ffffff;
}

/* =========================================================
   LIGHT MODE SPECIFIC
   ========================================================= */

html[data-theme="light"] .terms-section,
html[data-theme="light"] .terms-sidebar-card,
html[data-theme="light"] .terms-no-results {
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.96),
            rgba(255, 255, 255, 0.84)
        );
}

html[data-theme="light"] .terms-method-card {
    background:
        linear-gradient(
            135deg,
            #ffffff,
            rgba(185, 15, 20, 0.04)
        );
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 960px) {
    .terms-layout {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .terms-sidebar-card {
        position: static;
    }

    .terms-sidebar nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .terms-sidebar a:hover {
        transform: translateY(-2px);
    }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 650px) {
    .terms-hero {
        padding: 48px 0 34px;
    }

    .terms-hero h1 {
        font-size: clamp(38px, 13vw, 54px);
        line-height: 0.98;
    }

    .terms-hero > .terms-container > p {
        font-size: 16px;
    }

    .terms-search {
        margin-top: 28px;
    }

    .terms-search input {
        min-height: 56px;
        padding-left: 49px;
        font-size: 15px;
    }

    .terms-search-icon {
        left: 16px;
    }

    .terms-layout {
        padding-top: 14px;
        padding-bottom: 55px;
    }

    .terms-sidebar-card {
        padding: 19px;
        border-radius: 20px;
    }

    .terms-sidebar nav {
        grid-template-columns: 1fr;
    }

    .terms-section {
        margin-bottom: 16px;
        padding: 25px 22px 25px 26px;
        border-radius: 20px;
    }

    .terms-section h2 {
        font-size: 29px;
    }

    .terms-section h3 {
        margin-top: 25px;
        font-size: 19px;
    }

    .terms-section p,
    .terms-section li {
        font-size: 15px;
    }

    .terms-method-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .terms-no-results {
        padding: 34px 22px;
        border-radius: 20px;
    }
}

/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 420px) {
    .terms-hero h1 {
        font-size: 38px;
    }

    .terms-label {
        font-size: 12px;
    }

    .terms-section {
        padding-inline: 21px 18px;
    }

    .terms-section h2 {
        font-size: 26px;
    }

    .terms-primary-button {
        width: 100%;
    }
}
