/**
 * Card Templates Styles
 * Modern and attractive styling for product and blog post cards
 */

/* Common Card Styles */
.card-product, 
.card-blog-post {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.07);
    margin-bottom: 30px;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.card-product.animate-in, 
.card-blog-post.animate-in {
    opacity: 1;
    transform: translateY(0);
    animation: card-fade-in 0.5s ease forwards;
}

@keyframes card-fade-in {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-product:hover, 
.card-blog-post:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-5px);
}

.card-product-inner, 
.card-blog-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Product Card Styles */
.card-product-media {
    position: relative;
    overflow: hidden;
}

.card-product-media::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 60%, rgba(0,0,0,0.3) 100%);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-product:hover .card-product-media::before {
    opacity: 1;
}

.card-product-image-link {
    display: block;
    overflow: hidden;
}

.card-product-image {
    width: 100%;
    height: auto;
    transition: transform 0.5s ease;
}

.card-product:hover .card-product-image {
    transform: scale(1.05);
}

.card-product-discount,
.card-product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 3;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 30, 99, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(231, 30, 99, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(231, 30, 99, 0);
    }
}

.card-product-discount {
    background-color: #e91e63;
}

.card-product-badge.sale {
    background-color: #e91e63;
}

.card-product-badge.featured {
    background-color: #2196f3;
    left: auto;
    right: 10px;
    animation: badge-pulse-blue 2s infinite;
}

@keyframes badge-pulse-blue {
    0% {
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(33, 150, 243, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0);
    }
}

.card-product-badge.out-of-stock {
    background-color: #9e9e9e;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 8px 16px;
    font-size: 14px;
    white-space: nowrap;
    animation: none;
}

.card-product-rating {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    z-index: 3;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.3s ease;
}

.card-product:hover .card-product-rating {
    transform: translateY(0);
    opacity: 1;
}

.rating-stars {
    display: flex;
    margin-right: 5px;
}

.rating-stars i {
    color: #ffc107;
    font-size: 12px;
    margin-right: 2px;
}

.rating-stars i:last-child {
    margin-right: 0;
}

.rating-value {
    font-weight: 600;
}

.card-product-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    z-index: 3;
}

.card-product:hover .card-product-actions {
    opacity: 1;
    transform: translateX(0);
}

.card-product-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background-color: #fff;
    color: #333;
    border-radius: 50%;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 8px;
    transition: all 0.2s ease;
    transform: scale(0.9);
}

.card-product-actions a:last-child {
    margin-bottom: 0;
}

.card-product-actions a:hover {
    background-color: #2271b1;
    color: #fff;
    transform: scale(1.1);
}

.card-product-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-product-categories {
    margin-bottom: 10px;
}

.card-product-categories a {
    color: #666;
    font-size: 12px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.card-product-categories a:hover {
    color: #2271b1;
}

.card-product-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.card-product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
    background-image: linear-gradient(to right, #2271b1, #2271b1);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 2px;
    padding-bottom: 2px;
}

.card-product-title a:hover {
    color: #2271b1;
    background-size: 100% 2px;
}

.card-product-price {
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 700;
    color: #2271b1;
}

.price-current {
    display: inline-block;
}

.price-original {
    display: inline-block;
    text-decoration: line-through;
    color: #999;
    font-weight: 400;
    font-size: 14px;
    margin-left: 8px;
}

.card-product-excerpt {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
    flex: 1;
}

.card-product-footer {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
}

.btn-details,
.btn-buy,
.btn-add-to-cart {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-details::before,
.btn-buy::before,
.btn-add-to-cart::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.btn-details:hover::before,
.btn-buy:hover::before,
.btn-add-to-cart:hover::before {
    left: 100%;
}

.btn-details {
    background-color: #f8f8f8;
    color: #333;
    border: 1px solid #e0e0e0;
}

.btn-details:hover {
    background-color: #eaeaea;
}

.btn-buy,
.btn-add-to-cart {
    background-color: #2271b1;
    color: #fff;
    border: 1px solid #2271b1;
}

.btn-buy:hover,
.btn-add-to-cart:hover {
    background-color: #135e96;
    border-color: #135e96;
}

/* Affiliate Product Specific */
.affiliate-product .card-product-discount {
    background-color: #ff5722;
    animation: badge-pulse-orange 2s infinite;
}

@keyframes badge-pulse-orange {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 87, 34, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 87, 34, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 87, 34, 0);
    }
}

