/**
 * 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: var(--color-primary);
    --ec-violet-dark: var(--color-primary-dark);
    --ec-violet-light: var(--color-primary-light);
    --ec-cyan: var(--color-accent);
    --ec-pink: var(--color-accent);
    --ec-green: var(--color-success);
    --ec-red: var(--color-danger);
    --ec-orange: var(--color-secondary);
    --ec-dark: var(--color-text);
    --ec-gray: var(--color-text-light);
    --ec-gray-light: var(--color-text-muted);
    --ec-light: var(--color-primary-bg);
    --ec-border: var(--color-border);
    --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, var(--color-primary-bg) 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%, var(--color-text) 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, var(--color-bg-alt) 25%, #e0e0e0 50%, var(--color-bg-alt) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* ============================================================
   ESPAÇAMENTO VERTICAL ENTRE CARDS
   ============================================================ */

/* Colunas Bootstrap - espaçamento inferior maior */
[class*="col-"] > .ec-product-card {
    margin-bottom: 30px;
}

/* Rows com cards */
.row:has(.ec-product-card) {
    row-gap: 30px;
}

/* ============================================================
   VARIANTE SLIDER (product-news)
   ============================================================ */

/* Card do slider - largura controlada */
.ec-product-card--slider {
    margin-bottom: 0;
    box-shadow: none;
    border: none;
    width: 100%;
    max-width: 250px;
}

.ec-product-card--slider:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Esconde WhatsApp no slider */
.ec-product-card--slider .ec-product-card__btn--whatsapp {
    display: none !important;
}

/* Imagem no slider - tamanho fixo */
.ec-product-card--slider .ec-product-card__image {
    aspect-ratio: 1;
    max-height: 250px;
}

.ec-product-card--slider .ec-product-card__img {
    object-fit: contain;
    max-height: 250px;
}

/* Conteúdo mais compacto no slider */
.ec-product-card--slider .ec-product-card__content {
    padding: 12px;
}

.ec-product-card--slider .ec-product-card__title {
    font-size: 13px;
    height: 36px;
}

.ec-product-card--slider .ec-product-card__price-current {
    font-size: 16px;
}

/* Padding entre slides - mais espaçado */
#carousel-6-columns-products .slick-slide {
    padding: 12px;
}

/* Fallback: quando slick-track está no HTML mas JS não funcionou */
#carousel-6-columns-products .slick-track {
    display: flex !important;
    flex-wrap: nowrap;
    gap: 16px;
}

#carousel-6-columns-products .slick-track .ec-product-card--slider {
    flex: 0 0 auto;
    width: 220px;
    max-width: 220px;
}

/* Quando Slick não está inicializado - fallback flex */
#carousel-6-columns-products:not(.slick-initialized) {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 10px;
}

#carousel-6-columns-products:not(.slick-initialized) .ec-product-card--slider {
    flex: 0 0 auto;
    width: 220px;
    max-width: 220px;
}

/* Quando Slick ESTÁ inicializado e funcionando */
.slick-initialized .slick-slide .ec-product-card--slider {
    max-width: 100%;
    width: 100%;
}

@media (max-width: 767px) {
    [class*="col-"] > .ec-product-card {
        margin-bottom: 20px;
    }
    
    #carousel-6-columns-products .slick-slide {
        padding: 8px;
    }
}

/* ============================================================
   BANNERS DE CATEGORIAS - RESPONSIVO
   ============================================================ */

/* Mobile - col-12 */
@media (max-width: 767px) {
    .banners .col-lg-3,
    .banners .col-md-6 {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }
    
    .banners .col-lg-3:last-child {
        margin-bottom: 0;
    }
}

/* ============================================================
   MODAL QUICK VIEW - SCROLL NA DESCRIÇÃO
   ============================================================ */

/* Modal geral */
.modal-quick-view,
.quick-view-modal,
[class*="quick-view"] .modal-content,
.mfp-content {
    max-height: 90vh;
    overflow: hidden;
}

/* Corpo do modal com scroll */
.modal-quick-view .modal-body,
.quick-view-modal .modal-body,
.quick-view-content,
.mfp-content .product-detail,
.mfp-content .detail-info {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 10px;
}

/* Descrição do produto com scroll */
.quick-view-content .product-description,
.quick-view-content .detail-desc,
.quick-view-content .short-desc,
.modal-body .product-description,
.modal-body .detail-desc,
.detail-info .detail-desc {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 8px;
}

/* Scrollbar estilizada */
.quick-view-content ::-webkit-scrollbar,
.modal-body ::-webkit-scrollbar,
.detail-info ::-webkit-scrollbar {
    width: 6px;
}

.quick-view-content ::-webkit-scrollbar-track,
.modal-body ::-webkit-scrollbar-track,
.detail-info ::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.quick-view-content ::-webkit-scrollbar-thumb,
.modal-body ::-webkit-scrollbar-thumb,
.detail-info ::-webkit-scrollbar-thumb {
    background: var(--ec-violet, #6f42c1);
    border-radius: 3px;
}

.quick-view-content ::-webkit-scrollbar-thumb:hover,
.modal-body ::-webkit-scrollbar-thumb:hover,
.detail-info ::-webkit-scrollbar-thumb:hover {
    background: var(--ec-violet-dark, #5a32a3);
}

/* ============================================================
   MINI CARD (product-footer / sidebar)
   ============================================================ */
.ec-product-mini {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--ec-white);
    border-radius: var(--ec-radius-sm);
    margin-bottom: 12px;
    border: 1px solid var(--ec-border);
    transition: box-shadow 0.2s ease;
}

.ec-product-mini:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Imagem mini - tamanho fixo */
.ec-product-mini__image {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    display: block;
}

.ec-product-mini__image img {
    width: 70px;
    height: 70px;
    max-width: 70px;
    max-height: 70px;
    object-fit: cover;
    border-radius: 6px;
}

/* Conteúdo mini */
.ec-product-mini__content {
    flex: 1;
    min-width: 0;
}

/* Título mini - PEQUENO */
.ec-product-mini__title {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    margin: 0 0 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ec-product-mini__title a {
    color: var(--ec-dark);
    text-decoration: none;
    font-size: 13px;
}

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

/* Preço mini */
.ec-product-mini__price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ec-product-mini__price-current {
    font-size: 14px;
    font-weight: 700;
    color: var(--ec-violet);
}

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

@media (max-width: 575px) {
    .ec-product-mini {
        padding: 10px;
        gap: 10px;
    }
    
    .ec-product-mini__image,
    .ec-product-mini__image img {
        width: 60px;
        height: 60px;
        max-width: 60px;
        max-height: 60px;
    }
    
    .ec-product-mini__title,
    .ec-product-mini__title a {
        font-size: 12px;
    }
}