/**
 * product-cards.css v2.5
 * Cards de produto - Espaço Criativo
 *
 * - Botões maiores
 * - Card mais compacto
 * - Preço maior
 * - Rating escondido quando zero
 */

/* ============================================================
   VARIÁVEIS
   ============================================================ */
:root {
    --ec-violet: #6f42c1;
    --ec-violet-dark: #5a32a3;
    --ec-violet-light: #8b5cf6;
    --ec-cyan: #0cc3ce;
    --ec-pink: #e91e8c;
    --ec-green: #22c55e;
    --ec-red: #ef4444;
    --ec-orange: #f59e0b;
    --ec-dark: #1f2937;
    --ec-gray: #6b7280;
    --ec-gray-light: #9ca3af;
    --ec-light: #f8f5ff;
    --ec-border: #e5e7eb;
    --ec-white: #ffffff;
    --ec-shadow: 0 4px 20px rgba(111, 66, 193, 0.12);
    --ec-shadow-hover: 0 12px 35px rgba(111, 66, 193, 0.2);
    --ec-radius: 16px;
    --ec-radius-sm: 10px;
}

/* ============================================================
   CARD PRINCIPAL
   ============================================================ */
.ec-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--ec-white);
    border-radius: var(--ec-radius);
    overflow: hidden;
    box-shadow: var(--ec-shadow);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 24px;
}

.ec-product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--ec-shadow-hover);
}

/* ============================================================
   IMAGEM
   ============================================================ */
.ec-product-card__image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
}

.ec-product-card__link {
    display: block;
    width: 100%;
    height: 100%;
}

.ec-product-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.ec-product-card__img--hover {
    opacity: 0;
    transform: scale(1.08);
}

.ec-product-card:hover .ec-product-card__img--default {
    opacity: 0;
    transform: scale(1.08);
}

.ec-product-card:hover .ec-product-card__img--hover {
    opacity: 1;
    transform: scale(1);
}

/* ============================================================
   BOTÕES LATERAIS - MAIORES
   ============================================================ */
.ec-product-card__actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

.ec-product-card__btn {
    position: relative;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ec-white);
    border: none;
    border-radius: 50%;
    color: var(--ec-gray);
    font-size: 18px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    opacity: 0;
    transform: translateX(15px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animação escalonada */
.ec-product-card__btn:nth-child(1) { transition-delay: 0s; }
.ec-product-card__btn:nth-child(2) { transition-delay: 0.05s; }
.ec-product-card__btn:nth-child(3) { transition-delay: 0.1s; }
.ec-product-card__btn:nth-child(4) { transition-delay: 0.15s; }

.ec-product-card:hover .ec-product-card__btn {
    opacity: 1;
    transform: translateX(0);
}

/* Hover dos botões - TRANSIÇÃO MAIS RÁPIDA */
.ec-product-card__btn:hover {
    transform: translateX(0) scale(1.12);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.18);
}

/* Botão Favoritar */
.ec-product-card__btn--wishlist:hover {
    background: #fee2e2;
    color: var(--ec-red);
}

.ec-product-card__btn--wishlist.is-active {
    background: var(--ec-red);
    color: var(--ec-white);
}

.ec-product-card__btn--wishlist.is-active:hover {
    background: #dc2626;
}

/* Botão Quick View */
.ec-product-card__btn--quickview:hover {
    background: var(--ec-violet);
    color: var(--ec-white);
}

/* Botão Carrinho - COR INSTANTÂNEA */
.ec-product-card__btn--cart {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.1s ease,
    color 0.1s ease;
}

.ec-product-card__btn--cart:hover {
    background: linear-gradient(135deg, var(--ec-violet) 0%, var(--ec-violet-dark) 100%);
    color: var(--ec-white);
}

/* Botão WhatsApp */
.ec-product-card__btn--whatsapp:hover {
    background: #25d366;
    color: var(--ec-white);
}

/* Tooltip */
.ec-product-card__btn-tooltip {
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 12px;
    background: var(--ec-dark);
    color: var(--ec-white);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s ease;
    pointer-events: none;
}

.ec-product-card__btn-tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: var(--ec-dark);
}

.ec-product-card__btn:hover .ec-product-card__btn-tooltip {
    opacity: 1;
    visibility: visible;
}

/* ============================================================
   BADGES
   ============================================================ */
