/* Frontend styles for WooCommerce Category Customizer */

/* General styles for the category grid - base styles only */
.diwaker_custom_category_grid {
    margin: 0 auto;
    box-sizing: border-box;
}

/* Base grid layout */
.diwaker_products_grid {
    display: grid;
    margin-bottom: 40px;
    width: 100%;
    box-sizing: border-box;
}

/* Individual product styles */
.diwaker_product {
    position: relative;
    padding: 15px;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    background-color: #fff;
}

.diwaker_product:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 1;
}

.diwaker_product_link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Product image styling */
.diwaker_product_image_wrapper {
    position: relative;
    margin-bottom: 10px;
    overflow: hidden;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    width: 100%;
    box-sizing: border-box;
}

.diwaker_product_image,
.diwaker_product_hover_image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
    background-color: #ffffff;
    box-sizing: border-box;
}

.diwaker_product_image_container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    box-sizing: border-box;
}

.diwaker_product_hover_image {
    opacity: 0;
    z-index: 2;
}

.diwaker_product:hover .diwaker_product_hover_image {
    opacity: 1;
}

/* Product Title Styling */
.diwaker_product_title {
    font-family: Arial;
    font-size: 16px;
    color: #333333;
    margin: 10px 0;
    font-weight: normal;
    text-transform: none;
    line-height: 1.3;
    min-height: 40px; /* Ensure consistent height */
}

/* Price Styling */
.diwaker_product_price {
    font-family: Arial;
    margin: 10px 0;
    font-weight: bold;
    font-size: 16px;
    color: #000000;
}

.diwaker_product_price del {
    opacity: 0.5;
}

.diwaker_product_price ins {
    color: #ff0000;
    text-decoration: none;
    font-weight: bold;
}

/* Button Styling */
.diwaker_product_add_to_cart {
    margin-top: 10px;
}

.diwaker_product .button,
.diwaker_product .added_to_cart {
    background-color: #0066cc;
    color: #ffffff;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    text-transform: none;
    border: 0 solid #0066cc;
    display: inline-block;
    line-height: 1.5;
    transition: all 0.3s ease;
    text-decoration: none;
}

.diwaker_product .button:hover,
.diwaker_product .added_to_cart:hover {
    background-color: #004c99;
    color: #ffffff;
    border-color: #004c99;
}

/* Product Badges */
.diwaker_product_badges {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

/* Badge base styling */
.diwaker_badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1;
    border: 0 solid #ffffff;
    border-style: solid;
    position: absolute;
    z-index: 10;
}

/* New badge positioning and styling */
.diwaker_new_badge {
    background-color: #03a9f4;
    color: #ffffff;
    top: 10px;
    right: auto;
    bottom: auto;
    left: 10px;
    
    /* New specific badge styling */
    font-size: 12px;
    font-weight: bold;
    font-family: inherit;
    border-width: 0px;
    border-radius: 3px;
    border-color: #ffffff;
    padding: 4px 8px;
    margin: 0px 5px 0px 0px;
}

/* Sale badge positioning and styling */
.diwaker_sale_badge {
    background-color: #f44336;
    color: #ffffff;
    top: 10px;
    right: 10px;
    bottom: auto;
    left: auto;
    
    /* Sale specific badge styling */
    font-size: 12px;
    font-weight: bold;
    font-family: inherit;
    border-width: 0px;
    border-radius: 3px;
    border-color: #ffffff;
    padding: 4px 8px;
    margin: 0px 5px 0px 0px;
}

/* Responsive styles */
@media (max-width: 768px) {
    .diwaker_products_grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .diwaker_product_title {
        font-size: 14px;
    }
    
    .diwaker_product_price {
        font-size: 14px;
    }
    
    .diwaker_product .button,
    .diwaker_product .added_to_cart {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .diwaker_badge {
        font-size: 10px;
    }
}

/* Pagination Styling */
.diwaker_pagination {
    text-align: center;
    margin: 30px 0;
}

.diwaker_pagination ul {
    display: inline-block;
    list-style: none;
    margin: 0;
    padding: 0;
}

.diwaker_pagination ul li {
    display: inline-block;
    margin: 0 3px;
}

.diwaker_pagination ul li a,
.diwaker_pagination ul li span {
    display: inline-block;
    padding: 8px 12px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    color: #333;
    border-radius: 3px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.diwaker_pagination ul li a:hover {
    background-color: #e9e9e9;
}

.diwaker_pagination ul li span.current {
    background-color: #0066cc;
    color: #fff;
    border-color: #0066cc;
}

/* Load More Button */
.diwaker_load_more {
    text-align: center;
    margin: 30px 0;
}

.diwaker_load_more_button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0066cc;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.diwaker_load_more_button:hover {
    background-color: #004c99;
}

.diwaker_load_more_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading indicator */
.diwaker_loading {
    text-align: center;
    padding: 20px 0;
}

.diwaker_loading span {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #0066cc;
    border-radius: 50%;
    animation: diwaker-spin 1s linear infinite;
}

@keyframes diwaker-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Infinite scroll container */
.diwaker_infinite_scroll {
    text-align: center;
    padding: 20px 0;
    min-height: 42px;
}