/* =========================================================
   LUXSOME LEGAL PAGES
   Shared by Terms, Refunds, Privacy and Shipping pages
========================================================= */

:root {
    --legal-bg: #f7f2eb;
    --legal-surface: #fffdf9;
    --legal-surface-soft: #fffaf4;
    --legal-text: #2a211c;
    --legal-heading: #2f221c;
    --legal-muted: #67574d;
    --legal-subtle: #8b786c;
    --legal-wine: #673629;
    --legal-gold: #c6915e;
    --legal-border: rgba(42, 33, 28, 0.09);
    --legal-shadow: 0 18px 46px rgba(47, 34, 28, 0.07);
    --legal-header-offset: 125px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--legal-header-offset);
}

body {
    background: var(--legal-bg);
    color: var(--legal-text);
}

/* =========================================================
   READING PROGRESS
========================================================= */

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: 100%;
    height: 4px;
    pointer-events: none;
    background: rgba(103, 54, 41, 0.08);
}

.reading-progress__bar {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--legal-wine), var(--legal-gold));
    transform-origin: left center;
    transition: width 0.08s linear;
}

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

.legal-hero {
    padding: 90px 0 70px;
    border-bottom: 1px solid var(--legal-border);
}

.legal-hero-inner {
    max-width: 850px;
}

.legal-hero h1 {
    margin: 14px 0 20px;
    color: var(--legal-heading);
    font-size: clamp(2.7rem, 5vw, 4.8rem);
    line-height: 1.05;
}

.legal-hero-text,
.legal-hero-description {
    max-width: 720px;
    margin: 0;
    color: var(--legal-muted);
    font-size: 1.05rem;
    line-height: 1.8;
}

.legal-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
    color: var(--legal-subtle);
    font-size: 0.9rem;
}

.legal-updated,
.legal-reading-time {
    margin: 0;
}

.legal-reading-time {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.legal-reading-time i {
    color: var(--legal-wine);
    font-size: 0.85rem;
}

.legal-meta-divider {
    color: rgba(103, 54, 41, 0.4);
}

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

.legal-section,
.legal-page {
    position: relative;
    padding: 80px 0;
    overflow: visible;
}

.legal-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    align-items: start;
    gap: clamp(42px, 5vw, 70px);
    overflow: visible;
}

/* =========================================================
   SIDEBAR / TABLE OF CONTENTS
   Supports both:
   1. aside.legal-navigation > nav > a
   2. aside.legal-sidebar > nav.legal-navigation > a
========================================================= */

.legal-sidebar,
.legal-layout > .legal-navigation {
    position: sticky;
    top: var(--legal-header-offset);
    align-self: start;
    min-width: 0;
    height: fit-content;
    max-height: calc(100vh - var(--legal-header-offset) - 24px);
}

.legal-navigation {
    padding: 26px 24px;
    border: 1px solid var(--legal-border);
    border-radius: 20px;
    background: var(--legal-surface);
    box-shadow: var(--legal-shadow);
}

/* Prevent double sticky when the nav is inside .legal-sidebar */
.legal-sidebar .legal-navigation {
    position: static;
    top: auto;
    max-height: inherit;
    overflow-y: auto;
}

/* Terms page: aside itself is .legal-navigation */
.legal-layout > aside.legal-navigation {
    overflow-y: auto;
}

/* Refund page: links are direct children.
   Terms page: links are inside a nested nav. */
.legal-navigation > nav,
.legal-navigation:not(:has(> nav)) {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.legal-navigation-title {
    margin: 0 0 16px;
    color: var(--legal-wine);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    line-height: 1.4;
    text-transform: uppercase;
}

.legal-navigation a {
    position: relative;
    display: block;
    padding: 7px 8px 7px 14px;
    border-left: 2px solid transparent;
    color: var(--legal-muted);
    font-size: 0.84rem;
    line-height: 1.45;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition:
        color 0.22s ease,
        padding-left 0.22s ease,
        background-color 0.22s ease;
}

.legal-navigation a::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -2px;
    width: 2px;
    height: 0;
    background: var(--legal-gold);
    transform: translateY(-50%);
    transition: height 0.22s ease;
}

.legal-navigation a:hover {
    padding-left: 18px;
    color: var(--legal-wine);
    background: rgba(198, 145, 94, 0.08);
}

.legal-navigation a.is-active {
    color: var(--legal-wine);
    font-weight: 700;
}

.legal-navigation a.is-active::before {
    height: 72%;
}

/* Sidebar scrollbar */
.legal-sidebar .legal-navigation,
.legal-layout > aside.legal-navigation {
    scrollbar-width: thin;
    scrollbar-color: rgba(103, 54, 41, 0.3) transparent;
}

.legal-sidebar .legal-navigation::-webkit-scrollbar,
.legal-layout > aside.legal-navigation::-webkit-scrollbar {
    width: 6px;
}

