/* Services hub — all-in-one tabbed cockpit, mesh-visible glass */

.p4p-page--services {
    background: transparent !important;
}

.p4p-page--services .p4p-services-main__inner {
    background: transparent;
}

.p4p-page--services .p4p-hero-v5 {
    min-height: auto;
    padding-top: calc(var(--p4p-header) + clamp(2.5rem, 8vh, 4rem));
    padding-bottom: clamp(0.75rem, 2vh, 1.5rem);
}

.p4p-page--services .p4p-hero-v5__frame {
    max-width: 820px;
    margin: 0 auto;
}

.p4p-page--services .p4p-page-mesh {
    opacity: 1 !important;
    filter: brightness(1.2) contrast(1.08) saturate(1.12) !important;
    mix-blend-mode: screen;
}

/* Ambient orbs inside cockpit */
.p4p-svc-cockpit__ambient {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.p4p-svc-cockpit__ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    mix-blend-mode: screen;
    opacity: 0.5;
    animation: p4pSvcLightDrift 14s ease-in-out infinite alternate;
}

.p4p-svc-cockpit__ambient-orb--1 { width: 340px; height: 340px; top: -10%; left: -6%; background: rgba(232, 168, 124, 0.22); }
.p4p-svc-cockpit__ambient-orb--2 { width: 300px; height: 300px; top: 18%; right: -10%; background: rgba(167, 139, 250, 0.2); animation-delay: -5s; }
.p4p-svc-cockpit__ambient-orb--3 { width: 220px; height: 220px; bottom: 0; left: 38%; background: rgba(134, 239, 172, 0.14); animation-delay: -9s; }

.p4p-svc-cockpit__lights { display: none; }

.p4p-svc-cockpit {
    position: relative;
    z-index: 5;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 clamp(0.75rem, 3vw, 1.5rem) clamp(2rem, 5vh, 3.5rem);
    min-height: min(88svh, 880px);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.p4p-page--services .p4p-service-showcase { display: none; }

@keyframes p4pSvcLightDrift {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(3vw, -2vh) scale(1.08); }
}

/* Filter tabs */
.p4p-svc-cockpit__head {
    position: relative;
    z-index: 2;
}

.p4p-svc-cockpit__filters {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem;
    border-radius: 14px;
    background: rgba(4, 4, 10, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    max-width: 960px;
    margin: 0 auto;
}

.p4p-svc-cockpit__filter-glide {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(232, 168, 124, 0.95), rgba(240, 196, 160, 0.9));
    box-shadow: 0 0 28px rgba(232, 168, 124, 0.35);
    transition: transform 0.45s cubic-bezier(0.19, 1, 0.22, 1), width 0.35s ease;
    pointer-events: none;
    z-index: 0;
}

.p4p-svc-cockpit__filter {
    position: relative;
    z-index: 1;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.58);
    font-family: var(--p4p-font-tech, monospace);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: color 0.25s;
}

.p4p-svc-cockpit__filter:hover { color: #fff; }

.p4p-svc-cockpit__filter.is-active {
    color: #0a0a0e;
}

.p4p-svc-cockpit__hot {
    position: absolute;
    top: -0.45rem;
    right: -0.25rem;
    font-size: 0.48rem;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    background: #86efac;
    color: #000;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

/* Stage — single viewport panel */
.p4p-svc-cockpit__stage {
    position: relative;
    flex: 1 1 auto;
    min-height: min(68svh, 620px);
    z-index: 1;
}

.p4p-svc-cockpit__panel {
    position: absolute;
    inset: 0;
    padding: clamp(1rem, 2.5vw, 1.5rem);
    border-radius: 22px;
    background: rgba(6, 6, 14, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.55s cubic-bezier(0.19, 1, 0.22, 1), transform 0.55s cubic-bezier(0.19, 1, 0.22, 1);
}

.p4p-svc-cockpit__panel.is-active {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    position: relative;
}

.p4p-svc-cockpit__panel[hidden] {
    display: block !important;
}

.p4p-svc-cockpit__panel:not(.is-active) {
    visibility: hidden;
    position: absolute;
}

.p4p-svc-cockpit__popular {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 3;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(134, 239, 172, 0.25), rgba(232, 168, 124, 0.2));
    border: 1px solid rgba(134, 239, 172, 0.45);
    color: #ecfdf5;
    box-shadow: 0 0 20px rgba(134, 239, 172, 0.2);
}

.p4p-svc-cockpit__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: clamp(1rem, 3vw, 2rem);
    align-items: center;
    height: 100%;
    min-height: min(60svh, 520px);
}

/* 3D visual box */
.p4p-svc-cockpit__visual-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    perspective: 900px;
}