/* WooCommerce Product Specific */
.wc-product .woocommerce-Price-amount {
    color: inherit;
}

.wc-product ins {
    text-decoration: none;
}

.wc-product del {
    color: #999;
    font-weight: 400;
    font-size: 14px;
    margin-left: 5px;
}

/* Blog Post Card Styles */
.card-blog-media {
    position: relative;
    overflow: hidden;
}

.card-blog-media::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0) 40%, rgba(0,0,0,0.4) 100%);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-blog-post:hover .card-blog-media::before {
    opacity: 1;
}

.card-blog-image-link {
    display: block;
    overflow: hidden;
}

.card-blog-image {
    width: 100%;
    height: auto;
    transition: transform 0.5s ease;
}

.card-blog-post:hover .card-blog-image {
    transform: scale(1.05);
}

.card-blog-format {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 3;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.card-blog-post:hover .card-blog-format {
    transform: scale(1);
}

.card-blog-categories {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 3;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.3s ease;
}

.card-blog-post:hover .card-blog-categories {
    transform: translateY(0);
    opacity: 1;
}

.category-badge {
    display: inline-block;
    padding: 5px 10px;
    background-color: #2271b1;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    border-radius: 3px;
    text-decoration: none;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.category-badge:hover {
    background-color: #135e96;
    color: #fff;
}

.card-blog-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-blog-meta {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 15px;
    font-size: 12px;
    color: #777;
}

.card-blog-meta > span {
    margin-right: 15px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.card-blog-meta > span:last-child {
    margin-right: 0;
}

.card-blog-meta i {
    margin-right: 5px;
}

.card-blog-meta a {
    color: #777;
    text-decoration: none;
    transition: color 0.2s ease;
}

.card-blog-meta a:hover {
    color: #2271b1;
}

.card-blog-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    line-height: 1.4;
}

.card-blog-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
    background-image: linear-gradient(to right, #2271b1, #2271b1);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 2px;
    padding-bottom: 2px;
}

.card-blog-title a:hover {
    color: #2271b1;
    background-size: 100% 2px;
}

.card-blog-excerpt {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    flex: 1;
}

.card-blog-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.btn-read-more {
    display: inline-flex;
    align-items: center;
    padding: 8px 15px;
    background-color: #f8f8f8;
    color: #333;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-read-more::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.btn-read-more:hover::before {
    left: 100%;
}

.btn-read-more i {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.btn-read-more:hover {
    background-color: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.btn-read-more:hover i {
    transform: translateX(3px);
}

.social-share {
    position: relative;
}

.share-toggle {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: #f8f8f8;
    border: 1px solid #e0e0e0;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-toggle:hover,
.social-share.active .share-toggle {
    background-color: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.share-dropdown {
    position: absolute;
    bottom: 45px;
    right: 0;
    display: none;
    padding: 8px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
    animation: fade-in 0.3s ease;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.social-share:hover .share-dropdown {
    display: flex;
}

.share-dropdown a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: #fff;
    margin-right: 5px;
    transition: all 0.2s ease;
}

.share-dropdown a:last-child {
    margin-right: 0;
}

.share-facebook {
    background-color: #3b5998;
}

.share-twitter {
    background-color: #1da1f2;
}

.share-pinterest {
    background-color: #bd081c;
}

.share-linkedin {
    background-color: #0077b5;
}

.share-dropdown a:hover {
    transform: translateY(-3px);
}

/* Responsive styles */
@media (max-width: 767px) {
    .card-product-footer,
    .card-blog-footer {
        flex-direction: column;
    }
    
    .btn-details,
    .btn-buy,
    .btn-add-to-cart,
    .btn-read-more {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }
    
    .social-share {
        align-self: flex-end;
    }
    
    .card-blog-meta {
        flex-direction: column;
    }
    
    .card-blog-meta > span {
        margin-right: 0;
        margin-bottom: 8px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .card-product-title,
    .card-blog-title {
        font-size: 15px;
    }
    
    .card-product-excerpt,
    .card-blog-excerpt {
        font-size: 13px;
    }
    
    .btn-details,
    .btn-buy,
    .btn-add-to-cart,
    .btn-read-more {
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* Grid Layout */
.products-grid,
.posts-grid {
    display: grid;
    grid-gap: 30px;
}

.products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

@media (max-width: 767px) {
    .products-grid,
    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    }
} 