/**
 * Product Card & Grid Component Styles
 */

/* Product Grid */
.product-grid {
    width: 100%;
}

/* Mobile: prevent cards stretching to equal height */
@media (max-width: 576px) {
    .product-grid .row {
        align-items: flex-start;
    }
}

.product-grid-empty {
    text-align: center;
    padding: 3rem 1rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.product-grid-empty i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 1rem;
    display: block;
}

.product-grid-empty p {
    color: #666;
    font-size: 1rem;
    margin: 0;
}

/* Product Card */
.product-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Product Link */
.product-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-card-link:hover {
    color: inherit;
    text-decoration: none;
}

/* Product Image */
.product-card-image {
    position: relative;
    background: #fff;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    overflow: hidden;
}

.product-card-image img {
    max-width: 100%;
    max-height: 160px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.product-card-image img.loaded {
    opacity: 1;
}

/* Skeleton loading animation */
.product-card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    z-index: 0;
}

.product-card-image img.loaded + .product-card-image::before,
.product-card-image:has(img.loaded)::before {
    display: none;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.product-card:hover .product-card-image img {
    transform: scale(1.05);
}

/* Badges */
.product-badge {
    position: absolute;
    z-index: 2;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.product-badge-offer {
    top: 0.75rem;
    right: 0.75rem;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: #fff;
}

.product-badge-new {
    top: 0.75rem;
    left: 0.75rem;
    background: linear-gradient(135deg, #7A8769 0%, #5d6b50 100%);
    color: #fff;
}

.product-badge-variable {
    top: 2.5rem;
    left: 0.75rem;
    background: linear-gradient(135deg, #8a9a7a 0%, #7A8769 100%);
    color: #fff;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

/* Out of Stock Overlay */
.product-out-of-stock {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-out-of-stock span {
    background: #dc3545;
    color: #fff;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 4px;
}

/* Product Body */
.product-card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Product Title */
.product-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #5d6b50;
    margin-bottom: 0.25rem;
    text-align: center;
    line-height: 1.4;
}

/* Product Category */
.product-card-category {
    font-size: 0.95rem;
    color: #7a8769;
    text-align: center;
    display: block;
    margin-bottom: 0.5rem;
}

/* Product Price */
.product-card-price {
    text-align: center;
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #7A8769;
}

.product-price-old {
    font-size: 0.9rem;
    color: #999;
    text-decoration: line-through;
    margin-right: 0.5rem;
}

.product-price-sale {
    font-size: 1.1rem;
    font-weight: 700;
    color: #5d6b50;
}

/* Product Description */
.product-card-description {
    font-size: 0.8rem;
    color: #6b7a5c;
    line-height: 1.5;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-more {
    font-size: 0.8rem;
    color: #7A8769;
    font-weight: 500;
    cursor: pointer;
}

.product-card-more:hover {
    text-decoration: underline;
}

/* Product Footer */
.product-card-footer {
    padding: 0 1rem 1rem;
    text-align: center;
    margin-top: auto;
    display: flex;
    justify-content: center;
}

.product-card-footer .btn {
    width: auto;
    padding: 0.5rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: visible;
}

.product-card-footer .btn-primary {
    background: linear-gradient(135deg, #7A8769 0%, #5d6b50 100%);
    border: none;
}

.product-card-footer .btn-primary:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(122, 135, 105, 0.4);
}

.product-card-footer .btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Responsive - Tablet */
@media (max-width: 768px) {
    .product-card-image {
        min-height: 150px;
        padding: 0.75rem;
    }
    
    .product-card-image img {
        max-height: 130px;
    }
    
    .product-card-body {
        padding: 0.75rem;
    }
    
    .product-card-title {
        font-size: 0.9rem;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .product-card-footer .btn {
        padding: 0.45rem 0.75rem;
        font-size: 0.7rem;
        margin: 0 0.5rem;
    }
    
    .product-badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
    
    .product-badge-variable {
        top: 2.2rem;
    }
}

/* Responsive - Mobile */
@media (max-width: 576px) {
    .product-card {
        border-radius: 8px;
        height: auto !important;
    }
    
    .product-card-link {
        flex: 0 1 auto !important;
    }
    
    .product-card:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    
    .product-card-image {
        min-height: 192px;
        height: 192px;
        padding: 0.6rem;
    }
    
    .product-card-image img {
        width: 180px;
        height: 180px;
        max-width: 180px;
        max-height: 180px;
        object-fit: contain;
    }
    
    .product-card-body {
        padding: 0.6rem 0.3rem 0.3rem;
        flex: 0 0 auto !important;
    }
    
    .product-card-title {
        font-size: 0.75rem;
        line-height: 1.2;
        margin-bottom: 0.3rem;
    }
    
    .product-card-category {
        font-size: 0.6rem;
        margin-bottom: 0.4rem;
    }
    
    .product-card-price {
        margin-bottom: 0.3rem;
    }
    
    .product-price,
    .product-price-sale {
        font-size: 0.78rem;
    }
    
    .product-price-old {
        font-size: 0.62rem;
        display: block;
        margin-right: 0;
        margin-bottom: 0.02rem;
    }
    
    .product-card-description {
        display: none;
    }
    
    .product-card-more {
        display: none;
    }
    
    .product-card-footer {
        padding: 0.25rem 0.3rem 0.1rem;
        margin-top: 0 !important;
    }
    
    .product-card-footer .btn {
        padding: 0.55rem 1.2rem;
        font-size: 0.65rem;
        border-radius: 5px;
        white-space: nowrap;
        overflow: visible;
    }
    
    /* Hide icons on mobile buttons */
    .product-card-footer .btn i {
        display: none;
    }
    
    /* Badges - stack vertically on mobile */
    .product-badge {
        font-size: 0.5rem;
        padding: 0.12rem 0.25rem;
        letter-spacing: 0.2px;
    }
    
    .product-badge-offer {
        top: 0.25rem;
        right: 0.25rem;
    }
    
    .product-badge-new {
        top: 0.25rem;
        left: 0.25rem;
    }
    
    .product-badge-variable {
        top: 1.3rem;
        left: 0.25rem;
        font-size: 0.45rem;
        padding: 0.1rem 0.2rem;
    }
    
    .product-out-of-stock span {
        padding: 0.25rem 0.4rem;
        font-size: 0.6rem;
    }
}

/* Responsive - Extra Small Mobile */
@media (max-width: 400px) {
    .product-card-image {
        min-height: 144px;
        height: 144px;
        padding: 0.5rem;
    }
    
    .product-card-image img {
        width: 132px;
        height: 132px;
        max-width: 132px;
        max-height: 132px;
        object-fit: contain;
    }
    
    .product-card-body {
        padding: 0.5rem 0.25rem 0.25rem;
    }
    
    .product-card-title {
        font-size: 0.68rem;
        line-height: 1.15;
        margin-bottom: 0.25rem;
    }
    
    .product-card-category {
        font-size: 0.55rem;
        margin-bottom: 0.3rem;
    }
    
    .product-price,
    .product-price-sale {
        font-size: 0.75rem;
    }
    
    .product-price-old {
        font-size: 0.58rem;
    }
    
    .product-card-footer {
        padding: 0.2rem 0.25rem 0.25rem;
    }
    
    .product-card-footer .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.58rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .product-badge {
        font-size: 0.45rem;
        padding: 0.08rem 0.18rem;
    }
    
    .product-badge-variable {
        top: 1.1rem;
    }
}
