/* Container */
.ecpg-wrapper {
    position: relative;
    width: 100%;
}

/* Grid Layout */
.ecpg-grid {
    display: grid;
    /* Columns defined by inline styles via PHP */
}

/* Product Item */
.ecpg-item {
    position: relative;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-sizing: border-box;
    overflow: hidden; /* Ensure rounded corners work */
}

/* Link Overlay */
.ecpg-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    cursor: pointer;
}

/* Image */
.ecpg-image {
    overflow: hidden;
    text-align: center;
    width: 100%;
    line-height: 0; /* Fix extra space below image */
}
.ecpg-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}
.ecpg-item:hover .ecpg-image img {
    transform: scale(1.05); 
}

/* Content */
.ecpg-content {
    position: relative;
    z-index: 2;
    pointer-events: none;
    padding-top: 15px; /* Default spacing if setting missing */
}
.ecpg-content .ecpg-title,
.ecpg-content .ecpg-price {
    margin: 0;
    line-height: 1.4;
    width: 100%;
}

.ecpg-title {
    font-size: 16px; /* Default */
    font-weight: 500;
}

.ecpg-price {
    font-weight: bold;
    font-size: 15px;
    display: flex;
    justify-content: center;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}
.ecpg-price del {
    color: #999;
    font-weight: normal;
    font-size: 0.9em;
}
.ecpg-price ins {
    text-decoration: none;
    color: inherit;
}

/* Button Wrapper */
.ecpg-button-wrapper {
    pointer-events: auto;
    width: 100%;
}

/* Add to Cart Button */
.ecpg-atc-btn {
    display: inline-block;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    line-height: 1.2;
    text-align: center;
}
.ecpg-atc-btn.loading {
    opacity: 0.7;
    cursor: wait;
}
.ecpg-atc-btn.added::after {
    margin-left: 5px;
    content: '✓'; 
}

/* Load More Area */
.ecpg-load-more {
    text-align: center;
    width: 100%;
    clear: both;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ecpg-arrow-btn {
    border: none;
    cursor: pointer;
    display: flex; /* Centering content */
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    outline: none;
    width: 40px; 
    height: 40px;
    line-height: 0;
}

/* SVG / Icon styles */
.ecpg-arrow-btn svg, 
.ecpg-arrow-btn i {
    width: 1em;
    height: 1em;
    fill: currentColor; /* Inherit color from button */
    display: block;
}

/* Loading Spin Animation */
.ecpg-icon-loading svg,
.ecpg-icon-loading i {
    animation: ecpg-spin 1s infinite linear;
}

@keyframes ecpg-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}