/* ==========================================================================
   Lincs Lootcave Shop Card

   Single source of truth for product-card presentation on WooCommerce
   Product Collection shop/category archives.

   Live WooCommerce block DOM:
     li.wc-block-product.ll-v3-product-card
     .wc-block-components-product-image
     .wp-block-post-title
     .wp-block-woocommerce-product-price
     .wc-block-components-product-price
     .wp-block-woocommerce-product-button
     .wc-block-components-product-button__button
     .llce-wish

   Owns:
     - card shell
     - product media
     - title alignment
     - price presentation
     - save control
     - purchase CTA
     - sold-out visual treatment
     - responsive card presentation

   Does NOT own:
     - catalogue grid columns / gaps
     - sidebar / filters
     - no-results state
     - single product pages

   Catalogue grid owner:
     modules/shop/assets/shop-layout.css
   ========================================================================== */


/* ==========================================================
   Card shell
   ========================================================== */

body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card {
    box-sizing: border-box !important;

    position: relative !important;
    isolation: isolate !important;

    display: flex !important;
    flex-direction: column !important;

    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;

    margin: 0 !important;
    padding: 12px !important;

    overflow: hidden !important;

    border: 1px solid rgba(247, 201, 72, 0.23) !important;
    border-radius: 20px !important;

    background:
        radial-gradient(
            circle at 8% 0%,
            rgba(140, 255, 26, 0.055),
            transparent 31%
        ),
        radial-gradient(
            circle at 100% 100%,
            rgba(123, 44, 255, 0.13),
            transparent 42%
        ),
        linear-gradient(
            150deg,
            rgba(10, 12, 19, 0.985),
            rgba(7, 8, 14, 0.99) 56%,
            rgba(14, 9, 24, 0.985)
        ) !important;

    box-shadow:
        0 15px 34px rgba(0, 0, 0, 0.33),
        inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;

    color: #fffaf0 !important;

    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease !important;
}


/*
 * Thin internal highlight gives the card depth without making the border
 * look like a glowing neon frame.
 */
body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card::before {
    content: "" !important;

    position: absolute !important;
    inset: 0 !important;

    z-index: -1 !important;

    border-radius: inherit !important;

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.025),
            transparent 34%,
            transparent 68%,
            rgba(128, 54, 226, 0.055)
        ) !important;

    pointer-events: none !important;
}


@media (hover: hover) and (pointer: fine) {

    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card:hover {
        transform: translateY(-3px) !important;

        border-color: rgba(247, 201, 72, 0.38) !important;

        box-shadow:
            0 21px 44px rgba(0, 0, 0, 0.42),
            0 0 24px rgba(123, 44, 255, 0.045),
            inset 0 1px 0 rgba(255, 255, 255, 0.045) !important;
    }
}


/* ==========================================================
   Product image
   ========================================================== */

body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card
> .wc-block-components-product-image {
    box-sizing: border-box !important;

    position: relative !important;

    width: 100% !important;

    aspect-ratio: 1 / 1 !important;

    margin: 0 0 13px !important;
    padding: 0 !important;

    overflow: hidden !important;

    border: 1px solid rgba(247, 201, 72, 0.16) !important;
    border-radius: 15px !important;

    background:
        radial-gradient(
            circle at 50% 40%,
            rgba(255, 255, 255, 0.055),
            transparent 60%
        ),
        rgba(255, 255, 255, 0.018) !important;

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.035),
        0 8px 20px rgba(0, 0, 0, 0.25) !important;
}


body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card
> .wc-block-components-product-image
> a {
    display: block !important;

    width: 100% !important;
    height: 100% !important;

    margin: 0 !important;
    padding: 0 !important;
}


body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card
> .wc-block-components-product-image
img {
    display: block !important;

    width: 100% !important;
    height: 100% !important;

    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;
    border-radius: 14px !important;

    object-fit: cover !important;
    object-position: center !important;

    transition:
        transform 220ms ease,
        filter 220ms ease !important;
}


