/*------------------------
 * ------- PAGE 404 -------
 *-------------------------*/
body#pagenotfound,
body#404 {
    --cex-404-accent: #0091c8;
    --cex-404-accent-soft: rgba(0, 145, 200, 0.12);
    --cex-404-ink: #1a2330;
    --cex-404-muted: #5c6775;
    --cex-404-surface: #f3f7fa;
    --cex-404-border: rgba(0, 145, 200, 0.16);
    --cex-404-line: rgba(26, 35, 48, 0.1);
}

body#pagenotfound #wrapper,
body#404 #wrapper {
    background: #fff;
}

body#pagenotfound #content-wrapper,
body#404 #content-wrapper {
    padding-top: 0;
}

.cex-404 {
    padding: 0 0 3.5rem;
}

.cex-404__shell {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.cex-404__hero {
    margin: 0 0 1.75rem;
    padding: 1.75rem 0 0;
    animation: cex-404-rise 0.65s ease-out both;
}

@keyframes cex-404-rise {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cex-404__hero-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    background: #fff;
    border: 1px solid var(--cex-404-border);
    border-radius: 24px;
    box-shadow: 0 18px 48px rgba(26, 35, 48, 0.07);
}

.cex-404__hero-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--cex-404-accent), #5ec4e8 55%, transparent);
}

.cex-404__code {
    position: absolute;
    top: -0.15em;
    right: 0.05em;
    margin: 0;
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-size: clamp(5rem, 16vw, 9rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: transparent;
    background: linear-gradient(160deg, rgba(0, 145, 200, 0.14), rgba(217, 226, 234, 0.35));
    -webkit-background-clip: text;
    background-clip: text;
    pointer-events: none;
    user-select: none;
}

.cex-404__hero-copy {
    position: relative;
    width: 100%;
}

.cex-404__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.75rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--cex-404-accent);
    background: var(--cex-404-accent-soft);
    border-radius: 999px;
}

.cex-404__eyebrow::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cex-404-accent);
}

.cex-404__title {
    margin: 0 0 0.85rem;
    font-size: clamp(1.85rem, 4.2vw, 2.65rem);
    font-weight: 800;
    line-height: 1.08;
    color: var(--cex-404-ink);
    border: 0;
    padding: 0;
}

.cex-404__lead {
    margin: 0 0 1.35rem;
    max-width: 38rem;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--cex-404-muted);
}

.cex-404__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.cex-404__actions .btn {
    border-radius: 999px;
    padding: 0.65rem 1.25rem;
    font-weight: 700;
}

/* Recherche dans le hero, sous les boutons */
.cex-404__search-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 1.1rem 1.25rem;
    background: var(--cex-404-surface);
    border: 1px solid var(--cex-404-border);
    border-radius: 16px;
    animation: cex-404-rise 0.65s ease-out 0.08s both;
}

.cex-404__search-label {
    margin: 0 0 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cex-404-muted);
}

.cex-404__search-panel .search-widget {
    max-width: 100%;
    width: 100%;
    margin: 0;
}

.cex-404__search-panel .search-widget form {
    position: relative;
    width: 100%;
}

.cex-404__search-panel .search-widget .input-group {
    position: relative;
    width: 100%;
}

.cex-404__search-panel .search-widget input[type="text"],
.cex-404__search-panel .search-widget input[type="search"],
.cex-404__search-panel .search-widget .form-search-control {
    flex: 1;
    width: 100%;
    min-height: 52px;
    padding: 0.7rem 1.1rem 0.7rem 3rem;
    border: 1px solid rgba(26, 35, 48, 0.12);
    border-radius: 12px;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(26, 35, 48, 0.04);
}

.cex-404__search-panel .search-widget input:focus {
    border-color: var(--cex-404-accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--cex-404-accent-soft);
}

.cex-404__search-panel .search-widget .search-btn,
.cex-404__search-panel .search-widget button[type="submit"] {
    position: absolute;
    left: 0;
    right: auto;
    top: 0;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
    height: 100%;
    padding: 0 0.85rem;
    border: 0;
    background: transparent;
    color: var(--cex-404-muted);
    border-radius: 12px 0 0 12px;
}

/* -------- Catalogue (données méga-menu) -------- */
.cex-404__nav {
    animation: cex-404-rise 0.65s ease-out 0.12s both;
}

.cex-404__nav-box {
    width: 100%;
    padding: clamp(1.35rem, 3vw, 1.85rem);
    background: #fff;
    border: 1px solid var(--cex-404-border);
    border-radius: 24px;
    box-shadow: 0 14px 40px rgba(26, 35, 48, 0.06);
}

.cex-404__nav-title {
    margin: 0 0 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--cex-404-line);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--cex-404-ink);
}

