/**
 * Busca — produtos e posts
 */

.search-container {
    margin: 2rem 0 3rem;
}

.search-container--products {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.search-page-title {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.search-page-form .search-page-input {
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    border-radius: 0.75rem;
    overflow: hidden;
}

.search-page-form .search-page-input .form-control:focus,
.search-page-form .search-page-input .input-group-text {
    box-shadow: none;
}

.search-page-form .search-page-input:focus-within {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

/* Abas */
.search-tabs {
    border-bottom: 1px solid var(--bs-border-color);
    gap: 0.25rem;
}

.search-tabs .nav-link {
    color: var(--bs-secondary-color);
    font-weight: 500;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 0.6rem 1.1rem;
    border-radius: 0.5rem 0.5rem 0 0;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.search-tabs .nav-link:hover {
    color: var(--bs-primary);
    border-bottom-color: rgba(13, 110, 253, 0.35);
}

.search-tabs .nav-link.active {
    color: var(--bs-primary);
    font-weight: 600;
    background: transparent;
    border-bottom-color: var(--bs-primary);
}

/* Estado vazio */
.search-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: #fff;
    border: 1px dashed var(--bs-border-color);
    border-radius: 1rem;
    color: var(--bs-secondary-color);
}

.search-empty-state--hint {
    padding: 2rem 1.5rem;
    background: rgba(255, 255, 255, 0.6);
}

.search-empty-state-icon {
    display: block;
    margin: 0 auto 1rem;
    opacity: 0.35;
}

/* —— Grid de produtos —— */
.search-product-grid {
    margin-top: 0.25rem;
}

.product-search-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    overflow: hidden;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 4px 12px rgba(15, 23, 42, 0.04);
    transition:
        transform 0.22s cubic-bezier(0.34, 1.2, 0.64, 1),
        box-shadow 0.22s ease,
        border-color 0.2s ease;
}

.product-search-card:hover {
    transform: translateY(-4px);
    border-color: rgba(13, 110, 253, 0.28);
    box-shadow:
        0 8px 24px rgba(13, 110, 253, 0.12),
        0 2px 8px rgba(15, 23, 42, 0.06);
    color: inherit;
}

.product-search-card:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 3px;
}

/* Área da foto — 220px fixo */
.product-search-card-media {
    position: relative;
    flex-shrink: 0;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.25rem;
    background: #fff;
    overflow: hidden;
}

.product-search-card:hover .product-search-card-img {
    transform: scale(1.04);
}

.product-search-card-score {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 2;
    min-width: 2rem;
    padding: 0.2rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.35);
    letter-spacing: 0.02em;
}

.product-search-card-img {
    display: block;
    max-width: calc(100% - 0.5rem);
    max-height: calc(220px - 2rem);
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center center;
    transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.product-search-card-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    height: 100%;
    color: var(--bs-secondary-color);
    opacity: 0.55;
    font-size: 0.75rem;
}

/* Corpo do card */
.product-search-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.85rem 1rem 0.75rem;
    min-height: 0;
    background: var(--gm-light-bg, #f8f8f8);
    border-top: 1px solid #eef1f5;
}

.product-search-card-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: #0f172a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.45em;
}

.product-search-card:hover .product-search-card-title {
    color: var(--bs-primary);
}

.product-search-card-specs {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.product-search-card-spec {
    margin: 0;
}

.product-search-card-spec dt {
    margin: 0 0 0.1rem;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bs-secondary-color);
}

.product-search-card-spec dd {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.3;
    color: #334155;
    word-break: break-word;
}

.product-search-card-spec dd code {
    font-size: 0.72rem;
    padding: 0.12rem 0.4rem;
    background: #f1f5f9;
    border-radius: 4px;
    color: #475569;
    border: none;
}

.product-search-card-footer {
    margin-top: auto;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.product-search-card-no-rating {
    font-size: 0.72rem;
    color: var(--bs-secondary-color);
    font-style: italic;
}

/* Estrelas */
.product-stars {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.product-stars-icons {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

.product-star-svg {
    display: block;
    fill: #e2e8f0;
    transition: fill 0.15s ease;
}

.product-star-svg.is-filled {
    fill: #f59e0b;
    filter: drop-shadow(0 1px 1px rgba(245, 158, 11, 0.25));
}

.product-stars-value {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    line-height: 1;
}

/* Posts (lista) */
.search-results {
    margin-top: 1rem;
}

.search-results .list-group-item {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-results .list-group-item:hover {
    border-color: rgba(13, 110, 253, 0.25) !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

@media (max-width: 575.98px) {
    .product-search-card-media {
        height: 220px;
        padding: 0.75rem;
    }

    .product-search-card-body {
        padding: 0.75rem 0.85rem 0.65rem;
    }

    .product-search-card-title {
        font-size: 0.85rem;
    }

    .search-page-form .input-group-lg > .form-control,
    .search-page-form .input-group-lg > .btn {
        font-size: 0.95rem;
    }
}

@media (min-width: 992px) {
    .product-search-card-title {
        font-size: 0.92rem;
    }
}
