/*
 * PA Live Search — Stylesheet
 * Plugin URI : https://norzer.me
 * Version    : 1.1.0
 * Author     : Norzer
 *
 * Table of contents:
 *  1. Breakdance wrapper (header search)
 *  2. Shortcode wrapper
 *  3. Dropdown — shared shell
 *  4. Dropdown — section label
 *  5. Dropdown — product rows
 *  6. Dropdown — view all
 *  7. Dropdown — keyboard footer
 *  8. Dropdown — loading state
 *  9. Dropdown — empty state
 * 10. Animations
 * 11. Responsive
 */

/* ─────────────────────────────────────────────
   1. Breakdance wrapper (header search)
   Add class "pa-search-wrap" to the container
   around your existing Breakdance search input.
───────────────────────────────────────────── */
.pa-search-wrap {
    position: relative;
}

/* ─────────────────────────────────────────────
   2. Shortcode wrapper  [pa_search]
───────────────────────────────────────────── */
.pa-sc-inner {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(20, 174, 239, 0.28);
    border-radius: 10px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.pa-sc-inner:focus-within {
    border-color: rgba(20, 174, 239, 0.55);
    box-shadow: 0 0 0 3px rgba(20, 174, 239, 0.1);
}

.pa-sc-icon {
    position: absolute;
    left: 14px;
    display: flex;
    align-items: center;
    pointer-events: none;
    color: rgba(20, 174, 239, 0.6);
}

.pa-sc-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    padding: 11px 14px 11px 42px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

.pa-sc-input::placeholder {
    color: rgba(255, 255, 255, 0.32);
}

/* Search button (optional) */
.pa-sc-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #14AEEF;
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 0 16px;
    height: 100%;
    min-height: 44px;
    color: #0d1117;
    cursor: pointer;
    transition: background 0.15s ease;
}

.pa-sc-btn:hover {
    background: #0f9ad4;
}

/* ─────────────────────────────────────────────
   3. Dropdown — shared shell
───────────────────────────────────────────── */
.pa-ls-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    min-width: 280px;
    background: #080c14;
    border: 1px solid rgba(20, 174, 239, 0.22);
    border-radius: 12px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(20, 174, 239, 0.06);
    z-index: 99999;
    overflow: hidden;
    animation: pa-ls-in 0.14s ease;
    box-sizing: border-box;
}

.pa-ls-dropdown.pa-ls-open {
    display: block;
}

/* ─────────────────────────────────────────────
   4. Dropdown — section label
───────────────────────────────────────────── */
.pa-ls-section-label {
    padding: 9px 14px 7px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.22);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
}

/* ─────────────────────────────────────────────
   5. Dropdown — product rows
───────────────────────────────────────────── */
.pa-ls-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none !important;
    color: #fff !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.12s ease;
    cursor: pointer;
    text-align: left;
}

.pa-ls-item:last-of-type {
    border-bottom: none;
}

.pa-ls-item:hover,
.pa-ls-item.pa-ls-active {
    background: rgba(20, 174, 239, 0.08);
}

.pa-ls-thumb {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #111827;
    border: 1px solid rgba(20, 174, 239, 0.12);
}

.pa-ls-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
    text-align: left;
    align-items: flex-start;
}

.pa-ls-title {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    text-align: left;
}

.pa-ls-title mark {
    background: transparent;
    color: #14AEEF;
    font-weight: 700;
}

.pa-ls-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
}

.pa-ls-price {
    font-size: 12px;
    font-weight: 600;
    color: #14AEEF;
}

.pa-ls-badge {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(20, 174, 239, 0.1);
    border: 1px solid rgba(20, 174, 239, 0.2);
    color: rgba(20, 174, 239, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.pa-ls-arrow {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.14);
    flex-shrink: 0;
    transition: color 0.12s;
    display: flex;
    align-items: center;
}

.pa-ls-item:hover .pa-ls-arrow,
.pa-ls-item.pa-ls-active .pa-ls-arrow {
    color: #14AEEF;
}

/* ─────────────────────────────────────────────
   6. Dropdown — view all
───────────────────────────────────────────── */
.pa-ls-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 500;
    color: #14AEEF !important;
    text-decoration: none !important;
    background: rgba(20, 174, 239, 0.05);
    border-top: 1px solid rgba(20, 174, 239, 0.1);
    transition: background 0.12s ease;
    cursor: pointer;
}

.pa-ls-view-all:hover {
    background: rgba(20, 174, 239, 0.12);
}

.pa-ls-view-all svg {
    flex-shrink: 0;
}

/* ─────────────────────────────────────────────
   7. Dropdown — keyboard footer
───────────────────────────────────────────── */
.pa-ls-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 6px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.02);
}

.pa-ls-key {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.18);
}

.pa-ls-key kbd {
    display: inline-block;
    padding: 1px 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 10px;
    font-family: inherit;
    color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.04);
    line-height: 1.5;
}

/* ─────────────────────────────────────────────
   8. Dropdown — loading state
───────────────────────────────────────────── */
.pa-ls-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 22px 14px;
}

.pa-ls-loading span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #14AEEF;
    animation: pa-ls-bounce 0.55s infinite alternate;
}

.pa-ls-loading span:nth-child(2) { animation-delay: 0.18s; }
.pa-ls-loading span:nth-child(3) { animation-delay: 0.36s; }

/* ─────────────────────────────────────────────
   9. Dropdown — empty state
───────────────────────────────────────────── */
.pa-ls-empty {
    padding: 26px 14px;
    text-align: center;
}

.pa-ls-empty svg {
    width: 28px;
    height: 28px;
    color: rgba(255, 255, 255, 0.1);
    display: block;
    margin: 0 auto 10px;
}

.pa-ls-empty p {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.26);
    line-height: 1.55;
}

.pa-ls-empty strong {
    color: rgba(255, 255, 255, 0.42);
    font-weight: 500;
}

/* ─────────────────────────────────────────────
   10. Animations
───────────────────────────────────────────── */
@keyframes pa-ls-in {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pa-ls-bounce {
    from { opacity: 0.25; transform: translateY(0); }
    to   { opacity: 1;    transform: translateY(-5px); }
}

/* ─────────────────────────────────────────────
   11. Responsive
───────────────────────────────────────────── */
@media (max-width: 480px) {
    .pa-ls-dropdown {
        /* Stay relative to wrapper — matches input width exactly */
        position: absolute;
        left: 0;
        right: 0;
        width: 100%;
        min-width: unset;
    }

    .pa-ls-footer {
        display: none;
    }

    .pa-sc-input {
        font-size: 16px; /* prevents iOS zoom on focus */
    }
}
