/* ═══════════════════════════════════════════════════════════════════════════
 * [BLOCK: CSS] – Custom Art Gallery Product Card Styles
 * Version: 1.0.0
 * Prefix: .cagpc-
 *
 * Sub-blocks:
 *   [CSS: GRID]       – Grid layout for shop & shortcode
 *   [CSS: CARD]       – Individual card container
 *   [CSS: IMAGE]      – Product thumbnail
 *   [CSS: PRICE-ROW]  – Price + action icons row
 *   [CSS: ACTIONS]    – Icon buttons (wishlist, compare, cart)
 *   [CSS: DETAILS]    – Title, artist, specs text
 *   [CSS: RESPONSIVE] – Breakpoints
 *   [CSS: ANIMATIONS] – Hover & transition effects
 * ═══════════════════════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────
 * [CSS: GRID] – START
 * ─────────────────────────────────────────── */
.cagpc-grid {
    display: grid;
    grid-template-columns: repeat(var(--cagpc-columns, 3), 1fr);
    gap: 28px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.cagpc-grid > li,
.cagpc-grid > li.product,
.cagpc-grid > li.product-warp-item,
.cagpc-grid .product {
    /* Override WooCommerce / Elessi theme default li styles */
    width: auto;
    max-width: 100%;
    margin: 0;
    padding: 0;
    float: none;
    list-style: none;
    display: block;
}
/* [CSS: GRID] – END
 * ─────────────────────────────────────────── */


/* ───────────────────────────────────────────
 * [CSS: CARD] – START
 * ─────────────────────────────────────────── */
.cagpc-product-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    border: 1px solid #f0f0f0;
}

.cagpc-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08),
                0 4px 12px rgba(0, 0, 0, 0.04);
}
/* [CSS: CARD] – END
 * ─────────────────────────────────────────── */


/* ───────────────────────────────────────────
 * [CSS: IMAGE] – START
 * ─────────────────────────────────────────── */
.cagpc-card__image-link {
    display: block;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background-color: #f9f9f9; /* neutral fill for letterbox areas in contain mode */
}

.cagpc-card__image-link img.cagpc-card__image,
.cagpc-card__image-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;   /* ← changed from cover: shows full artwork, no cropping */
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    max-width: 100%;
}

/* Zoom removed — contain mode would clip edges if scaled */
.cagpc-product-card:hover .cagpc-card__image-link img {
    transform: none;
}
/* [CSS: IMAGE] – END
 * ─────────────────────────────────────────── */


/* ───────────────────────────────────────────
 * [CSS: PRICE-ROW] – START
 * ─────────────────────────────────────────── */