.legal-sidebar .legal-navigation::-webkit-scrollbar-thumb,
.legal-layout > aside.legal-navigation::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(103, 54, 41, 0.25);
}

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

.legal-content {
    width: 100%;
    max-width: 820px;
    min-width: 0;
}

.legal-introduction {
    margin-bottom: 55px;
    padding: 32px 34px;
    border-left: 5px solid var(--legal-wine);
    border-radius: 0 18px 18px 0;
    background: var(--legal-surface-soft);
}

.legal-introduction p {
    margin: 0;
    color: var(--legal-muted);
    font-size: 0.96rem;
    line-height: 1.85;
}

.legal-introduction p:not(:last-child) {
    margin-bottom: 18px;
}

.legal-block {
    margin-bottom: 68px;
}

.legal-block,
.legal-related,
.legal-introduction {
    scroll-margin-top: calc(var(--legal-header-offset) + 15px);
}

.legal-block h2,
.legal-related h2 {
    margin: 0 0 18px;
    color: var(--legal-heading);
    font-size: clamp(1.55rem, 2.6vw, 2rem);
    line-height: 1.24;
}

.legal-block h3 {
    margin: 0 0 10px;
    color: var(--legal-heading);
    font-size: 1.1rem;
    line-height: 1.4;
}

.legal-block p {
    margin: 0 0 18px;
    color: var(--legal-muted);
    font-size: 0.92rem;
    line-height: 1.9;
}

.legal-block ul,
.legal-block ol {
    margin: 18px 0 24px;
    padding-left: 1.45rem;
    color: var(--legal-muted);
    font-size: 0.92rem;
}

.legal-block li {
    margin-bottom: 9px;
    padding-left: 4px;
    line-height: 1.75;
}

.legal-block li::marker {
    color: var(--legal-gold);
}

.legal-block a {
    color: var(--legal-wine);
    font-weight: 600;
    text-underline-offset: 3px;
}

.legal-block a:hover {
    text-decoration-thickness: 2px;
}

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

.legal-notice {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin: 32px 0;
    padding: 22px 24px;
    border: 1px solid rgba(198, 145, 94, 0.35);
    border-radius: 18px;
    background: #fff7eb;
}

.legal-notice > i {
    flex: 0 0 auto;
    margin-top: 4px;
    color: var(--legal-wine);
    font-size: 1.25rem;
}

.legal-notice > div {
    min-width: 0;
}

.legal-notice h3 {
    margin: 0 0 8px;
}

.legal-notice p {
    margin: 0;
}

.legal-notice--important {
    border-color: rgba(103, 54, 41, 0.25);
    background: #f8eee8;
}

/* Refund page notices may not include an icon */
.legal-notice:not(:has(> i)) {
    display: block;
    border-left: 4px solid var(--legal-gold);
}

/* =========================================================
   CONTACT CARD
========================================================= */

.legal-contact-card {
    display: grid;
    gap: 14px;
    margin-top: 24px;
    padding: 26px;
    border: 1px solid var(--legal-border);
    border-radius: 18px;
    background: var(--legal-surface);
    box-shadow: var(--legal-shadow);
}

.legal-contact-card > h3 {
    margin: 0 0 4px;
    color: var(--legal-heading);
    font-size: 1.35rem;
}

.legal-contact-card > p {
    margin: 0;
}

.legal-contact-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 14px 0;
}

.legal-contact-item:not(:last-child) {
    border-bottom: 1px solid var(--legal-border);
}

.legal-contact-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(198, 145, 94, 0.14);
    color: var(--legal-wine);
    font-size: 1rem;
}

.legal-contact-label {
    margin: 0 0 3px !important;
    color: var(--legal-subtle) !important;
    font-size: 0.72rem !important;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.4 !important;
    text-transform: uppercase;
}

.legal-contact-item a {
    color: var(--legal-wine);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.legal-contact-item a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* =========================================================
   RELATED POLICIES
========================================================= */

.legal-related {
    margin-top: 16px;
    padding-top: 50px;
    border-top: 1px solid var(--legal-border);
}

.legal-related .eyebrow {
    margin-bottom: 10px;
}

.legal-related-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 26px;
}

.legal-related-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 92px;
    padding: 20px;
    border: 1px solid var(--legal-border);
    border-radius: 16px;
    background: var(--legal-surface);
    color: var(--legal-heading);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.45;
    text-decoration: none;
    box-shadow: 0 10px 28px rgba(47, 34, 28, 0.04);
    transition:
        transform 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease;
}

.legal-related-links a i {
    flex: 0 0 auto;
    color: var(--legal-gold);
    transition: transform 0.22s ease;
}

.legal-related-links a:hover {
    transform: translateY(-3px);
    border-color: rgba(103, 54, 41, 0.2);
    box-shadow: 0 16px 34px rgba(47, 34, 28, 0.08);
}

.legal-related-links a:hover i {
    transform: translateX(4px);
}

