.cpg-326ac7ef-wrapper {
    width: 100%;
}

.cpg-326ac7ef-sort-wrap {
    margin-bottom: 20px;
    display: block;
}

.cpg-326ac7ef-sort-form {
    display: inline-block;
    margin: 0;
}

.cpg-326ac7ef-orderby {
    padding: 8px 30px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    outline: none;
    max-width: 100%;
    box-shadow: none;
}

.cpg-326ac7ef-orderby:focus {
    border-color: #999;
}

.cpg-326ac7ef-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
    transition: opacity 0.3s ease;
}

.cpg-326ac7ef-grid.loading {
    opacity: 0.5;
    pointer-events: none;
}

.cpg-326ac7ef-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.cpg-326ac7ef-image {
    position: relative;
    overflow: hidden;
}

.cpg-326ac7ef-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.cpg-326ac7ef-card:hover .cpg-326ac7ef-image img {
    transform: scale(1.03);
}

.cpg-326ac7ef-badge {
    position: absolute;
    z-index: 2;
    line-height: 1;
    font-weight: 600;
}

/* Default badge position if no specific class */
.cpg-326ac7ef-badge:not([class*="pos-"]) {
    top: 10px;
    left: 10px;
}

.cpg-326ac7ef-badge.pos-top-left {
    top: 10px;
    left: 10px;
}

.cpg-326ac7ef-badge.pos-top-right {
    top: 10px;
    right: 10px;
}

.cpg-326ac7ef-badge.pos-bottom-left {
    bottom: 10px;
    left: 10px;
}

.cpg-326ac7ef-badge.pos-bottom-right {
    bottom: 10px;
    right: 10px;
}

.cpg-326ac7ef-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 15px 0 0;
}

.cpg-326ac7ef-title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
}

.cpg-326ac7ef-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.cpg-326ac7ef-title-clamped {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cpg-326ac7ef-title-clamped a {
    display: inline;
}

.cpg-326ac7ef-title-eq {
    display: block; /* changed from flex to block to fix alignment inheritance */
}

.cpg-326ac7ef-title-eq.cpg-326ac7ef-title-clamped {
    display: -webkit-box;
}

.cpg-326ac7ef-rating {
    margin-bottom: 8px;
}

.cpg-326ac7ef-rating .star-rating {
    display: inline-block;
    overflow: hidden;
    position: relative;
    height: 1em;
    line-height: 1;
    font-size: 14px;
    width: 5.4em;
    font-family: star;
}

.cpg-326ac7ef-rating .star-rating::before {
    content: "sssss";
    float: left;
    top: 0;
    left: 0;
    position: absolute;
}

.cpg-326ac7ef-rating .star-rating span {
    overflow: hidden;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
    padding-top: 1.5em;
}

.cpg-326ac7ef-rating .star-rating span::before {
    content: "SSSSS";
    top: 0;
    position: absolute;
    left: 0;
}

.cpg-326ac7ef-price-area {
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
}

.cpg-326ac7ef-price {
    font-size: 15px;
    font-weight: 700;
}

.cpg-326ac7ef-price del {
    opacity: 0.5;
    font-weight: 400;
}

.cpg-326ac7ef-price ins {
    text-decoration: none;
}

.cpg-326ac7ef-pix-price-wrap {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    font-size: 0.9em;
}

.cpg-326ac7ef-pix-price-wrap.pos-below {
    flex-direction: column;
    align-items: flex-start;
}

.cpg-326ac7ef-pix-price {
    font-weight: 700;
}

.cpg-326ac7ef-pix-label {
    font-weight: 400;
}

.cpg-326ac7ef-price-separator {
    border-top: 1px solid #e5e5e5;
    margin: 8px 0;
}

.cpg-326ac7ef-add-to-cart {
    margin-top: auto;
    display: flex;
    flex-direction: column;
}

.cpg-326ac7ef-add-to-cart .cpg-326ac7ef-btn,
.cpg-326ac7ef-add-to-cart .cpg-326ac7ef-oos-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
    line-height: 1;
    font-weight: 600;
    text-align: center;
    position: relative;
}

/* Custom Add to Cart Animation */
.cpg-326ac7ef-btn.has-custom-anim::after {
    font-family: WooCommerce;
    content: "";
    display: inline-block;
    vertical-align: middle;
    font-weight: 400;
    margin-left: 0;
    opacity: 0;
    width: 0;
    transition: margin-left 0.25s ease, width 0.25s ease, opacity 0.25s ease;
}

.cpg-326ac7ef-btn.has-custom-anim.loading::after {
    content: "\e01c"; /* Spinner icon */
    animation: spin 2s linear infinite;
    opacity: 1;
    margin-left: 0.5em;
    width: 1em;
}

.cpg-326ac7ef-btn.has-custom-anim.added::after {
    content: "\e017"; /* Checkmark icon */
    opacity: 1;
    animation: none;
    margin-left: 0.5em;
    width: 1em;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Disable WooCommerce default loading overlay if custom anim is on */
.cpg-326ac7ef-btn.has-custom-anim.loading {
    opacity: 1;
}
.cpg-326ac7ef-btn.has-custom-anim.loading::before {
    display: none;
}

.cpg-326ac7ef-oos-btn {
    cursor: not-allowed !important;
    pointer-events: none;
}

.cpg-326ac7ef-oos-wrap:not(.cpg-326ac7ef-oos-custom) .cpg-326ac7ef-oos-btn {
    opacity: 0.6;
}

.cpg-326ac7ef-oos-placeholder {
    visibility: hidden;
    min-height: 40px;
}

.cpg-326ac7ef-btn-icon {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.cpg-326ac7ef-btn-icon svg {
    fill: currentColor;
}

.cpg-326ac7ef-add-to-cart .added_to_cart {
    display: inline-block;
    text-decoration: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    line-height: 1.4;
    font-weight: 500;
    font-size: 13px;
    margin-top: 8px;
    text-align: center;
}

.cpg-326ac7ef-hide-view-cart .added_to_cart {
    display: none !important;
}

.cpg-326ac7ef-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 30px;
    width: 100%;
    grid-column: 1 / -1;
}

.cpg-326ac7ef-pagination a,
.cpg-326ac7ef-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background: #fff;
    transition: all 0.3s ease;
}

.cpg-326ac7ef-pagination a:hover {
    background: #333;
    color: #fff;
    border-color: #333;
}

.cpg-326ac7ef-pagination span.current {
    background: #333;
    color: #fff;
    border-color: #333;
}

.cpg-326ac7ef-notice {
    padding: 20px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    color: #666;
    font-size: 14px;
}