.cagpc-card__info {
    padding: 18px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cagpc-card__price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cagpc-card__price {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* WooCommerce price HTML elements inside our price span */
.cagpc-card__price .woocommerce-Price-amount {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

.cagpc-card__price del {
    opacity: 0.45;
    font-weight: 400;
    font-size: 0.85em;
}

.cagpc-card__price ins {
    text-decoration: none;
}
/* [CSS: PRICE-ROW] – END
 * ─────────────────────────────────────────── */


/* ───────────────────────────────────────────
 * [CSS: ACTIONS] – START
 * ─────────────────────────────────────────── */
.cagpc-card__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.cagpc-card__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #555;
    background: transparent;
    transition: color 0.25s ease, background-color 0.25s ease, transform 0.2s ease;
    text-decoration: none;
    cursor: pointer;
    border: none;
    padding: 0;
}

.cagpc-card__action:hover {
    color: #1a1a1a;
    background-color: #f5f5f5;
    transform: scale(1.12);
}

.cagpc-card__action--wishlist:hover {
    color: #e74c5e;
    background-color: #fef1f2;
}

.cagpc-card__action--compare:hover {
    color: #3b82f6;
    background-color: #eff6ff;
}

.cagpc-card__action--cart:hover {
    color: #0d9488;
    background-color: #f0fdfa;
}

.cagpc-card__action--cart.cagpc-added {
    color: #0d9488;
    background-color: #ccfbf1;
}

/* Wishlist "added" state – filled red heart */
.cagpc-card__action--wishlist.cagpc-added {
    color: #e74c5e;
    background-color: #fef1f2;
}

/* Compare "added" state */
.cagpc-card__action--compare.cagpc-added {
    color: #3b82f6;
    background-color: #eff6ff;
}

/* Loading state */
.cagpc-card__action.cagpc-loading {
    opacity: 0.5;
    pointer-events: none;
}

svg.cagpc-icon {
    width: 19px;
    height: 19px;
    display: block;
    flex-shrink: 0;
}
/* [CSS: ACTIONS] – END
 * ─────────────────────────────────────────── */


/* ───────────────────────────────────────────
 * [CSS: DETAILS] – START
 * ─────────────────────────────────────────── */
.cagpc-card__details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cagpc-card__title-link {
    text-decoration: none;
    color: inherit;
}

.cagpc-card__title-link:hover {
    color: inherit;
}

.cagpc-card__title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    padding: 0;
    line-height: 1.4;
    letter-spacing: -0.01em;
    transition: color 0.2s ease;
}

.cagpc-card__title-link:hover .cagpc-card__title {
    color: #4a4a4a;
}

.cagpc-card__artist {
    font-size: 13px;
    font-weight: 400;
    color: #777;
    margin: 2px 0 0 0;
    padding: 0;
    line-height: 1.5;
}

.cagpc-card__specs {
    font-size: 12.5px;
    font-weight: 400;
    color: #b5944e;
    margin: 1px 0 0 0;
    padding: 0;
    line-height: 1.5;
}

.cagpc-no-products {
    text-align: center;
    padding: 40px 20px;
    font-family: 'Inter', sans-serif;
    color: #888;
    font-size: 15px;
}
/* [CSS: DETAILS] – END
 * ─────────────────────────────────────────── */


/* ───────────────────────────────────────────
 * [CSS: ANIMATIONS] – START
 * ─────────────────────────────────────────── */
@keyframes cagpc-pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.cagpc-card__action.cagpc-pulse svg {
    animation: cagpc-pulse 0.4s ease;
}

@keyframes cagpc-check {
    0%   { opacity: 0; transform: scale(0.5); }
    60%  { opacity: 1; transform: scale(1.15); }
    100% { opacity: 1; transform: scale(1); }
}
/* [CSS: ANIMATIONS] – END
 * ─────────────────────────────────────────── */


/* ───────────────────────────────────────────
 * [CSS: RESPONSIVE] – START
 * ─────────────────────────────────────────── */

/* Tablet */
@media (max-width: 992px) {
    .cagpc-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Mobile */
@media (max-width: 576px) {
    .cagpc-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .cagpc-card__info {
        padding: 12px 14px 14px;
    }

    .cagpc-card__price {
        font-size: 15px;
    }

    .cagpc-card__title {
        font-size: 14px;
    }

    .cagpc-card__action {
        width: 30px;
        height: 30px;
    }

    svg.cagpc-icon {
        width: 17px;
        height: 17px;
    }
}
/* [CSS: RESPONSIVE] – END
 * ─────────────────────────────────────────── */


/* ───────────────────────────────────────────
 * [CSS: WOOCOMMERCE-OVERRIDES] – START
 * Clean up default Woo / Elessi theme styles
 * that conflict with our card layout.
 * ─────────────────────────────────────────── */
.woocommerce ul.products li.product .cagpc-product-card,
.woocommerce-page ul.products li.product .cagpc-product-card {
    text-align: left;
}

.woocommerce ul.products li.product .cagpc-card__title,
.woocommerce-page ul.products li.product .cagpc-card__title {
    font-size: 15px;
    padding: 0;
}

.woocommerce ul.products li.product .cagpc-card__price .woocommerce-Price-amount,
.woocommerce-page ul.products li.product .cagpc-card__price .woocommerce-Price-amount {
    font-size: 16px;
    color: #1a1a1a;
}

/* Hide ANY default WooCommerce / Elessi loop elements that may still render */
.woocommerce ul.products li.product .cagpc-product-card + a.woocommerce-LoopProduct-link,
.woocommerce ul.products li.product .cagpc-product-card ~ .price,
.woocommerce ul.products li.product .cagpc-product-card ~ .button,
.woocommerce ul.products li.product .cagpc-product-card ~ .star-rating,
.woocommerce ul.products li.product .product-img-wrap,
.woocommerce ul.products li.product .product-info-wrap,
.woocommerce ul.products li.product > .product-img-wrap,
.woocommerce ul.products li.product > .info {
    display: none;
}

/* Ensure our card is the only visible child */
.woocommerce ul.products li.product .cagpc-product-card {
    display: flex;
}
/* [CSS: WOOCOMMERCE-OVERRIDES] – END
 * ─────────────────────────────────────────── */
