/* ══ POPTIDES HEADER SEARCH DRAWER ══════════════════════════════
   Scoped under .pp-search-* and .ph-search-* to avoid conflicts.
   Loaded globally via functions.php on all pages.
   ═══════════════════════════════════════════════════════════════ */

/* Search icon button in the navbar */
.ph-search-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0.85;
    transition: opacity 0.15s;
    line-height: 1;
    font-size: 0; /* hide any text fallback */
}
.ph-search-btn:hover {
    opacity: 1;
}
.ph-search-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}

/* Overlay backdrop */
.pp-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 17, 23, 0.7);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.pp-search-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* Drawer panel */
.pp-search-drawer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    display: none;
    transform: translateY(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    max-height: 90vh;
    overflow-y: auto;
}
.pp-search-drawer.open {
    display: block;
    transform: translateY(0);
}

/* Drawer inner */
.pp-search-drawer-inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 28px 24px 24px;
}

/* Input row */
.pp-search-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid #e8e4df;
    border-radius: 10px;
    padding: 0 14px;
    background: #faf9f7;
    transition: border-color 0.15s;
    margin-bottom: 20px;
}
.pp-search-input-row:focus-within {
    border-color: #e8714a;
    background: #fff;
}
.pp-search-input-row svg {
    width: 18px;
    height: 18px;
    stroke: #9a9490;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.pp-search-input {
    flex: 1;
    height: 52px;
    border: none;
    background: none;
    font-size: 17px;
    font-family: 'Inter', -apple-system, sans-serif;
    color: #1a1a1a;
    outline: none;
}
.pp-search-input::placeholder {
    color: #9a9490;
}
.pp-search-clear {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #9a9490;
    font-size: 20px;
    line-height: 1;
    display: none;
    transition: color 0.15s;
}
.pp-search-clear:hover {
    color: #e8714a;
}
.pp-search-clear.visible {
    display: block;
}
.pp-search-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #4a4540;
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}
.pp-search-close:hover {
    color: #e8714a;
}

/* Status line */
.pp-search-status {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9a9490;
    margin-bottom: 10px;
    min-height: 18px;
}

/* Results list */
.pp-search-results {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Individual result card */
.pp-search-result {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #1a1a1a;
    border: 1px solid transparent;
    transition: background 0.12s, border-color 0.12s;
}
.pp-search-result:hover {
    background: #faf9f7;
    border-color: #e8e4df;
}
.pp-search-result-img {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    background: #f5ede6;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pp-search-result-img img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}
.pp-search-result-body {
    flex: 1;
    min-width: 0;
}
.pp-search-result-cat {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9a9490;
    margin-bottom: 2px;
}
.pp-search-result-name {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.pp-search-result-price {
    font-size: 13px;
    font-weight: 700;
    color: #e8714a;
}
.pp-search-result-arrow {
    font-size: 16px;
    color: #9a9490;
    flex-shrink: 0;
    transition: color 0.12s, transform 0.12s;
}
.pp-search-result:hover .pp-search-result-arrow {
    color: #e8714a;
    transform: translateX(3px);
}

/* View all link */
.pp-search-view-all {
    display: block;
    margin-top: 14px;
    padding: 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #e8714a;
    border: 1px solid rgba(232, 113, 74, 0.3);
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.pp-search-view-all:hover {
    background: #e8714a;
    color: #fff;
}

/* Empty / loading states */
.pp-search-empty {
    text-align: center;
    padding: 32px 0;
    color: #9a9490;
    font-size: 14px;
}
.pp-search-empty strong {
    display: block;
    font-size: 16px;
    color: #1a1a1a;
    margin-bottom: 6px;
}
.pp-search-spinner {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid #e8e4df;
    border-top-color: #e8714a;
    border-radius: 50%;
    animation: pp-spin 0.7s linear infinite;
    margin: 32px auto;
}
.pp-search-spinner.visible {
    display: block;
}
@keyframes pp-spin {
    to { transform: rotate(360deg); }
}

/* Popular searches */
.pp-search-popular {
    margin-top: 4px;
}
.pp-search-popular-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9a9490;
    margin-bottom: 10px;
}
.pp-search-popular-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.pp-search-popular-tag {
    font-size: 13px;
    font-weight: 600;
    color: #4a4540;
    background: #f4f2ef;
    border: 1px solid #e8e4df;
    border-radius: 20px;
    padding: 6px 14px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    font-family: 'Inter', -apple-system, sans-serif;
}
.pp-search-popular-tag:hover {
    background: #f5ede6;
    border-color: #e8714a;
    color: #e8714a;
}

/* Mobile */
@media (max-width: 600px) {
    .pp-search-drawer-inner {
        padding: 18px 16px 20px;
    }
    .pp-search-input {
        font-size: 16px; /* prevent iOS zoom */
        height: 48px;
    }
    .pp-search-result-img {
        width: 44px;
        height: 44px;
    }
}
