/* ========================================
   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 {
    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;
}

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

.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;
}

/* Products wrap (relative parent for dropdown) */
.ph-products-wrap {
    position: relative;
    flex-shrink: 0;
}

/* Drawer close button — hidden on desktop */
.ph-drawer-close {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--color-heading);
    position: absolute;
    top: 12px;
    right: 12px;
    border-radius: var(--radius-sm);
}

.ph-drawer-close:hover {
    color: var(--color-accent);
}

/* Drawer backdrop — hidden by default */
.ph-drawer-backdrop {
    display: none;
}

/* Products dropdown — narrow scrollable list */
.ph-dropdown-products {
    min-width: 280px;
    max-height: 460px;
    left: 0;
}

/* Products trigger button */
.ph-products-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--color-bg);
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-md);
    padding: 12px 28px;
    min-width: 220px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
    flex-shrink: 0;
}

.ph-products-trigger:hover,
.ph-products-trigger[aria-expanded="true"] {
    background: var(--color-bg-soft);
}

.ph-products-icon {
    display: inline-flex;
    align-items: center;
}

.ph-products-icon img {
    display: block;
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* Search bar */
.ph-search {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--color-bg-muted);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 0 4px 0 12px;
    transition: border-color 0.15s ease, background 0.15s ease;
    max-width: none;
}

.ph-search:focus-within {
    background: var(--color-bg);
    border-color: var(--color-accent);
}

.ph-search-submit {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--color-body);
    display: inline-flex;
    align-items: center;
}

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

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

/* Phone block (full — desktop) */
.ph-phone {
    font-size: 12px;
    line-height: 1.5;
    color: var(--color-body);
    text-align: left;
    white-space: nowrap;
    margin-left: auto;
    flex-shrink: 0;
}

.ph-phone-main {
    font-size: 14px;
}

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

.ph-phone-main a,
.ph-phone-main a strong {
    text-decoration: none;
    color: inherit;
}

.ph-phone-main a:hover strong {
    color: var(--color-accent);
}

/* 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; }

    /* Compact products trigger — icon only */
    .ph-products-trigger {
        min-width: auto;
        padding: 10px 14px;
        flex-shrink: 0;
    }
    .ph-products-trigger span:not(.ph-products-icon) {
        display: none;
    }
    .ph-products-trigger .ph-products-icon {
        margin: 0;
    }

    /* Search input — bigger on mobile/tablet */
    .ph-search {
        flex: 1 1 auto;
        min-width: 0;
    }
    .ph-search-input {
        padding: 12px 8px;
    }

    /* Products dropdown → off-canvas LEFT sidebar */
    .ph-dropdown-products {
        position: fixed;
        top: 0;
        left: 0;
        right: auto;
        bottom: 0;
        width: 85vw;
        max-width: 340px;
        max-height: none;
        height: 100vh;
        border: none;
        border-right: 1px solid var(--color-border);
        border-radius: 0;
        box-shadow: 4px 0 16px rgba(15, 23, 42, 0.12);
        padding: 0;
        transform: translateX(-100%);
        opacity: 1;
        visibility: hidden;
        transition: transform 0.25s ease, visibility 0.25s ease;
        z-index: 9999;
        overflow-y: auto;
    }

    .ph-has-hover.is-open > .ph-dropdown-products,
    .ph-has-dropdown.is-open > .ph-dropdown-products {
        transform: translateX(0);
        visibility: visible;
    }

    /* Disable hover-open on mobile (use click only) */
    .ph-has-hover:hover > .ph-dropdown-products {
        transform: translateX(-100%);
        visibility: hidden;
    }
    .ph-has-hover.is-open:hover > .ph-dropdown-products {
        transform: translateX(0);
        visibility: visible;
    }

    /* Sidebar header */
    .ph-products-list {
        padding: 8px 0;
    }
    .ph-products-list::before {
        content: "Categories";
        display: block;
        padding: 18px 20px;
        font-size: 16px;
        font-weight: 700;
        color: var(--color-heading);
        border-bottom: 1px solid var(--color-border);
        margin-bottom: 8px;
    }
    .ph-products-list li a {
        padding: 12px 20px;
        font-size: 15px;
    }

    /* Show close button inside drawer */
    .ph-drawer-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Backdrop */
    .ph-drawer-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.4);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }
    .ph-drawer-backdrop.is-visible {
        opacity: 1;
        visibility: visible;
    }

    /* Lock body scroll when drawer is open */
    body.ph-drawer-open {
        overflow: hidden;
    }
}

@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;
    }
}