@media (hover: hover) and (pointer: fine) {

    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card:hover
    > .wc-block-components-product-image
    img {
        transform: scale(1.025) !important;
    }
}


/* ==========================================================
   Wishlist / save button
   ========================================================== */

body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card
> .llce-wish {
    box-sizing: border-box !important;

    position: absolute !important;

    top: 20px !important;
    right: 20px !important;

    z-index: 15 !important;

    display: grid !important;
    place-items: center !important;

    width: 38px !important;
    height: 38px !important;

    min-width: 38px !important;
    min-height: 38px !important;
    max-width: 38px !important;
    max-height: 38px !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow: hidden !important;

    border: 1px solid rgba(247, 201, 72, 0.48) !important;
    border-radius: 12px !important;

    background: rgba(6, 8, 14, 0.82) !important;

    color: transparent !important;

    font-size: 0 !important;
    line-height: 0 !important;

    text-indent: -9999px !important;

    box-shadow:
        0 7px 17px rgba(0, 0, 0, 0.37),
        inset 0 1px 0 rgba(255, 255, 255, 0.055) !important;

    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;

    cursor: pointer !important;

    transition:
        transform 160ms ease,
        border-color 160ms ease,
        background 160ms ease,
        box-shadow 160ms ease !important;
}


body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card
> .llce-wish::before {
    content: "♡" !important;

    display: block !important;

    width: 1em !important;
    height: 1em !important;

    color: #f7c948 !important;

    font-family: Arial, sans-serif !important;
    font-size: 24px !important;
    font-weight: 400 !important;
    line-height: 1 !important;

    text-align: center !important;
    text-indent: 0 !important;

    transform: none !important;
}


body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card
> .llce-wish:hover {
    transform: translateY(-1px) !important;

    border-color: rgba(140, 255, 26, 0.5) !important;

    background: rgba(13, 19, 12, 0.9) !important;

    box-shadow:
        0 9px 20px rgba(0, 0, 0, 0.4),
        0 0 15px rgba(140, 255, 26, 0.055) !important;
}


body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card
> .llce-wish.is-saved {
    border-color: rgba(140, 255, 26, 0.62) !important;

    background:
        linear-gradient(
            145deg,
            rgba(62, 113, 26, 0.95),
            rgba(24, 59, 17, 0.98)
        ) !important;

    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.38),
        0 0 16px rgba(140, 255, 26, 0.08) !important;
}


body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card
> .llce-wish.is-saved::before {
    content: "♥" !important;

    color: #b3ff6b !important;
}


/* ==========================================================
   Product title
   ========================================================== */

body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card
> .wp-block-post-title {
    box-sizing: border-box !important;

    display: -webkit-box !important;

    width: 100% !important;

    min-height: 2.75em !important;
    max-height: 2.75em !important;

    margin: 0 0 7px !important;
    padding: 0 !important;

    overflow: hidden !important;

    color: #fff5df !important;

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif !important;

    font-size: 14px !important;
    font-weight: 760 !important;
    line-height: 1.38 !important;
    letter-spacing: -0.012em !important;

    text-align: left !important;

    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
}


body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card
> .wp-block-post-title
a {
    color: inherit !important;

    text-decoration: none !important;
}


body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card
> .wp-block-post-title
a:hover {
    color: #ffffff !important;
}


/* ==========================================================
   Price
   ========================================================== */

body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card
> .wp-block-woocommerce-product-price {
    width: 100% !important;

    margin: 0 0 11px !important;
    padding: 0 !important;

    text-align: left !important;
}


body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card
.wc-block-components-product-price {
    width: 100% !important;

    margin: 0 !important;
    padding: 0 !important;

    color: #f7c948 !important;

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif !important;

    font-size: 20px !important;
    font-weight: 900 !important;
    line-height: 1.1 !important;
    letter-spacing: -0.035em !important;

    text-align: left !important;

    text-shadow:
        0 0 14px rgba(247, 201, 72, 0.1) !important;
}


