/*
Theme Name: The Oak Fam Catalog
Description: Shophistic Lite child theme with responsive catalogue images and editable card details.
Template: shophistic-lite
Version: 1.3.2
Text Domain: oak-shophistic
*/

.woocommerce .products .product .oak-card-images {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 10px;
}

.woocommerce .products .product .oak-card-images .oak-card-primary {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    transform: none;
}

.woocommerce .products .product .oak-card-images .oak-card-secondary {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
    opacity: 0;
    pointer-events: none;
    transform: none;
    transition: opacity 180ms ease;
}

@media (hover: hover) and (pointer: fine) {
    .woocommerce .products .product:hover .oak-card-images.is-ready .oak-card-secondary,
    .woocommerce .products .product a:focus-visible .oak-card-images.is-ready .oak-card-secondary {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .woocommerce .products .product .oak-card-images .oak-card-secondary {
        transition: none;
    }
}

/* Keep the parent's subtle text outline, aligned with the indicator row. */
.woocommerce .products .oak-catalog-card .product_text {
    width: 100%;
    padding: 10px 10px 8px;
    border: 1px solid transparent;
    border-top: 0;
}

.woocommerce .products .oak-catalog-card:hover .product_text {
    border-color: #eee;
}

.woocommerce .products .oak-catalog-card .product_content_hidden {
    padding-bottom: 0;
}

.woocommerce .products .oak-catalog-card .product_text h3 {
    margin: 0 0 8px;
    line-height: 1.35;
}

.woocommerce .products .oak-catalog-card .oak-card-details {
    margin: 0 0 10px;
}

.woocommerce .products .oak-catalog-card .oak-card-detail {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: #555;
    overflow-wrap: anywhere;
}

.woocommerce .products .oak-catalog-card .oak-card-detail + .oak-card-detail {
    margin-top: 6px;
}

.woocommerce .products .oak-catalog-card .oak-card-detail-icon {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin-top: 1px;
}

.woocommerce .products .oak-catalog-card .oak-card-detail--feature .oak-card-detail-icon {
    color: #438553;
}

.woocommerce .products .oak-catalog-card .oak-card-detail--gift {
    color: #444;
}

.woocommerce .products .oak-catalog-card .oak-card-media {
    position: relative;
}

.oak-card-controls,
.oak-card-status {
    display: none;
}

/* Native vertical page scrolling; the script handles horizontal swipes. */
@media (max-width: 767px), (hover: none) and (pointer: coarse) {
    .woocommerce .products .oak-catalog-card .oak-card-images {
        touch-action: pan-y pinch-zoom;
        user-select: none;
        -webkit-user-select: none;
    }

    .woocommerce .products .oak-catalog-card .oak-card-images.is-oak-swipe .oak-card-primary,
    .woocommerce .products .oak-catalog-card .oak-card-images.is-oak-swipe .oak-card-secondary {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 180ms ease;
        pointer-events: none;
        -webkit-user-drag: none;
    }

    .woocommerce .products .oak-catalog-card .oak-card-images.is-oak-swipe .oak-card-primary {
        transform: translate3d(var(--oak-current-offset, 0%), 0, 0);
    }

    .woocommerce .products .oak-catalog-card .oak-card-images.is-oak-swipe .oak-card-secondary {
        left: 0;
        right: auto;
        opacity: 0 !important;
        transform: translate3d(var(--oak-incoming-offset, 100%), 0, 0);
    }

    .woocommerce .products .oak-catalog-card .oak-card-images.is-oak-incoming .oak-card-secondary {
        opacity: 1 !important;
    }

    .woocommerce .products .oak-catalog-card .oak-card-images.is-dragging img,
    .woocommerce .products .oak-catalog-card .oak-card-images.is-resetting img {
        transition: none;
    }

    .woocommerce .products .oak-catalog-card .oak-card-controls {
        position: static;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        height: 24px;
        margin: 0;
        padding: 0;
        border: 1px solid transparent;
        border-top: 0;
        border-bottom: 0;
        gap: 0;
        transform: none;
        background: transparent;
        box-sizing: border-box;
    }

    .woocommerce .products .oak-catalog-card:hover .oak-card-controls {
        border-color: #eee;
    }

    .woocommerce .products .oak-catalog-card .has-oak-controls + .product_text {
        padding-top: 0;
    }

    .woocommerce .products .oak-catalog-card .oak-card-controls button {
        display: inline-flex;
        flex: 0 0 24px;
        align-items: center;
        justify-content: center;
        width: 24px;
        max-width: 24px;
        min-width: 0;
        height: 24px;
        padding: 0;
        margin: 0;
        border: 0;
        border-radius: 14px;
        background: transparent;
        box-shadow: none;
        cursor: pointer;
        touch-action: manipulation;
    }

    .woocommerce .products .oak-catalog-card .oak-card-controls button span {
        display: block;
        width: 4px;
        max-width: 80%;
        height: 4px;
        border-radius: 4px;
        background: #c3c3c3;
    }

    .woocommerce .products .oak-catalog-card .oak-card-controls button[aria-pressed="true"] span {
        width: 14px;
        background: #444;
    }

    .woocommerce .products .oak-catalog-card .oak-card-controls button:focus-visible {
        outline: 2px solid #444;
        outline-offset: -2px;
    }

    .woocommerce .products .oak-catalog-card .oak-card-status {
        display: block;
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

/* Replace percentage inline-block arithmetic with two actual mobile columns. */
@media (max-width: 767px) {
    body:not(.woocommerce-cart):not(.woocommerce-checkout) #main ul.products {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 12px;
        row-gap: 22px;
        align-items: start;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        white-space: normal !important;
        letter-spacing: normal;
        word-spacing: normal;
        overflow: visible !important;
    }

    body:not(.woocommerce-cart):not(.woocommerce-checkout) #main ul.products::before,
    body:not(.woocommerce-cart):not(.woocommerce-checkout) #main ul.products::after {
        content: none !important;
        display: none !important;
    }

    body:not(.woocommerce-cart):not(.woocommerce-checkout) #main ul.products > li.product {
        display: block !important;
        width: 100% !important;
        min-width: 0;
        max-width: 100%;
        margin: 0 !important;
        float: none !important;
        clear: none !important;
        box-sizing: border-box;
    }

    body:not(.woocommerce-cart):not(.woocommerce-checkout) #main ul.products .product_text,
    body:not(.woocommerce-cart):not(.woocommerce-checkout) #main ul.products .product_text h3,
    body:not(.woocommerce-cart):not(.woocommerce-checkout) #main ul.products .product_text h3 a {
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

@media (prefers-reduced-motion: reduce) {
    .woocommerce .products .oak-catalog-card .oak-card-images.is-oak-swipe .oak-card-primary,
    .woocommerce .products .oak-catalog-card .oak-card-images.is-oak-swipe .oak-card-secondary {
        transition: none;
    }
}
