/* ========================================
   POINTAI CUSTOM HEADER
   ======================================== */

.ph-header {
    position: relative;
    background: var(--color-bg);
    font-family: var(--font-body);
    z-index: 100;
}

.ph-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

/* ---------- ROW 1: Top row ---------- */
.ph-row-top {
    border-bottom: 1px solid var(--color-border);
}

.ph-row-top .ph-container {
    padding-top: 16px;
    padding-bottom: 16px;
    justify-content: space-between;
}

/* Logo */
.ph-logo {
    flex-shrink: 0;
    max-width: 220px;
}

.ph-logo .custom-logo-link,
.ph-logo .custom-logo-link img,
.ph-logo .custom-logo {
    display: block;
    max-height: 48px;
    width: auto;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

.ph-logo-text {
    text-decoration: none;
    display: inline-flex;
    flex-direction: column;
    line-height: 1;
}

.ph-logo-name {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-heading);
    letter-spacing: -0.02em;
}

.ph-logo-tagline {
    font-size: 11px;
    color: var(--color-body);
    margin-top: 4px;
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* Main nav */
.ph-main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.ph-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ph-nav-item {
    position: relative;
}

.ph-nav-link,
.ph-dropdown-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    color: var(--color-heading);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease;
    box-shadow: none !important;
}

.ph-nav-link::after,
.ph-dropdown-trigger::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 4px;
    height: 2px;
    background: var(--color-accent);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.25s ease;
}

.ph-nav-link:hover::after,
.ph-dropdown-trigger:hover::after,
.ph-dropdown-trigger[aria-expanded="true"]::after,
.ph-has-hover:hover > .ph-dropdown-trigger::after {
    transform: scaleX(1);
}

.ph-nav-link:hover,
.ph-dropdown-trigger:hover,
.ph-dropdown-trigger[aria-expanded="true"] {
    color: var(--color-accent);
    box-shadow: none !important;
}

.ph-caret {
    transition: transform 0.2s ease;
}

.ph-dropdown-trigger[aria-expanded="true"] .ph-caret {
    transform: rotate(180deg);
}

/* Generic dropdown panel (Vendors + Our Products) */
.ph-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 240px;
    max-height: 420px;
    overflow-y: auto;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    z-index: 200;
}

/* Click-toggled (mobile + JS click) */
.ph-has-dropdown.is-open > .ph-dropdown,
.ph-has-hover.is-open > .ph-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Hover-triggered on desktop */
@media (hover: hover) and (min-width: 901px) {
    .ph-has-hover:hover > .ph-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

.ph-vendors-list,
.ph-products-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ph-vendors-list li a,
.ph-products-list li a {
    display: block;
    padding: 9px 18px;
    color: var(--color-body);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    transition: background 0.1s ease, color 0.1s ease;
}

.ph-vendors-list li a:hover,
.ph-products-list li a:hover {
    background: var(--color-bg-soft);
    color: var(--color-accent);
}

/* Custom scrollbar for dropdown panels */
.ph-dropdown::-webkit-scrollbar {
    width: 6px;
}
.ph-dropdown::-webkit-scrollbar-track {
    background: transparent;
}
.ph-dropdown::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}
.ph-dropdown::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.ph-dropdown-empty {
    padding: 12px 16px;
    color: #9CA3AF;
    font-size: 13px;
    font-style: italic;
}

/* Language switcher */
.ph-lang-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--color-body);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease;
}

.ph-lang-trigger:hover {
    color: var(--color-accent);
}

/* ---------- ROW 2: Bottom row ---------- */
.ph-row-bottom .ph-container {
    padding-top: 14px;
    padding-bottom: 14px;
}

/* Search bar (integrated category + input + submit) */
.ph-search {
    flex: 1;
    display: flex;
    align-items: stretch;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 4px;
    padding-left: 4px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    max-width: none;
    position: relative;
}
input.ph-search-input {
    border: none !important;
}
.ph-search:focus-within {
    border-color: var(--color-accent);
}

/* Category pill (left side of search) */
.ph-search-cat {
    position: relative;
    flex-shrink: 0;
}

.ph-search-cat-trigger,
.ph-search-cat-trigger:hover,
.ph-search-cat-trigger:focus,
.ph-search-cat-trigger:active,
.ph-search-cat-trigger:visited,
.ph-search-cat-trigger[aria-expanded="true"] {
    color: #fff !important;
    -webkit-tap-highlight-color: transparent;
}

.ph-search-cat-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    min-width: 110px;
    padding: 0 16px;
    background: var(--color-accent);
    border: none;
    border-radius: 999px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
    outline: none;
}

.ph-search-cat-trigger:hover,
.ph-search-cat-trigger:focus,
.ph-search-cat-trigger:active,
.ph-search-cat-trigger[aria-expanded="true"] {
    background: #0052cc;
}

.ph-search-cat-trigger .ph-caret {
    transition: transform 0.2s ease;
}

.ph-search-cat-trigger[aria-expanded="true"] .ph-caret {
    transform: rotate(180deg);
}

.ph-search-cat-list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 240px;
    max-height: 420px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 8px 0;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    z-index: 200;
}

.ph-search-cat.is-open .ph-search-cat-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ph-search-cat-list li {
    padding: 10px 18px;
    color: var(--color-heading);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.1s ease, color 0.1s ease;
}

