/* Product & Blog Card Styles */

/* Service Card (Product Card) */
.service-card {
    transition: all 0.3s ease;
    height: 100%;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15) !important;
}

/* Product Name - Limit to 2 lines with ellipsis */
.product-card h3,
.product-card h3 a,
.product-card .product-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    line-height: 1.3 !important;
    max-height: calc(1.3em * 2); /* 2 lines */
    min-height: calc(1.3em * 2); /* Ensure consistent height */
}

/* Product Description - Limit to 2 lines with ellipsis */
.product-card .text-muted.small,
.product-card p.text-muted.small,
.product-card .card-body p.text-muted {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    line-height: 1.4 !important;
    max-height: calc(1.4em * 2); /* 2 lines */
    /*min-height: calc(1.4em * 2); !* Ensure consistent height *!*/
}

/* Blog Card Hover Effect */
.hover-shadow {
    transition: all 0.3s ease;
}

.hover-shadow:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
}

/* Blog Category Badge */
.blog-category-badge {
    background-color: #E9D5FF;
    color: #7C3AED;
    border-radius: 50px;
    padding: 6px 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Product Card Image Container */
.product-image-container {
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
}

.product-image-container img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

/* Blog Card Image */
.blog-card-image {
    height: 200px;
    object-fit: cover;
}

/* Card Link Styles */
.card-link {
    text-decoration: none;
    color: inherit;
}

.card-link:hover {
    text-decoration: none;
    color: inherit;
}

/* Products Section - Tech Background */
.products-section-tech {
    background: linear-gradient(135deg, #000007 0%, #5C24D1 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    position: relative;
    overflow: hidden;
}

.products-section-tech::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(0, 0, 7, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(92, 36, 209, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(92, 36, 209, 0.2) 0%, transparent 50%);
    pointer-events: none;
}

.products-section-tech .container {
    position: relative;
    z-index: 1;
}

.products-section-tech .text-center h2,
.products-section-tech .text-center span,
.products-section-tech .text-center p {
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Product Card - Enhanced Hover Effect */
.product-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: white !important;
    border-radius: 16px;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(102, 126, 234, 0.4),
                0 0 0 1px rgba(255, 255, 255, 0.1),
                0 0 40px rgba(118, 75, 162, 0.3) !important;
    border: 2px solid rgba(102, 126, 234, 0.3);
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

.product-card:hover::before {
    opacity: 1;
}

.product-card .card-body {
    position: relative;
    z-index: 1;
}

/* Product Card Hover Actions */
.product-card-hover .product-image-container {
    position: relative;
    overflow: hidden;
}

.product-card-hover .product-image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
}

.product-card-hover:hover .product-image-container::after {
    opacity: 1;
}

.product-card-hover:hover .product-hover-actions {
    opacity: 1 !important;
}

.product-hover-actions .btn {
    transition: all 0.3s ease;
}

.product-hover-actions .btn:hover {
    transform: scale(1.1);
}

.product-favorite-btn.active {
    background: #ff4757 !important;
    color: white !important;
}

.product-favorite-btn.active i {
    color: white;
}

/* Product detail - Wishlist (heart) button: keep white background, no gray hover */
.product-wishlist-btn {
    background: #ffffff !important;
    border-color: #dee2e6 !important;
    color: #6c757d !important;
    box-shadow: none !important;
}

.product-wishlist-btn:hover,
.product-wishlist-btn:focus,
.product-wishlist-btn:active {
    background: #ffffff !important; /* remove bootstrap gray hover */
    border-color: #dc3545 !important;
    color: #dc3545 !important;
    box-shadow: none !important;
}

.product-wishlist-btn.active {
    background: #ffffff !important;
    border-color: #dc3545 !important;
    color: #dc3545 !important;
    box-shadow: none !important;
}

.product-wishlist-btn.active i {
    color: #dc3545 !important;
}

/* CTA Primary Button Style - Only Background Color (preserve padding/margin) */
.btn-cta-primary,
.product-add-cart-btn,
.product-add-cart-btn-hover,
.btn.btn-cta-primary {
    background: linear-gradient(135deg, #00d4ff 0%, #8b5cf6 100%) !important;
    border: none !important;
    color: #000000 !important;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4) !important;
    border-radius: 20px !important;
}

.btn-cta-primary:hover,
.product-add-cart-btn:hover,
.product-add-cart-btn-hover:hover,
.btn.btn-cta-primary:hover {
    background: linear-gradient(135deg, #00b8e6 0%, #7c3aed 100%) !important;
    color: #000000 !important;
    box-shadow: 0 6px 25px rgba(0, 212, 255, 0.5) !important;
    text-decoration: none !important;
}

.btn-cta-primary:active,
.product-add-cart-btn:active,
.product-add-cart-btn-hover:active,
.btn.btn-cta-primary:active {
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.4) !important;
}

/* Product Category Badge - New Gradient Style */
.product-card .badge.rounded-pill,
.badge.product-category-badge {
    background: linear-gradient(135deg, #00d4ff 0%, #8b5cf6 100%) !important;
    color: #000000 !important;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3) !important;
}

/* Product Action Buttons - Standardized Styles */
/* Quy chuẩn nút sản phẩm: Thêm vào giỏ, Đăng ký mua tại đây */
.btn-product-action {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

.btn-product-action i {
    font-size: 1rem;
}

.btn-product-action span {
    font-weight: 500;
}

/* Nút Đăng ký mua tại đây (affiliate link) */
.btn-product-action.btn-affiliate-link span {
    font-weight: 500;
}

