/* Modern Product Card Styles - Inspired by the faucet design */
:root {
    --card-bg: #ffffff;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --card-border-radius: 12px;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --price-color: #2c5aa0;
    --rating-color: #ffa500;
    --discount-bg: #ff4757;
    --discount-text: #ffffff;
}

/* Modern Product Card Container */
.modern-product-card {
    background: var(--card-bg);
    border-radius: var(--card-border-radius);
    transition: all 0.3s ease;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.modern-product-card:hover {
    transform: scale(1.02);
}

/* Product Image Container */
.modern-product-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modern-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.modern-product-card:hover .modern-product-image img {
    transform: scale(1.05);
}

/* Discount Badge */
.modern-discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--discount-bg);
    color: var(--discount-text);
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(255, 71, 87, 0.3);
    animation: pulse-discount 2s ease-in-out infinite;
}

@keyframes pulse-discount {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(255, 71, 87, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 3px 6px rgba(255, 71, 87, 0.4);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(255, 71, 87, 0.3);
    }
}

/* Product Info Section */
.modern-product-info {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Product Title */
.modern-product-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modern-product-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: inline-block;
    vertical-align: middle;
    line-height: 1.2;
    text-align: center;
}

.modern-product-title a:hover {
    color: var(--price-color);
}

/* Star Rating */
.modern-star-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.modern-stars {
    display: flex;
    align-items: center;
    gap: 2px;
}

.modern-star {
    color: var(--rating-color);
    font-size: 14px;
}

.modern-star.empty {
    color: #e0e0e0;
}

.modern-rating-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.modern-rating-count {
    font-size: 14px;
    color: var(--text-muted);
}

/* Product Price */
.modern-product-price {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modern-current-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--price-color);
}

.modern-original-price {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: line-through;
}

.modern-product-card.has-discount .modern-current-price {
    color: #e53e3e;
    font-weight: 800;
}

.modern-product-card.has-discount .modern-original-price {
    color: #a0a0a0;
    font-weight: 500;
}

.modern-product-card.has-discount .modern-product-title a:hover {
    color: #e53e3e;
}

.modern-product-card.has-discount .hover-area .button {
    background: linear-gradient(135deg, #e53e3e 0%, #ff4757 100%);
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.3);
}

.modern-product-card.has-discount .hover-area [class*="-button"] a {
    color: white !important;
}

.modern-product-card.has-discount .hover-area [class*="-button"] a:hover {
    background: linear-gradient(135deg, #c53030 0%, #e53e3e 100%);
    color: white !important;
}

.modern-product-card.has-discount .hover-area [class*="-button"] a::after {
    color: white !important;
}

.modern-product-card.has-discount .hover-area .button:hover {
    background: linear-gradient(135deg, #c53030 0%, #e53e3e 100%);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.4);
    transform: translateY(-2px);
}

/* Hover Actions - Same as original template */
.modern-product-card .hover-area {
    position: absolute;
    top: 30%;
    right: -100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: 0;
    visibility: hidden;
    -moz-transition: all 300ms ease-in-out 0s;
    -webkit-transition: all 300ms ease-in-out 0s;
    -o-transition: all 300ms ease-in-out 0s;
    -ms-transition: all 300ms ease-in-out 0s;
    transition: all 300ms ease-in-out 0s;
}

/* mobile */
@media (max-width: 768px) {
    .modern-product-card .hover-area {
        gap: 0px !important;
    }

    .modern-product-card .hover-area [class*="-button"] a {
        font-size: 10px !important;
        width: 26px !important;
        height: 26px !important;
    }

    .modern-product-card .hover-area .cart-button,
    .modern-product-card .hover-area .wishlist-button,
    .modern-product-card .hover-area .compare-button,
    .modern-product-card .hover-area .closed {
        margin-bottom: 2px !important;
    }
}

.modern-product-card:hover .hover-area {
    opacity: 1;
    visibility: visible;
    right: 15px;
}

.modern-product-card .hover-area .cart-button,
.modern-product-card .hover-area .wishlist-button,
.modern-product-card .hover-area .compare-button,
.modern-product-card .hover-area .closed {
    margin-bottom: 5px;
}

.modern-product-card .hover-area .cart-button:last-child,
.modern-product-card .hover-area .wishlist-button:last-child,
.modern-product-card .hover-area .compare-button:last-child {
    margin-bottom: 0;
}

.modern-product-card .hover-area [class*="-button"] {
    text-indent: -9999px;
    position: relative !important;
    top: 0;
    left: 0;
}

.modern-product-card .hover-area [class*="-button"] a {
    padding-left: 20px;
    line-height: inherit;
    display: block;
    font-size: 12px;
    font-weight: 500;
    background: var(--price-color);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.modern-product-card .hover-area [class*="-button"] a:hover {
    background: #1e3a5f;
    color: white !important;
    transform: scale(1.1);
}

.modern-product-card .hover-area [class*="-button"] a::after {
    text-indent: 0px;
    transform: translateY(-50%);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-family: Flaticon;
    font-size: 15px;
    font-weight: 600;
    color: white !important;
}

/* Icon content for buttons */
.modern-product-card .hover-area .cart-button a::after {
    content: "\f18a";
}

.modern-product-card .hover-area .wishlist-button a::after {
    content: "\f111";
}

.modern-product-card .hover-area .compare-button a::after {
    content: "\f181";
}

.modern-product-card .hover-area .buynow a::after {
    content: "\f10c" !important;
}

/* Grid Layout */
.modern-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 20px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modern-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
        padding: 16px;
    }

    .modern-product-image {
        height: 180px;
    }

    .modern-product-info {
        padding: 12px;
    }

    .modern-product-title {
        font-size: 14px;
        min-height: 40px;
    }

    .modern-current-price {
        font-size: 15px;
    }

    .modern-original-price {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .modern-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 12px;
    }

    .modern-product-image {
        height: 160px;
    }

    .modern-product-info {
        padding: 10px;
    }

    .modern-product-title {
        font-size: 13px;
        min-height: 36px;
    }

    .modern-current-price {
        font-size: 14px;
    }

    .modern-original-price {
        font-size: 11px;
    }

    .modern-star-rating {
        margin-bottom: 8px;
    }

    .modern-stars .modern-star {
        font-size: 12px;
    }

    .modern-rating-text,
    .modern-rating-count {
        font-size: 12px;
    }
}

/* Bootstrap Grid Integration */
.row.modern-product-row {
    margin: 0 -12px;
}

.row.modern-product-row .col {
    padding: 0 12px;
    margin-bottom: 24px;
}

/* Legacy Support - Override existing styles */
.product-style-1.modern-cards .product.type-product {
    background: transparent;
    border: none;
    box-shadow: none;
    margin-bottom: 0;
}

.product-style-1.modern-cards .product-wrapper {
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Out of Stock Overlay */
.modern-out-of-stock {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.modern-out-of-stock-text {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
}