body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card
.wc-block-components-product-price
.amount,
body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card
.wc-block-components-product-price
bdi {
    color: inherit !important;
    font: inherit !important;
}


/* ==========================================================
   Availability indicator

   The product LI already carries WooCommerce's stock classes:
     .instock
     .outofstock

   This adds a clean visual status without requiring duplicate PHP markup.
   ========================================================== */

body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card::after {
    content: "IN STOCK" !important;

    position: relative !important;

    z-index: 2 !important;

    display: inline-flex !important;
    align-items: center !important;

    align-self: flex-start !important;

    min-height: 22px !important;

    margin: 3px 0 14px !important;
    padding: 4px 8px 4px 18px !important;

    border: 1px solid rgba(140, 255, 26, 0.28) !important;
    border-radius: 999px !important;

    background:
        radial-gradient(
            circle at 9px 50%,
            #8cff1a 0 2px,
            transparent 2.6px
        ),
        rgba(140, 255, 26, 0.055) !important;

    color: #a6ff54 !important;

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        sans-serif !important;

    font-size: 9px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    letter-spacing: 0.085em !important;

    text-transform: uppercase !important;
}


body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card.outofstock::after,
body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card.ll-v3-product-sold-out::after,
body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card.ll-v3-product-effectively-sold-out::after {
    content: "SOLD OUT" !important;

    visibility: hidden !important;

    border-color: transparent !important;
    background: transparent !important;
    color: transparent !important;

    box-shadow: none !important;
}


/* ==========================================================
   Product button wrapper
   ========================================================== */

body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card
> .wp-block-woocommerce-product-button {
    display: flex !important;

    width: 100% !important;

    margin: auto 0 0 !important;
    padding: 0 !important;

    align-items: stretch !important;
    justify-content: stretch !important;
}


/* ==========================================================
   Add to basket / product action
   ========================================================== */

body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card
.wc-block-components-product-button__button {
    box-sizing: border-box !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 100% !important;

    min-width: 0 !important;
    min-height: 42px !important;

    margin: 0 !important;
    padding: 10px 12px !important;

    border: 1px solid rgba(247, 201, 72, 0.72) !important;
    border-radius: 11px !important;

    background:
        linear-gradient(
            135deg,
            #ffe064 0%,
            #f7c948 52%,
            #e5a92c 100%
        ) !important;

    color: #0a0b0d !important;

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        sans-serif !important;

    font-size: 13px !important;
    font-weight: 900 !important;
    line-height: 1.15 !important;
    letter-spacing: -0.008em !important;

    text-align: center !important;

    text-decoration: none !important;

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 8px 18px rgba(247, 201, 72, 0.11) !important;

    cursor: pointer !important;

    transition:
        transform 160ms ease,
        box-shadow 160ms ease,
        filter 160ms ease !important;
}


body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card
.wc-block-components-product-button__button:hover {
    transform: translateY(-1px) !important;

    filter: brightness(1.045) !important;

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.34),
        0 10px 22px rgba(247, 201, 72, 0.16) !important;
}


/* ==========================================================
   Sold-out presentation
   ========================================================== */

body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card.outofstock
> .wc-block-components-product-image
img,
body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card.ll-v3-product-sold-out
> .wc-block-components-product-image
img,
body:not(.wp-admin)
ul.wc-block-product-template
> li.wc-block-product.ll-v3-product-card.ll-v3-product-effectively-sold-out
> .wc-block-components-product-image
img {
    filter:
        saturate(0.62)
        brightness(0.7) !important;
}


/*
 * Existing late visual-skin rules may add the diagonal sold-out ribbon to
 * block cards. The card owner intentionally leaves that behaviour compatible
 * during migration.
 */


/* ==========================================================
   Tablet
   ========================================================== */

