/* ================================================
   SEARCH – Mega menu search panel
   ================================================ */

/* The search panel reuses .pg-mega base styles (position, animation, shadow).
   We override specifics for the search layout. */
.pg-mega-search {
    max-height: 80vh;
    overflow-y: auto;
}

/* ---- Search header (input + close) ---- */
.pg-mega-search-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 24px 0;
}
.pg-mega-search-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--pg-border-light);
}

/* Input wrapper */
.pg-search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}
.pg-search-input-icon {
    flex-shrink: 0;
    color: var(--pg-grey-light);
}
.pg-search-input {
    flex: 1;
    border: none;
    background: none;
    font-size: 18px;
    font-weight: 500;
    color: var(--pg-dark);
    outline: none;
    min-width: 0;
    font-family: inherit;
}
.pg-search-input::placeholder {
    color: var(--pg-grey-light);
    font-weight: 400;
}

/* Clear button (inside input) */
.pg-search-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 50%;
    border: none;
    background: var(--pg-border-medium);
    color: var(--pg-white);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.pg-search-clear:hover {
    background: var(--pg-grey);
}

/* Close button */
.pg-search-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 6px;
    border: none;
    background: none;
    color: var(--pg-dark);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.pg-search-close:hover {
    background: var(--pg-light-grey);
}

/* ---- Search body (results area) ---- */
.pg-mega-search-body {
    padding: 20px 0 24px;
}

/* Status / count */
.pg-search-status {
    margin-bottom: 16px;
}
.pg-search-count {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--pg-border-light);
    margin-bottom: 20px;
}
.pg-search-count span {
    font-size: 13px;
    color: var(--pg-grey);
}
.pg-search-no-results {
    font-size: 15px;
    font-weight: 500;
    color: var(--pg-grey-light);
    text-align: center;
    padding: 40px 0;
}
.pg-search-error {
    font-size: 14px;
    color: var(--pg-error);
    text-align: center;
    padding: 30px 0;
}
.pg-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    color: var(--pg-grey-light);
    padding: 30px 0;
}

/* Spinner */
.pg-search-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--pg-border-medium);
    border-top-color: var(--pg-galaxy);
    border-radius: 50%;
    animation: pgSearchSpin 0.8s linear infinite;
}
@keyframes pgSearchSpin {
    to { transform: rotate(360deg); }
}

/* ---- Results grid (6 cols) ---- */
.pg-search-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

/* Product card */
.pg-search-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}
.pg-search-card:hover {
    transform: translateY(-3px);
}
.pg-search-card-img {
    aspect-ratio: 1;
    background: var(--pg-bg-page);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pg-search-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.pg-search-card-placeholder {
    font-size: 18px;
    font-weight: 700;
    color: var(--pg-grey-light);
    text-transform: uppercase;
}
.pg-search-card-info {
    display: flex;
    flex-direction: column;
    padding: 8px 2px 0;
    gap: 2px;
}
.pg-search-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--pg-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}
.pg-search-card-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--pg-dark);
}
.pg-search-card-price del {
    color: var(--pg-grey-light);
    font-size: 12px;
    font-weight: 400;
}
.pg-search-card-price ins {
    text-decoration: none;
    color: var(--pg-price);
    font-weight: 600;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .pg-mega-search-inner {
        padding: 16px 16px 0;
    }
    .pg-search-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
    .pg-search-input {
        font-size: 16px;
    }
}
@media (max-width: 600px) {
    .pg-search-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .pg-search-input {
        font-size: 15px;
    }
    .pg-search-card-name {
        font-size: 12px;
    }
    .pg-search-card-price {
        font-size: 12px;
    }
}