.cex-404-families {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.cex-404-family {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    min-height: 100%;
    padding: 1rem 1.05rem;
    background: #fff;
    border: 1px solid var(--cex-404-border);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(26, 35, 48, 0.05);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    animation: cex-404-rise 0.55s ease-out both;
    animation-delay: var(--cex-404-delay, 0s);
}

.cex-404-family:hover {
    transform: translateY(-3px);
    border-color: var(--cex-404-accent);
    box-shadow: 0 14px 32px rgba(0, 145, 200, 0.12);
}

.cex-404-family__cover {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    overflow: hidden;
    border-radius: 12px;
    background: var(--cex-404-surface);
    border: 1px solid var(--cex-404-line);
}

.cex-404-family__cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cex-404-family__cover--empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cex-404-family__fallback {
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--cex-404-accent);
}

.cex-404-family__body {
    min-width: 0;
    flex: 1;
}

.cex-404-family__name {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0 0.4rem;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--cex-404-ink) !important;
    text-decoration: none !important;
}

.cex-404-family__name:hover {
    color: var(--cex-404-accent) !important;
}

.cex-404-family__name .fa {
    font-size: 0.75rem;
    color: var(--cex-404-accent);
    opacity: 0.7;
}

.cex-404-family__links {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--cex-404-muted);
}

.cex-404-family__links a {
    color: var(--cex-404-muted) !important;
    text-decoration: none !important;
    font-weight: 500;
}

.cex-404-family__links a:hover {
    color: var(--cex-404-accent) !important;
}

.cex-404-family__sep {
    margin: 0 0.25rem;
    color: rgba(92, 103, 117, 0.45);
}

/* Accessoires / Médiators / À découvrir — hauteurs naturelles */
.cex-404-extras {
    display: grid;
    grid-template-columns: 1.1fr 0.95fr 0.85fr 0.85fr;
    gap: 0.85rem;
    align-items: start;
    margin-bottom: 1rem;
}

.cex-404-extra {
    display: block;
    padding: 1.1rem 1.15rem;
    background: #fff;
    border: 1px solid var(--cex-404-border);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(26, 35, 48, 0.05);
}

.cex-404-extra--aside {
    background: var(--cex-404-surface);
}

.cex-404-extra__title {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.75rem;
    padding: 0 0 0.55rem;
    border-bottom: 1px solid var(--cex-404-line);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--cex-404-ink) !important;
    text-decoration: none !important;
}

.cex-404-extra__title:hover {
    color: var(--cex-404-accent) !important;
}

.cex-404-extra__title--static {
    cursor: default;
}

.cex-404-extra__title--static:hover {
    color: var(--cex-404-ink) !important;
}

.cex-404-extra__title .fa {
    font-size: 0.75rem;
    color: var(--cex-404-accent);
}

.cex-404-extra__list {
    list-style: none;
    margin: 0 0 0.65rem;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.15rem 0.75rem;
}

.cex-404-extra__list--compact {
    grid-template-columns: 1fr;
}

.cex-404-extra__list--aside {
    grid-template-columns: 1fr;
    gap: 0.35rem;
}

.cex-404-extra__list a {
    display: block;
    padding: 0.2rem 0;
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--cex-404-muted) !important;
    text-decoration: none !important;
}

.cex-404-extra__list a:hover {
    color: var(--cex-404-accent) !important;
}

.cex-404-extra__list--aside a {
    color: var(--cex-404-ink) !important;
    font-weight: 600;
}

.cex-404-extra__more {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--cex-404-accent) !important;
    text-decoration: none !important;
}

.cex-404-extra__more:hover {
    text-decoration: underline !important;
}

.cex-404__all-strings {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.25rem;
    padding: 0.55rem 1rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--cex-404-accent) !important;
    text-decoration: none !important;
    background: var(--cex-404-accent-soft);
    border-radius: 999px;
    transition: background 0.18s ease;
}

.cex-404__all-strings:hover {
    background: rgba(0, 145, 200, 0.2);
}

/* Hook Elementor optionnel */
.cex-404__builder:empty {
    display: none;
}

.cex-404__builder .elementor-section {
    max-width: 100%;
    padding: 0 !important;
    background: transparent !important;
}

.cex-404__builder .elementor-column-wrap,
.cex-404__builder .elementor-widget-wrap {
    padding: 0 !important;
}

@media (max-width: 991px) {
    .cex-404__code {
        top: 0;
        right: 0;
        font-size: clamp(4rem, 22vw, 6rem);
    }

    .cex-404-families {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cex-404-extras {
        grid-template-columns: 1fr 1fr;
    }

    .cex-404-extra--aside {
        grid-column: 1 / -1;
    }
}

@media (max-width: 575px) {
    .cex-404__hero-card,
    .cex-404__nav-box {
        border-radius: 18px;
    }

    .cex-404-families,
    .cex-404-extras {
        grid-template-columns: 1fr;
    }

    .cex-404-extra__list {
        grid-template-columns: 1fr;
    }

    .cex-404-family {
        padding: 0.9rem;
    }
}