/* =========================================================
   BOTTOM CTA
========================================================= */

.legal-cta-section {
    padding: 0 0 90px;
}

.legal-cta {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(250px, 0.65fr);
    align-items: center;
    gap: 48px;
    padding: clamp(34px, 5vw, 58px);
    border-radius: 28px;
    background: var(--legal-wine);
    color: #fff;
    box-shadow: 0 24px 54px rgba(47, 34, 28, 0.2);
}

.legal-cta .eyebrow {
    color: rgba(255, 255, 255, 0.72);
}

.legal-cta h2 {
    margin: 10px 0 14px;
    color: #fff;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    line-height: 1.15;
}

.legal-cta p {
    max-width: 650px;
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.94rem;
    line-height: 1.8;
}

.legal-cta-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

.legal-cta .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 52px;
    padding: 14px 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition:
        transform 0.22s ease,
        background-color 0.22s ease,
        border-color 0.22s ease,
        color 0.22s ease;
}

.legal-cta .button--light {
    background: #fff;
    color: var(--legal-wine);
}

.legal-cta .button--outline-light {
    border-color: rgba(255, 255, 255, 0.45);
    background: transparent;
    color: #fff;
}

.legal-cta .button:hover {
    transform: translateY(-2px);
}

.legal-cta .button--light:hover {
    background: #f7efe7;
}

.legal-cta .button--outline-light:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* =========================================================
   BACK TO TOP
========================================================= */

.back-to-top {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: var(--legal-wine);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 14px 34px rgba(47, 34, 28, 0.22);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px);
    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.25s ease,
        background-color 0.25s ease,
        box-shadow 0.25s ease;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--legal-heading);
    transform: translateY(-3px);
    box-shadow: 0 18px 38px rgba(47, 34, 28, 0.28);
}

.back-to-top:focus-visible {
    outline: 3px solid rgba(198, 145, 94, 0.55);
    outline-offset: 4px;
}

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

@media (max-width: 1000px) {
    :root {
        --legal-header-offset: 105px;
    }

    .legal-layout {
        grid-template-columns: 1fr;
        gap: 42px;
    }

    .legal-sidebar,
    .legal-layout > .legal-navigation {
        position: relative;
        top: auto;
        max-height: none;
    }

    .legal-sidebar .legal-navigation,
    .legal-layout > aside.legal-navigation {
        overflow: visible;
    }

    .legal-navigation {
        padding: 22px;
    }

    .legal-navigation > nav,
    .legal-navigation:not(:has(> nav)) {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px 18px;
    }

    .legal-content {
        max-width: none;
    }

    .legal-related-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .legal-cta {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .legal-cta-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .legal-cta .button {
        flex: 1 1 220px;
    }
}

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

@media (max-width: 700px) {
    :root {
        --legal-header-offset: 92px;
    }

    .legal-hero {
        padding: 58px 0 44px;
    }

    .legal-hero h1 {
        font-size: clamp(2.35rem, 12vw, 3.4rem);
    }

    .legal-hero-text,
    .legal-hero-description {
        font-size: 0.98rem;
        line-height: 1.72;
    }

    .legal-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .legal-meta-divider {
        display: none;
    }

    .legal-section,
    .legal-page {
        padding: 54px 0;
    }

    .legal-navigation {
        padding: 20px;
        border-radius: 16px;
    }

    .legal-navigation > nav,
    .legal-navigation:not(:has(> nav)) {
        grid-template-columns: 1fr;
    }

    .legal-navigation a {
        font-size: 0.84rem;
    }

    .legal-introduction {
        margin-bottom: 44px;
        padding: 24px;
    }

    .legal-block {
        margin-bottom: 48px;
    }

    .legal-block p,
    .legal-block ul,
    .legal-block ol {
        font-size: 0.9rem;
    }

    .legal-notice {
        flex-direction: column;
        padding: 20px;
    }

    .legal-contact-card {
        padding: 20px;
    }

    .legal-contact-item {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 12px;
    }

    .legal-contact-icon {
        width: 38px;
        height: 38px;
    }

    .legal-related {
        padding-top: 40px;
    }

    .legal-related-links {
        grid-template-columns: 1fr;
    }

    .legal-related-links a {
        min-height: 76px;
    }

    .legal-cta-section {
        padding-bottom: 64px;
    }

    .legal-cta {
        gap: 24px;
        padding: 30px 24px;
        border-radius: 22px;
    }

    .legal-cta-actions {
        flex-direction: column;
    }

    .legal-cta .button {
        width: 100%;
    }

    .back-to-top {
        right: 18px;
        bottom: 18px;
        width: 44px;
        height: 44px;
    }
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .reading-progress__bar,
    .legal-navigation a,
    .legal-navigation a::before,
    .legal-related-links a,
    .legal-related-links a i,
    .legal-cta .button,
    .back-to-top {
        transition: none;
    }
}