/* ============================================
   Product Header — Matches Global Header System
   Same font sizes, padding, colors, spacing
   Only visible on product pages
   ============================================ */

/* --- Hide global header CTAs on product pages --- */
body[data-product-name] .header-actions .btn-cta,
body[data-product-name] .header-actions .nav-sign-in {
    display: none !important;
}

/* --- Global header: in-flow on product pages so it scrolls away --- */
body[data-product-name] .header-wrapper {
    position: relative !important;
}

/* Remove padding-top compensation on product pages */
body[data-product-name] {
    padding-top: 0 !important;
}

/* --- Sticky wrapper: the placeholder itself is the sticky container --- */
#product-header-placeholder {
    position: sticky;
    top: 0;
    z-index: 999;
}

/* --- Bar: normal in-flow inside the sticky wrapper --- */
.ph-bar {
    position: relative;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color, #E5E5E5);
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Shadow appears when stuck (global header scrolled away) */
.ph-bar.ph-scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* --- Inner Container (matches .header-main) --- */
.ph-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 32px;
}

/* ============================================
   LOGO — hidden until sticky
   ============================================ */
.ph-logo {
    height: 26px;
    width: auto;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, max-width 0.3s ease;
    flex-shrink: 0;
    pointer-events: none;
}

/* Reveal logo when sticky */
.ph-bar.ph-scrolled .ph-logo {
    opacity: 1;
    max-width: 120px;
    pointer-events: auto;
    margin-right: 10px;
}

/* --- Product Brand Link (Left) --- */
.ph-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    gap: 0;
}

