/* Product Card Component - Versione Compatta */
.product-card {
    background-color: var(--color-bianco);
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    /* height: 100%; */
}

.product-card:hover {
    box-shadow: 0 8px 16px rgba(4, 107, 210, 0.12);
    transform: translateY(-2px);
}

/* Image Section - Formato verticale A4 */
.product-card__image-wrapper {
    position: relative;
    /* Rapporto A4: 1:1.414 (circa 70.7% width) */
    aspect-ratio: 1 / 1.414;
    background: linear-gradient(135deg, var(--color-pannina) 0%, #cbd5e1 100%);
    overflow: hidden;
}

.product-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-card__image {
    transform: scale(1.03);
}

/* Badges - Più piccoli e compatti */
.product-card__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: var(--color-blu);
    color: var(--color-bianco);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 4px rgba(4, 107, 210, 0.3);
    z-index: 2;
    line-height: 1;
}

.product-card__discount {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #ef4444;
    color: var(--color-bianco);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
    z-index: 2;
    line-height: 1;
}

/* Preview Actions - Compatte */
.product-card__preview-actions {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--color-pannina);
}

.product-card__preview-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background-color: var(--color-bianco);
    border: 1.5px solid var(--color-pannina);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.product-card__preview-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.product-card__preview-btn:active {
    transform: translateY(0);
}

.product-card__preview-btn--youtube {
    color: #ff0000;
    border-color: rgba(255, 0, 0, 0.3);
}

.product-card__preview-btn--youtube:hover {
    background-color: #ff0000;
    color: white;
    border-color: #ff0000;
}

.product-card__preview-btn--facebook {
    color: #1877f2;
    border-color: rgba(24, 119, 242, 0.3);
}

.product-card__preview-btn--facebook:hover {
    background-color: #1877f2;
    color: white;
    border-color: #1877f2;
}

.product-card__preview-btn--pdf {
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.3);
}

.product-card__preview-btn--pdf:hover {
    background-color: #dc2626;
    color: white;
    border-color: #dc2626;
}

.product-card__preview-btn--audio {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

.product-card__preview-btn--audio:hover,
.product-card__preview-btn--playing {
    background-color: #10b981;
    color: white;
    border-color: #10b981;
}

.product-card__preview-btn--playing {
    animation: pulse-compact 1.5s ease-in-out infinite;
}

@keyframes pulse-compact {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
    }
}

/* Content Section - Compatta */
.product-card__content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.product-card__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-sfondo);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 39px;
}

.product-card__author {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    font-style: italic;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card__category {
    display: inline-block;
    font-size: 9px;
    color: var(--color-blu);
    background-color: rgba(4, 107, 210, 0.1);
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    align-self: flex-start;
    line-height: 1;
}

/* Footer with Price and Cart - Compatto */
.product-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--color-pannina);
    gap: 8px;
}

.product-card__price-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.product-card__old-price {
    font-size: 11px;
    color: #94a3b8;
    text-decoration: line-through;
    line-height: 1;
}

.product-card__price {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-sfondo);
    line-height: 1;
}

.product-card__cart-btn {
    background-color: var(--color-blu);
    color: var(--color-bianco);
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    min-width: 40px;
    height: 40px;
}

.product-card__cart-btn:hover:not(:disabled) {
    background-color: var(--color-hover);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(4, 107, 210, 0.3);
}

.product-card__cart-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 769px) {
    .product-card {
        border-radius: 10px;
    }

    .product-card__preview-actions {
        padding: 6px;
        gap: 4px;
    }

    .product-card__preview-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
        border-radius: 5px;
    }

    .product-card__content {
        padding: 10px;
        gap: 5px;
    }

    .product-card__title {
        font-size: 13px;
        min-height: 34px;
    }

    .product-card__author {
        font-size: 11px;
    }

    .product-card__price {
        font-size: 16px;
    }

    .product-card__old-price {
        font-size: 10px;
    }

    .product-card__cart-btn {
        padding: 6px 10px;
        font-size: 14px;
        min-width: 36px;
        height: 36px;
    }

    .product-card__category {
        font-size: 8px;
        padding: 2px 6px;
    }

    .product-card__footer {
        padding-top: 6px;
    }
}

/* Grid Layout - Più compatto */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 20px;
}

@media (min-width: 640px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 24px;
    }
}

@media (max-width: 769px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
        padding: 12px;
    }
}