.ph-search-cat-list li:hover {
    background: var(--color-bg-soft);
    color: var(--color-accent);
}

.ph-search-cat-list li.is-selected {
    background: var(--color-bg-soft);
    color: var(--color-accent);
    font-weight: 600;
}

.ph-search-cat-list::-webkit-scrollbar {
    width: 6px;
}
.ph-search-cat-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

/* Search input */
.ph-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 14px;
    color: var(--color-body);
    background: transparent;
}

.ph-search-input::placeholder {
    color: #9CA3AF;
}

/* Submit button (right side of search) */
.ph-search-submit,
.ph-search-submit:hover,
.ph-search-submit:focus,
.ph-search-submit:active,
.ph-search-submit:visited {
    color: #fff !important;
    -webkit-tap-highlight-color: transparent;
}

.ph-search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent);
    border: none;
    cursor: pointer;
    padding: 0 16px;
    border-radius: 999px;
    min-width: 48px;
    transition: background 0.15s ease;
    flex-shrink: 0;
    outline: none;
}

.ph-search-submit:hover,
.ph-search-submit:focus,
.ph-search-submit:active {
    background: #0052cc;
}

.ph-search-submit svg {
    stroke: #fff;
}

/* Phone (single number — desktop) */
.ph-phone {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--color-bg-soft);
    color: var(--color-accent);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    margin-left: auto;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.ph-phone:hover {
    background: #e5e0fb;
}

.ph-phone strong {
    color: var(--color-accent);
    font-weight: 600;
}

.ph-phone svg {
    flex-shrink: 0;
}

/* Phone compact (tablet & mobile — tap to call) */
.ph-phone-compact {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--color-bg-soft);
    color: var(--color-accent);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.ph-phone-compact:hover {
    background: #e5e0fb;
}

.ph-phone-compact svg {
    flex-shrink: 0;
}

/* Account */
.ph-account a {
    width: 40px;
    height: 40px;
    background: var(--color-accent);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.15s ease;
}

.ph-account a:hover {
    background: #0052cc;
}


/* ---------- Responsive ---------- */

/* Smaller desktop & tablet — swap full phone for compact tap-to-call */
@media (max-width: 1100px) {
    .ph-phone {
        display: none;
    }
    .ph-phone-compact {
        display: inline-flex;
    }
}


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

.ph-mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--color-heading);
    border-radius: var(--radius-sm);
    transition: color 0.15s ease;
}

.ph-mobile-toggle:hover {
    color: var(--color-accent);
}

.ph-mobile-toggle .ph-icon-close {
    display: none;
}

.ph-mobile-toggle[aria-expanded="true"] .ph-icon-open {
    display: none;
}

.ph-mobile-toggle[aria-expanded="true"] .ph-icon-close {
    display: inline-block;
}

/* Override the existing media query for nav */
@media (max-width: 900px) {
    .ph-mobile-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .ph-main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-bg);
        border-top: 1px solid var(--color-border);
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-md);
        padding: 12px 0;
        z-index: 150;
    }

    .ph-main-nav.is-open {
        display: block;
    }

    .ph-nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .ph-nav-item {
        width: 100%;
    }

    .ph-nav-link,
    .ph-dropdown-trigger {
        width: 100%;
        justify-content: space-between;
        padding: 12px 24px;
        border-radius: 0;
    }

    .ph-nav-link:hover,
    .ph-dropdown-trigger:hover {
        background: var(--color-bg-soft);
    }

    /* Dropdowns on mobile become inline expandable */
    .ph-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        max-height: 0;
        overflow: hidden;
        padding: 0;
        transition: max-height 0.25s ease;
        background: var(--color-bg-soft);
    }

    .ph-has-dropdown.is-open .ph-dropdown {
        max-height: 60vh;
        overflow-y: auto;
        padding: 4px 0;
    }

    .ph-vendors-list li a {
        padding: 10px 36px;
    }

    /* Language switcher to nav */
    .ph-lang {
        display: none;
    }
}

@media (max-width: 900px) {
    .ph-search-input { font-size: 13px; }
    .ph-search-input::placeholder { font-size: 12px; }

    .ph-search-cat-trigger {
        min-width: 80px;
        padding: 0 12px;
        font-size: 13px;
    }

    .ph-search-input {
        padding: 10px 10px;
    }
}

@keyframes ph-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 600px) {
    .ph-row-top .ph-container {
        gap: 8px;
    }
    .ph-logo {
        max-width: 150px;
    }
    .ph-logo .custom-logo {
        max-height: 36px;
    }
    .ph-container {
        gap: 10px;
        padding: 0 16px;
    }
    .ph-search-input {
        font-size: 14px;
    }
    .ph-search-input::placeholder {
        font-size: 13px;
    }
}

/* Very small phones */
@media (max-width: 480px) {
    .ph-phone-compact-number {
        display: none;
    }
    .ph-phone-compact {
        padding: 8px;
    }
    .ph-container {
        gap: 8px;
        padding: 0 12px;
    }
    .ph-search-input {
        font-size: 13px;
    }
    .ph-search-input::placeholder {
        /* Shorter placeholder via CSS */
        font-size: 12px;
    }
}