/* === CG Product Grid Styles v1.6 (Updated Hover Logic) === */

.cg-grid-wrapper {
    padding: 30px 15px;
}

.cg-grid-header {
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.cg-grid-sort-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.cg-grid-sort-label {
    color: #666666;
}

.cg-grid-sort-select {
    min-width: 200px;
    padding: 6px 30px 6px 10px;
    border-radius: 2px;
    border: 1px solid #cccccc;
    background-color: #ffffff;
    font-size: 14px;
    cursor: pointer;
}

.cg-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

/* 4 per row on desktop */
.cg-card {
    flex: 0 0 calc(25% - 22.5px);
    background-color: transparent;
    text-align: center;
}

.cg-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #ffffff;
    border-radius: 4px;
    padding: 20px 15px 25px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cg-card-inner:hover {
    transform: none !important;   /* ✅ no up/down movement */
    box-shadow: 0 12px 26px rgba(0,0,0,0.12);
}

.cg-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    flex: 1 1 auto;
}

/* === THUMB (featured + hover image) === */
.cg-card-thumb {
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
}

.cg-card-thumb img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    width: 100%;
}

.cg-thumb-main {
    transition: opacity .25s ease;
}

.cg-thumb-hover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .25s ease;
}

/* ✅ Hover swap ONLY on products that have gallery image */
.cg-card.cg-has-hover:hover .cg-thumb-hover {
    opacity: 1;
}

.cg-card.cg-has-hover:hover .cg-thumb-main {
    opacity: 0;
}

.cg-card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #333333;
}

.cg-card-price {
    display: inline-block;
    font-size: 14px;
    color: #777777;
}

.cg-card-actions {
    margin-top: 12px;
}

/* === Pill style CHOOSE OPTIONS button === */
.cg-card-actions .button,
.cg-card-actions .add_to_cart_button,
.cg-card-actions .product_type_variable {
    display: block;
    width: 100%;
    max-width: 100%;
    background: #202020 !important;
    color: #ffffff !important;
    border-radius: 999px !important;
    padding: 12px 10px !important;
    text-align: center;
    text-transform: uppercase;
    font-weight: 700;
    border: none !important;
    box-shadow: none !important;
    letter-spacing: 0.5px;
}

.cg-card-actions .button:hover,
.cg-card-actions .add_to_cart_button:hover,
.cg-card-actions .product_type_variable:hover {
    background: #000000 !important;
    color: #ffffff !important;
}

.cg-no-products {
    font-size: 14px;
    color: #666666;
}

@media (max-width: 1199px) {
    .cg-card {
        flex: 0 0 calc(33.333% - 20px);
    }
}

@media (max-width: 991px) {
    .cg-card {
        flex: 0 0 calc(50% - 15px);
    }
}

@media (max-width: 600px) {
    .cg-card {
        flex: 0 0 100%;
    }

    .cg-grid-header {
        justify-content: flex-start;
    }
}