.ph-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main, #1D1D1F);
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.ph-brand:hover .ph-name {
    color: var(--primary-color, #0030DB);
}

/* --- Separator (desktop) --- */
.ph-sep {
    width: 1px;
    height: 22px;
    background: var(--border-color, #E5E5E5);
    flex-shrink: 0;
}

/* --- Nav Links (matches .nav-link) --- */
.ph-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ph-link {
    text-decoration: none;
    color: var(--text-main, #1D1D1F);
    font-weight: 500;
    font-size: 15px;
    padding: 8px 12px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s ease, background 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.ph-link:hover {
    color: var(--primary-color, #0030DB);
    background: rgba(0, 48, 219, 0.04);
}

.ph-chev {
    font-size: 10px;
    margin-top: 1px;
    transition: transform 0.25s ease;
}

/* --- Features Dropdown --- */
.ph-nav-item {
    position: relative;
}

.ph-dropdown {
    position: absolute;
    top: calc(100% - 2px);
    left: 0;
    min-width: 240px;
    background: #FFFFFF;
    border: 1px solid var(--border-color, #E5E5E5);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
}

.ph-nav-item:hover .ph-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.ph-nav-item:focus-within .ph-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.ph-nav-item:hover .ph-chev {
    transform: rotate(180deg);
}

.ph-nav-item:focus-within .ph-chev {
    transform: rotate(180deg);
}

.ph-nav-item:hover > .ph-link::after,
.ph-nav-item:focus-within > .ph-link::after {
    content: '';
    position: absolute;
    top: 100%;
    left: -10px;
    right: -10px;
    height: 16px;
}

.ph-dropdown-link {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main, #1D1D1F);
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.ph-dropdown-link:hover {
    background: rgba(0, 48, 219, 0.04);
    color: var(--primary-color, #0030DB);
}

/* --- Right: CTA Buttons --- */
.ph-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Book Demo — outline style */
.ph-btn-demo {
    padding: 9px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main, #1D1D1F);
    text-decoration: none;
    border: 1.5px solid var(--border-color, #E5E5E5);
    border-radius: 6px;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ph-btn-demo:hover {
    border-color: var(--primary-color, #0030DB);
    color: var(--primary-color, #0030DB);
    background: rgba(0, 48, 219, 0.04);
}

/* Sign Up — solid electric blue */
.ph-btn-signup {
    padding: 9px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #FFFFFF;
    text-decoration: none;
    background: var(--primary-color, #0030DB);
    border: none;
    border-radius: 6px;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ph-btn-signup:hover {
    background: #0025A8;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 48, 219, 0.25);
}

/* ============================================
   MOBILE CHEVRON TOGGLE — no hamburger bars
   ============================================ */
.ph-mob-toggle {
    display: none;
    background: none;
    border: 1.5px solid var(--border-color, #E5E5E5);
    border-radius: 6px;
    color: var(--text-main, #1D1D1F);
    font-size: 12px;
    cursor: pointer;
    padding: 6px 10px;
    margin-left: auto;
    transition: border-color 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.ph-mob-toggle:hover {
    border-color: var(--primary-color, #0030DB);
    color: var(--primary-color, #0030DB);
}

/* Chevron rotates when open */
.ph-mob-chev-icon {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
}

.ph-mob-toggle[aria-expanded="true"] .ph-mob-chev-icon {
    transform: rotate(180deg);
}

/* ============================================
   MOBILE DROPDOWN PANEL — mirrors global header
   ============================================ */
.ph-mob-menu {
    display: none;
    background: #FFFFFF;
    border-top: 1px solid #F0F0F0;
    animation: phMenuSlide 0.2s ease forwards;
}

@keyframes phMenuSlide {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ph-mob-menu.active {
    display: block;
}

/* Nav list */
.ph-mob-list {
    list-style: none;
    padding: 6px 0 0;
    margin: 0;
}

.ph-mob-item {
    border-bottom: 1px solid #F5F5F7;
}

.ph-mob-item:last-child {
    border-bottom: none;
}

/* Nav rows — matches .mobile-nav-link exactly */
.ph-mob-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    text-decoration: none;
    color: #1D1D1F;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
    width: 100%;
}

.ph-mob-link:hover {
    color: var(--primary-color, #0030DB);
    background: rgba(0, 48, 219, 0.03);
}

/* Bottom CTA footer — matches .mobile-nav-footer */
.ph-mob-footer {
    padding: 16px 20px 24px;
    border-top: 1px solid #F0F0F0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #FFFFFF;
}

/* Sign Up Free — matches .mobile-cta-primary */
.ph-mob-cta-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0030DB;
    color: #FFFFFF;
    text-align: center;
    padding: 14px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.ph-mob-cta-primary:hover {
    background: #0025A8;
    transform: translateY(-1px);
}

/* Book Demo — matches .mobile-cta-secondary */
.ph-mob-cta-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #E5E5E5;
    color: #1D1D1F;
    text-align: center;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.ph-mob-cta-secondary:hover {
    border-color: var(--primary-color, #0030DB);
    color: var(--primary-color, #0030DB);
}

/* ============================================
   RESPONSIVE — Tablet (≤ 900px)
   ============================================ */
@media (max-width: 900px) {
    .ph-inner {
        gap: 20px;
    }

    .ph-btn-demo {
        display: none;
    }
}

/* ============================================
   RESPONSIVE — Mobile (≤ 768px)
   ============================================ */
@media (max-width: 768px) {
    .ph-inner {
        padding: 0 20px;
        gap: 0;
    }

    /* Hide desktop nav & actions */
    .ph-sep,
    .ph-nav,
    .ph-actions {
        display: none;
    }

    /* Show chevron toggle */
    .ph-mob-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Logo still shows when sticky on mobile */
    .ph-bar.ph-scrolled .ph-logo {
        margin-right: 6px;
    }
}

/* ============================================
   RESPONSIVE — Small mobile (≤ 480px)
   ============================================ */
@media (max-width: 480px) {
    .ph-inner {
        padding: 0 16px;
        height: 50px;
    }

    .ph-name {
        font-size: 15px;
    }

    .ph-logo {
        height: 22px;
    }

    .ph-mob-menu {
        padding: 8px 16px 14px;
    }

    .ph-mob-ctas {
        flex-direction: column;
    }
}