.ec-product-card__badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 5;
}

.ec-product-card__badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
    color: var(--ec-white);
}

.ec-product-card__badge--sale {
    background: linear-gradient(135deg, var(--ec-pink) 0%, #be185d 100%);
    box-shadow: 0 3px 10px rgba(233, 30, 140, 0.3);
}

.ec-product-card__badge--soldout {
    background: linear-gradient(135deg, var(--ec-gray) 0%, #374151 100%);
}

.ec-product-card__badge--new {
    background: linear-gradient(135deg, var(--ec-violet) 0%, var(--ec-violet-dark) 100%);
}

/* ============================================================
   CONTEÚDO - MAIS COMPACTO
   ============================================================ */
.ec-product-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 14px;
}

/* Categorias */
.ec-product-card__cats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    min-height: 18px;
    margin-bottom: 6px;
}

.ec-product-card__cat {
    font-size: 11px;
    color: var(--ec-gray-light);
    text-decoration: none;
    transition: color 0.2s;
}

.ec-product-card__cat::before {
    content: '•';
    margin-right: 4px;
    color: var(--ec-violet);
}

.ec-product-card__cat:hover {
    color: var(--ec-violet);
}

.ec-product-card__cats-more {
    padding: 2px 8px;
    background: var(--ec-light);
    border: none;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    color: var(--ec-violet);
    cursor: pointer;
    transition: all 0.2s;
}

.ec-product-card__cats-more:hover {
    background: var(--ec-violet);
    color: var(--ec-white);
}

.ec-product-card__cat-placeholder {
    display: block;
    height: 14px;
}

/* Título */
.ec-product-card__title {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    height: 38px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ec-product-card__title a {
    color: var(--ec-dark);
    text-decoration: none;
    transition: color 0.2s;
}

.ec-product-card__title a:hover {
    color: var(--ec-violet);
}

/* Rating - ESCONDIDO QUANDO ZERO */
.ec-product-card__rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    min-height: 16px;
}

.ec-product-card__rating:empty,
.ec-product-card__rating--hidden {
    display: none !important;
}

.ec-product-card__stars {
    position: relative;
    width: 70px;
    height: 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e5e7eb'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E") repeat-x;
    background-size: 14px 14px;
}

.ec-product-card__stars-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fbbf24'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E") repeat-x;
    background-size: 14px 14px;
}

.ec-product-card__rating-count {
    font-size: 11px;
    color: var(--ec-gray-light);
}

/* Preço - MAIOR */
.ec-product-card__price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: auto;
    padding-top: 6px;
}

.ec-product-card__price-current {
    font-size: 19px;
    font-weight: 700;
    color: var(--ec-dark);
}

.ec-product-card__price-old {
    font-size: 14px;
    color: var(--ec-gray-light);
    text-decoration: line-through;
}

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 991px) {
    /* Mobile: botões sempre visíveis */
    .ec-product-card__btn {
        opacity: 1;
        transform: translateX(0);
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    .ec-product-card__btn-tooltip {
        display: none;
    }

    .ec-product-card__actions {
        gap: 8px;
    }
}

@media (max-width: 767px) {
    .ec-product-card__title {
        font-size: 13px;
        height: 35px;
    }

    .ec-product-card__btn {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }

    .ec-product-card__price-current {
        font-size: 17px;
    }

    .ec-product-card__content {
        padding: 12px;
    }
}

@media (max-width: 575px) {
    .ec-product-card__cats {
        display: none;
    }

    .ec-product-card__content {
        padding: 10px;
    }

    .ec-product-card__title {
        height: 32px;
        margin-bottom: 4px;
    }

    .ec-product-card__btn {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }

    .ec-product-card__actions {
        gap: 6px;
        top: 8px;
        right: 8px;
    }
}

/* ============================================================
   ANIMAÇÕES EXTRAS
   ============================================================ */

/* Pulse no favorito quando ativo */
.ec-product-card__btn--wishlist.is-active i {
    animation: heartPulse 0.6s ease;
}

@keyframes heartPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* Bounce no carrinho ao clicar */
.ec-product-card__btn--cart.is-adding i {
    animation: cartBounce 0.5s ease;
}

@keyframes cartBounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-5px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-3px); }
}

/* Shimmer loading */
.ec-product-card.is-loading .ec-product-card__image {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}