/**
 * Modern Flex Layout for Product and Category Cards
 * Ensures equal height cards with bottom-aligned actions
 */

/* Base card flex structure */
.product-slide-entry {
    display: flex !important;
    flex-direction: column;
    height: 100%;
    min-height: 580px; /* Ensure minimum height for product cards */
}

/* Category cards need less height */
.category-card .product-slide-entry {
    min-height: 380px;
}

/* Fixed image section */
.product-slide-entry .product-image {
    position: relative;
    margin-bottom: 15px;
}

.product-slide-entry .product-image img {
    height: 230px;
    width: 100%;
    object-fit: contain;
}

/* Flexible content area that grows */
.product-content,
.category-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Product info section */
.product-info {
    margin-bottom: 15px;
}

.product-info .tag {
    display: block;
    margin-bottom: 5px;
}

.product-info .title {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.product-info .sku {
    color: #666;
    font-size: 12px;
}

/* Rating section */
.product-slide-entry .rating-box {
    margin-bottom: 15px;
}

/* Price and quantity section that fills space */
.price-quantity-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.price-quantity-section .price {
    margin-bottom: 10px;
}

.price-quantity-section .price .prev {
    text-decoration: line-through;
    color: #999;
}

.price-quantity-section .price .current {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

/* Quantity selector */
.quantity-wrapper {
    margin-bottom: 10px;
}

.quantity-wrapper label {
    display: flex;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.quantity-wrapper label span {
    margin-right: 10px;
}

.quantity-wrapper input {
    width: 60px;
    height: 37px;
    border-radius: 0;
}

/* Price table */
.price-table-wrapper {
    flex: 1;
}

.price-table-wrapper .table-price {
    margin: 0;
    padding: 0;
}

.price-table-wrapper .table-price li {
    font-size: 12px;
    padding: 2px 0;
}

/* Fixed bottom actions */
.product-actions,
.category-actions {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

/* Action buttons */
.product-actions .bottom-line-a,
.category-actions .bottom-line-a {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
}

/* View Detail button */
.product-actions .btn-view-detail {
    background: #f5f5f5;
    color: #333;
}

.product-actions .btn-view-detail:hover {
    background: #e0e0e0;
}

/* Add to Cart button */
.product-actions .btn-add-cart {
    background: #28a745;
    color: white;
}

.product-actions .btn-add-cart:hover {
    background: #218838;
}

/* Category action buttons */
.category-actions .btn-view-more {
    background: #007bff;
    color: white;
}

.category-actions .btn-view-more:hover {
    background: #0056b3;
}

.category-actions .btn-sub-categories {
    background: #6c757d;
    color: white;
}

.category-actions .btn-sub-categories:hover {
    background: #545b62;
}

.category-actions .btn-view-category {
    background: #f5f5f5;
    color: #333;
}

.category-actions .btn-view-category:hover {
    background: #e0e0e0;
}

/* Category specific styles */
.category-content .title {
    display: block;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-slide-entry {
        min-height: 500px;
    }

    .category-card .product-slide-entry {
        min-height: 350px;
    }

    .product-actions,
    .category-actions {
        flex-direction: column;
    }

    .product-actions .bottom-line-a,
    .category-actions .bottom-line-a {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .product-slide-entry {
        min-height: 450px;
    }

    .category-card .product-slide-entry {
        min-height: 320px;
    }

    .product-slide-entry .product-image img {
        height: 180px;
    }
}