/**
 * Theme Name: Blocksy Child
 * Description: Blocksy Child theme
 * Author: Creative Themes
 * Template: blocksy
 * Text Domain: blocksy
 */

.woocommerce a.button.add_to_cart_button {
    background-color: #BA2C2B; /* warna utama brand */
    color: #fff !important;
    font-weight: 600;
    border-radius: 6px;
    padding: 10px 16px;
    text-align: center;
    transition: 0.3s;
}

.woocommerce a.button.add_to_cart_button:hover {
    background-color: #8F1E1E;
}

/**
 * Compact WooCommerce Product Cards
 * Add to style.css in Blocksy Child Theme
 */

/* Import Montserrat Font */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

/* WooCommerce Shop Loop Styles */
.custom-product-cards .woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 0;
    margin: 0;
}

.custom-product-cards .woocommerce ul.products li.product {
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    position: relative;
}

/* Custom Product Card */
.custom-product-card {
    width: 100%;
    margin: 0 auto;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(31, 34, 35, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    font-family: 'Montserrat', sans-serif;
}

.custom-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(31, 34, 35, 0.12);
}

/* Product Image Container */
.product-image-container {
    position: relative;
    height: 160px;
    background: linear-gradient(135deg, #EDEFF1 0%, #FFFFFF 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image-container .product-image-link {
    display: block !important;
    width: 100%;
    height: 100%;
    position: relative;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block !important;
}

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

/* Force image visibility */
.custom-product-card img {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Promo Badge */
.promo-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #BA2C2B 0%, #8F1E1E 100%);
    color: #FFFFFF;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(186, 44, 43, 0.3);
    z-index: 10;
}

/* Card Content */
.card-content {
    padding: 12px 16px;
}

/* Product Name */
.product-name {
    font-size: 16px;
    font-weight: 700;
    color: #1F2223;
    margin-bottom: 3px; /* Reduced from 5px */
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 38px;
}

.product-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-name a:hover {
    color: #102A82;
}

/* Product Description */
.product-description {
    font-size: 12px;
    color: #102A82;
    line-height: 1.4;
    margin-top: 2px; /* Added to ensure proper spacing */
    margin-bottom: 8px; /* Reduced from 10px */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 34px;
}

/* Price Container */
.price-container {
    margin-bottom: 12px;
}

.price {
    font-size: 18px;
    font-weight: 700;
    color: #C9A227;
    margin-bottom: 2px;
}

.price .woocommerce-Price-amount {
    color: #C9A227;
}

.price del {
    font-size: 14px;
    color: #8F1E1E;
    opacity: 0.7;
    margin-right: 6px;
}

.price ins {
    text-decoration: none;
}

/* Buy Button Container */
.buy-button-container {
    margin-bottom: 10px;
}

/* Custom Buy Button Styles */
.buy-button,
.custom-product-card .add_to_cart_button,
.custom-product-card .product_type_simple,
.custom-product-card .product_type_variable {
    width: 100% !important;
    background: linear-gradient(135deg, #000080 0%, #102A82 100%) !important;
    color: #FFFFFF !important;
    border: none !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.3s ease !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    text-decoration: none !important;
    display: block !important;
    font-family: 'Montserrat', sans-serif !important;
    box-sizing: border-box;
}

.buy-button:hover,
.custom-product-card .add_to_cart_button:hover,
.custom-product-card .product_type_simple:hover,
.custom-product-card .product_type_variable:hover {
    box-shadow: 0 4px 10px rgba(16, 42, 130, 0.3);
    background: linear-gradient(135deg, #102A82 0%, #000080 100%) !important;
    color: #FFFFFF !important;
}

/* Card Footer */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    gap: 8px;
}

.category {
    color: #1F2223;
    font-weight: 500;
    flex: 1;
    margin-right: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rating {
    display: flex;
    align-items: center;
    color: #C9A227;
    font-weight: 600;
    white-space: nowrap;
    gap: 3px;
}

.stars {
    display: flex;
    gap: 1px;
}

.star.filled, .star.empty, .star.half {
    font-size: 12px;
}

.star.filled {
    color: #C9A227;
}

.star.empty {
    color: #EDEFF1;
}

.star.half {
    background: linear-gradient(90deg, #C9A227 50%, #EDEFF1 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rating-number {
    font-size: 11px;
    color: #C9A227;
    font-weight: 600;
}

/* Loading Animation */
.custom-product-card {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 991px) {
    .custom-product-cards .woocommerce ul.products {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 767px) {
    .custom-product-cards .woocommerce ul.products {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .product-image-container {
        height: 140px;
    }
    
    .product-name {
        font-size: 15px;
        min-height: 36px;
    }
    
    .card-content {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .custom-product-cards .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-image-container {
        height: 130px;
    }
    
    .card-content {
        padding: 8px 10px;
    }
    
    .product-name {
        font-size: 14px;
    }
    
    .price {
        font-size: 16px;
    }
    
    .buy-button,
    .custom-product-card .add_to_cart_button,
    .custom-product-card .product_type_simple,
    .custom-product-card .product_type_variable {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }
}

/* Override default WooCommerce styles */
.custom-product-cards .woocommerce ul.products li.product .woocommerce-loop-product__link,
.custom-product-cards .woocommerce ul.products li.product > a,
.custom-product-cards .woocommerce ul.products li.product > a:first-child,
.custom-product-cards .woocommerce ul.products li.product .woocommerce-loop-product__title,
.custom-product-cards .woocommerce ul.products li.product .price,
.custom-product-cards .woocommerce ul.products li.product .star-rating,
.custom-product-card .added_to_cart.wc-forward {
    display: none !important;
}

/* Add to cart button states */
.custom-product-card .add_to_cart_button.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.custom-product-card .add_to_cart_button.added {
    background: linear-gradient(135deg, #C9A227 0%, #C9A227 100%) !important;
}

.custom-product-card .add_to_cart_button.added::after {
    content: " ✓";
}