.p4p-svc-cockpit__visual {
    position: relative;
    width: min(100%, 420px);
    height: min(100%, 440px);
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform-style: preserve-3d;
    transition: transform 0.4s ease-out, box-shadow 0.4s;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.p4p-svc-cockpit__visual-flare {
    position: absolute;
    inset: -15%;
    background: radial-gradient(circle at 50% 30%, rgba(232, 168, 124, 0.22) 0%, transparent 55%);
    mix-blend-mode: screen;
    pointer-events: none;
}

.p4p-svc-cockpit__visual-art {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    z-index: 1;
}

.p4p-svc-cockpit__visual-art svg {
    width: min(92%, 300px);
    height: auto;
    filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.55));
}

.p4p-svc-cockpit__body {
    position: relative;
    z-index: 2;
}

.p4p-svc-cockpit__body .p4p-section-title {
    font-size: clamp(1.35rem, 2.8vw, 2rem);
    margin-bottom: 0.65rem;
    color: #fff;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
}

.p4p-svc-cockpit__lead {
    color: #e2e8f0;
    font-size: 0.95rem;
    line-height: 1.65;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.p4p-svc-cockpit__features li {
    color: #f1f5f9;
}

.p4p-svc-cockpit__panel.is-enter-left { animation: p4pSvcEnterLeft 0.55s cubic-bezier(0.19, 1, 0.22, 1); }
.p4p-svc-cockpit__panel.is-enter-right { animation: p4pSvcEnterRight 0.55s cubic-bezier(0.19, 1, 0.22, 1); }

@keyframes p4pSvcEnterLeft {
    from { opacity: 0; transform: translateX(-28px) scale(0.98); }
    to { opacity: 1; transform: none; }
}
@keyframes p4pSvcEnterRight {
    from { opacity: 0; transform: translateX(28px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

/* Detail toolbar */
.p4p-svc-detail__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.p4p-svc-detail__back {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.25s, background 0.25s;
}

.p4p-svc-detail__back:hover {
    border-color: rgba(232, 168, 124, 0.4);
    background: rgba(232, 168, 124, 0.08);
    color: #fff;
}

.p4p-svc-detail__stepper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.p4p-svc-detail__step {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(4, 4, 10, 0.5);
    color: #fff;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.25s, transform 0.25s;
}

.p4p-svc-detail__step:hover {
    border-color: rgba(167, 139, 250, 0.45);
    transform: translateY(-2px);
}

.p4p-svc-detail__counter {
    font-family: var(--p4p-font-tech, monospace);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.55);
    min-width: 4.5rem;
    text-align: center;
}

/* ═══ NEXUS GRID ═══ */
.p4p-svc-nexus {
    position: relative;
    z-index: 1;
}

.p4p-svc-nexus__spotlight {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s;
    background: radial-gradient(circle 280px at var(--nx-x, 50%) var(--nx-y, 50%), rgba(167, 139, 250, 0.12), transparent 65%);
    z-index: 0;
}

.p4p-svc-nexus__head {
    text-align: center;
    margin-bottom: 1.25rem;
    position: relative;
    z-index: 1;
}

.p4p-svc-nexus__eyebrow {
    font-family: var(--p4p-font-tech, monospace);
    font-size: 0.62rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(232, 168, 124, 0.88);
    margin: 0 0 0.5rem;
}

.p4p-svc-nexus__title {
    margin: 0 0 0.45rem;
    font-size: clamp(1.15rem, 2.2vw, 1.55rem);
    color: #fff;
}

.p4p-svc-nexus__lead {
    margin: 0 auto;
    max-width: 560px;
    color: #cbd5e1;
    font-size: 0.88rem;
    line-height: 1.6;
}

.p4p-svc-nexus__grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(108px, auto);
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.p4p-svc-nexus__cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.2rem;
    padding: 1rem 1.05rem 1.1rem;
    min-height: 120px;
    border: none;
    border-radius: 18px;
    background: rgba(6, 6, 14, 0.62);
    color: inherit;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    transform: perspective(800px) rotateX(var(--cell-tilt-x, 0deg)) rotateY(var(--cell-tilt-y, 0deg));
    transition: transform 0.35s ease-out, box-shadow 0.35s;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.p4p-svc-nexus__cell--featured { grid-column: 1 / 8; grid-row: 1 / 3; min-height: 260px; padding: 1.25rem 1.35rem 1.35rem; }
.p4p-svc-nexus__cell--east-top { grid-column: 8 / 13; grid-row: 1; }
.p4p-svc-nexus__cell--east-mid { grid-column: 8 / 13; grid-row: 2; }
.p4p-svc-nexus__cell--west-bot { grid-column: 1 / 5; grid-row: 3; }
.p4p-svc-nexus__cell--wide-bot { grid-column: 5 / 13; grid-row: 3; min-height: 130px; }

.p4p-svc-nexus__cell-border {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, var(--nx-accent, #e8a87c), transparent 55%, rgba(167, 139, 250, 0.4));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.35s;
}

.p4p-svc-nexus__cell-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.06) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.p4p-svc-nexus__cell:hover .p4p-svc-nexus__cell-shine { transform: translateX(120%); }
.p4p-svc-nexus__cell:hover .p4p-svc-nexus__cell-border { opacity: 1; }
.p4p-svc-nexus__cell:hover { box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45), 0 0 32px var(--nx-glow, rgba(232, 168, 124, 0.15)); }

.p4p-svc-nexus__cell--mint { --nx-accent: #86efac; --nx-glow: rgba(134, 239, 172, 0.2); }
.p4p-svc-nexus__cell--warm { --nx-accent: #e8a87c; --nx-glow: rgba(232, 168, 124, 0.2); }
.p4p-svc-nexus__cell--violet { --nx-accent: #a78bfa; --nx-glow: rgba(167, 139, 250, 0.2); }
.p4p-svc-nexus__cell--cyan { --nx-accent: #22d3ee; --nx-glow: rgba(34, 211, 238, 0.18); }

.p4p-svc-nexus__art {
    position: absolute;
    top: 0.65rem;
    right: 0.5rem;
    width: 42%;
    max-width: 140px;
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 0.35s, transform 0.35s;
}

.p4p-svc-nexus__cell--featured .p4p-svc-nexus__art {
    width: 48%;
    max-width: 200px;
    top: 1rem;
    right: 0.75rem;
    opacity: 0.45;
}

.p4p-svc-nexus__cell:hover .p4p-svc-nexus__art { opacity: 0.65; transform: scale(1.05) translateY(-4px); }
.p4p-svc-nexus__art svg { width: 100%; height: auto; filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.5)); }

.p4p-svc-nexus__num {
    font-family: var(--p4p-font-tech, monospace);
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    color: rgba(255, 255, 255, 0.4);
    position: relative;
    z-index: 1;
}

.p4p-svc-nexus__flag {
    position: absolute;
    top: 0.65rem;
    left: 0.75rem;
    font-size: 0.48rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: #86efac;
    color: #000;
    z-index: 2;
}

.p4p-svc-nexus__tag {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--nx-accent, #e8a87c);
    position: relative;
    z-index: 1;
}

.p4p-svc-nexus__name {
    font-size: clamp(0.92rem, 1.4vw, 1.12rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.25;
    max-width: 72%;
    position: relative;
    z-index: 1;
}

.p4p-svc-nexus__cell--featured .p4p-svc-nexus__name { font-size: clamp(1.05rem, 2vw, 1.45rem); max-width: 58%; }

.p4p-svc-nexus__kicker {
    font-size: 0.68rem;
    color: #94a3b8;
    position: relative;
    z-index: 1;
}

.p4p-svc-nexus__meta {
    font-family: var(--p4p-font-tech, monospace);
    font-size: 0.58rem;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.38);
    position: relative;
    z-index: 1;
}

.p4p-svc-nexus__open {
    margin-top: 0.35rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--nx-accent, #e8a87c);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s, transform 0.3s;
    position: relative;
    z-index: 1;
}

.p4p-svc-nexus__cell:hover .p4p-svc-nexus__open { opacity: 1; transform: none; }

.p4p-svc-nexus__hint {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.38);
}

.p4p-svc-nexus__cell.is-active {
    box-shadow: 0 0 0 1px var(--nx-accent), 0 0 32px var(--nx-glow);
}

.p4p-svc-cockpit__features {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.p4p-svc-cockpit__features li {
    font-size: 0.88rem;
    color: #e2e8f0;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    line-height: 1.5;
}

.p4p-svc-cockpit__check {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 0.15rem;
    border-radius: 50%;
    background: rgba(134, 239, 172, 0.15);
    border: 1px solid rgba(134, 239, 172, 0.5);
    position: relative;
}

.p4p-svc-cockpit__check::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 3px;
    width: 4px;
    height: 7px;
    border: solid #86efac;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.p4p-svc-cockpit__chips {
    margin-bottom: 1.15rem;
}

/* Bottom rail */
.p4p-svc-cockpit__rail {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.p4p-svc-cockpit__rail-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    min-width: 64px;
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(4, 4, 10, 0.45);
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s, transform 0.3s;
    font-family: inherit;
}

.p4p-svc-cockpit__rail-btn:hover {
    border-color: rgba(232, 168, 124, 0.35);
    transform: translateY(-2px);
}

.p4p-svc-cockpit__rail-btn.is-active {
    border-color: rgba(232, 168, 124, 0.5);
    background: rgba(232, 168, 124, 0.12);
    color: #fff;
}

.p4p-svc-cockpit__rail-num {
    font-size: 0.72rem;
    font-weight: 900;
    color: var(--p4p-accent, #e8a87c);
}

.p4p-svc-cockpit__rail-label {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.p4p-page--services .p4p-dental-packages {
    background: rgba(4, 4, 10, 0.35);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
}

@media (max-width: 900px) {
    .p4p-svc-nexus__grid {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: auto;
    }
    .p4p-svc-nexus__cell--featured,
    .p4p-svc-nexus__cell--east-top,
    .p4p-svc-nexus__cell--east-mid,
    .p4p-svc-nexus__cell--west-bot,
    .p4p-svc-nexus__cell--wide-bot {
        grid-column: span 1;
        grid-row: auto;
        min-height: 140px;
    }
    .p4p-svc-nexus__cell--featured { grid-column: 1 / -1; min-height: 200px; }
    .p4p-svc-nexus__cell--wide-bot { grid-column: 1 / -1; }
    .p4p-svc-cockpit {
        min-height: auto;
    }
    .p4p-svc-cockpit__grid {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .p4p-svc-cockpit__visual {
        min-height: 220px;
        height: auto;
    }
    .p4p-svc-cockpit__stage {
        min-height: auto;
    }
    .p4p-svc-cockpit__filters {
        border-radius: 16px;
    }
}

html.p4p-reduced-motion .p4p-svc-cockpit__panel {
    transition: none;
}