@media (max-width: 900px) {

    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card {
        padding: 11px !important;

        border-radius: 18px !important;
    }


    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card
    > .wc-block-components-product-image {
        margin-bottom: 11px !important;

        border-radius: 14px !important;
    }


    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card
    > .wc-block-components-product-image
    img {
        border-radius: 13px !important;
    }


    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card
    > .llce-wish {
        top: 18px !important;
        right: 18px !important;

        width: 36px !important;
        height: 36px !important;

        min-width: 36px !important;
        min-height: 36px !important;
        max-width: 36px !important;
        max-height: 36px !important;
    }


    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card
    > .llce-wish::before {
        font-size: 22px !important;
    }
}


/* ==========================================================
   Mobile
   ========================================================== */

@media (max-width: 640px) {

    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card {
        padding: 8px !important;

        border-radius: 15px !important;

        box-shadow:
            0 10px 24px rgba(0, 0, 0, 0.28),
            inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
    }


    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card
    > .wc-block-components-product-image {
        margin-bottom: 9px !important;

        border-radius: 11px !important;
    }


    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card
    > .wc-block-components-product-image
    img {
        border-radius: 10px !important;
    }


    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card
    > .llce-wish {
        top: 14px !important;
        right: 14px !important;

        width: 32px !important;
        height: 32px !important;

        min-width: 32px !important;
        min-height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;

        border-radius: 10px !important;
    }


    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card
    > .llce-wish::before {
        font-size: 20px !important;
    }


    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card
    > .wp-block-post-title {
        min-height: 2.64em !important;
        max-height: 2.64em !important;

        margin-bottom: 5px !important;

        font-size: 12px !important;
        line-height: 1.32 !important;
    }


    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card
    > .wp-block-woocommerce-product-price {
        margin-bottom: 8px !important;
    }


    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card
    .wc-block-components-product-price {
        font-size: 17px !important;
    }


    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card::after {
        min-height: 19px !important;

        margin: 2px 0 11px !important;

        padding:
            3px
            7px
            3px
            16px !important;

        background:
            radial-gradient(
                circle at 8px 50%,
                #8cff1a 0 1.8px,
                transparent 2.3px
            ),
            rgba(140, 255, 26, 0.055) !important;

        font-size: 8px !important;
    }


    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card
    .wc-block-components-product-button__button {
        min-height: 38px !important;

        padding: 8px 7px !important;

        border-radius: 9px !important;

        font-size: 11px !important;
        line-height: 1.15 !important;
    }
}


/* ==========================================================
   Very narrow mobile
   ========================================================== */

@media (max-width: 380px) {

    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card {
        padding: 7px !important;
    }


    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card
    > .wp-block-post-title {
        font-size: 11.5px !important;
    }


    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card
    .wc-block-components-product-price {
        font-size: 16px !important;
    }


    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card
    .wc-block-components-product-button__button {
        font-size: 10.5px !important;
    }
}


/* ==========================================================
   SAFARI / IPAD PRODUCT MEDIA STABILITY

   Physical iPad Safari can resolve percentage heights inside
   aspect-ratio flex children differently from Chromium's
   responsive-device emulation.

   Keep the square media shell authoritative and remove the
   child percentage-height dependency.
   ========================================================== */

@supports (-webkit-touch-callout: none) {

    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card
    > .wc-block-components-product-image {
        display: block !important;

        width: 100% !important;
        max-width: 100% !important;

        height: auto !important;
        min-height: 0 !important;

        aspect-ratio: 1 / 1 !important;

        flex: 0 0 auto !important;
    }

    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card
    > .wc-block-components-product-image
    > a {
        display: block !important;

        width: 100% !important;
        max-width: 100% !important;

        height: auto !important;

        aspect-ratio: 1 / 1 !important;
    }

    body:not(.wp-admin)
    ul.wc-block-product-template
    > li.wc-block-product.ll-v3-product-card
    > .wc-block-components-product-image
    img {
        display: block !important;

        width: 100% !important;
        max-width: 100% !important;

        height: auto !important;

        aspect-ratio: 1 / 1 !important;

        object-fit: cover !important;
        object-position: center !important;
    }
}
