/* =========================================================
   WP Premium — Catálogo (busca + pílulas + cards customizados)
   Reproduz o componente Products.tsx + ProductCard.tsx do Lovable
   ========================================================= */

/* ===== Search bar ===== */
.wpp-search {
    position: relative;
    max-width: 36rem;
    margin: 0 auto 3rem;
}
.wpp-search__icon {
    position: absolute;
    left: 1.125rem;
    top: 50%;
    transform: translateY(-50%);
    color: hsl(215 20% 60%);
    pointer-events: none;
    display: inline-flex;
    align-items: center;
}
.wpp-search__input {
    width: 100%;
    height: 3.5rem;
    padding: 0 1rem 0 3.25rem;
    background: hsl(224 25% 9%);
    border: 2px solid hsl(185 85% 55% / 0.2);
    border-radius: 0.75rem;
    color: hsl(210 40% 97%);
    font-size: 1rem;
    font-family: 'DM Sans', system-ui, sans-serif;
    box-shadow: 0 4px 16px hsl(185 85% 55% / 0.05);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.wpp-search__input:focus {
    outline: none;
    border-color: hsl(185 85% 55%);
    box-shadow: 0 4px 24px hsl(185 85% 55% / 0.15),
                0 0 0 3px hsl(185 85% 55% / 0.1);
}
.wpp-search__input::placeholder {
    color: hsl(215 20% 60% / 0.7);
}

/* ===== Pills ===== */
.wpp-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 3rem;
}
.wpp-pill {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    background: hsl(224 25% 9% / 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid hsl(224 20% 16% / 0.5);
    color: hsl(215 20% 60%);
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.1s;
    font-family: inherit;
}
.wpp-pill:hover {
    color: hsl(210 40% 97%);
    border-color: hsl(185 85% 55% / 0.3);
}
.wpp-pill:active { transform: scale(0.97); }
.wpp-pill--active {
    background: linear-gradient(135deg, hsl(185 85% 55%), hsl(270 60% 55%));
    color: hsl(224 30% 6%);
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 0 40px hsl(185 85% 55% / 0.35);
}

/* ===== Loading do grid ===== */
.wpp-products-grid {
    position: relative;
    transition: opacity 0.2s;
    min-height: 200px;
}
.wpp-products-grid.is-loading { opacity: 0.45; pointer-events: none; }
.wpp-products-grid.is-loading::after {
    content: '';
    position: absolute;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2rem;
    height: 2rem;
    border: 3px solid hsl(224 20% 16%);
    border-top-color: hsl(185 85% 55%);
    border-radius: 50%;
    animation: wpp-grid-spin 0.8s linear infinite;
    z-index: 1;
}
@keyframes wpp-grid-spin { to { transform: translateX(-50%) rotate(360deg); } }

/* ===== Estado vazio ===== */
.wpp-empty {
    text-align: center;
    color: hsl(215 20% 60%);
    padding: 4rem 1rem;
    font-size: 0.875rem;
}
.wpp-empty strong { color: hsl(210 40% 97%); }

/* =========================================================
   CARD DE PRODUTO (idêntico ao Lovable ProductCard.tsx)
   ========================================================= */
.wpp-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 640px) { .wpp-cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .wpp-cards-grid { grid-template-columns: repeat(3, 1fr); } }

.wpp-card {
    position: relative;
    background: linear-gradient(145deg, hsl(224 25% 10%), hsl(224 20% 8%));
    border: 1px solid hsl(224 20% 16%);
    border-radius: 1rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
    font-family: 'DM Sans', system-ui, sans-serif;
    box-shadow: 0 8px 32px hsl(224 30% 2% / 0.6);
}
.wpp-card:hover {
    box-shadow: 0 0 40px hsl(185 85% 55% / 0.35), 0 8px 32px hsl(224 30% 2% / 0.6);
    border-color: hsl(185 85% 55% / 0.4);
    transform: translateY(-2px);
}

/* Imagem 16:9 */
.wpp-card__image {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: hsl(224 25% 9%);
}
.wpp-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}
.wpp-card:hover .wpp-card__image img { transform: scale(1.05); }
.wpp-card__badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 4px 12px;
    background: linear-gradient(135deg, hsl(185 85% 55%), hsl(270 60% 55%));
    color: hsl(224 30% 6%);
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    box-shadow: 0 4px 12px hsl(185 85% 55% / 0.3);
}

/* Corpo do card */
.wpp-card__body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Tags + estrelas */
.wpp-card__tags {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.wpp-card__tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
}
.wpp-card__tag--solid {
    background: linear-gradient(135deg, hsl(270 60% 55%), hsl(270 60% 45%));
    color: hsl(210 40% 97%);
}
.wpp-card__tag--outline {
    background: transparent;
    border: 1px solid hsl(224 20% 22%);
    color: hsl(210 40% 97%);
}
.wpp-card__stars {
    margin-left: auto;
    color: #facc15;
    letter-spacing: 1px;
    font-size: 0.875rem;
    line-height: 1;
}

/* Título */
.wpp-card__title {
    font-family: 'Syne', system-ui, sans-serif;
    font-weight: 700;
    font-size: 1.125rem;
    line-height: 1.3;
    color: #fff;
    margin: 0 0 0.5rem;
    transition: background 0.3s;
    /* Mostra completo, sem truncar (igual ao Lovable) */
}
.wpp-card:hover .wpp-card__title {
    background: linear-gradient(135deg, hsl(185 85% 55%), hsl(270 60% 55%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* Descrição (truncada em 2 linhas) */
.wpp-card__desc {
    color: hsl(215 20% 60%);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0 0 1.5rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer (preço + comprar) */
.wpp-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: auto;
}
.wpp-card__prices {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    min-width: 0;
}
.wpp-card__price-old {
    color: hsl(215 20% 60%);
    text-decoration: line-through;
    font-size: 0.875rem;
    margin-bottom: 2px;
    font-weight: 500;
}
.wpp-card__price {
    font-family: 'Syne', system-ui, sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, hsl(185 85% 55%), hsl(270 60% 55%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}

/* Botão Comprar */
.wpp-card__buy {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    background: linear-gradient(135deg, hsl(185 85% 55%), hsl(270 60% 55%));
    color: hsl(224 30% 6%);
    border: none;
    border-radius: 0.5rem;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.875rem;
    font-family: inherit;
    box-shadow: 0 0 20px hsl(185 85% 55% / 0.25);
    transition: transform 0.15s, box-shadow 0.2s;
    flex-shrink: 0;
}
.wpp-card__buy:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 40px hsl(185 85% 55% / 0.5);
}

/* Compatibilidade: esconde card padrão do WC quando houver cards customizados */
.wpp-products-grid > ul.products,
.wpp-products-grid .woocommerce-products-header { display: none !important; }
