/* Nord Modules — Product Cards (moved unchanged from the "Product Cards v2" snippet) */

/* ---------- Card ---------- */
.woocommerce ul.products li.product,
.et_pb_module .woocommerce ul.products li.product {
    background: #fff !important;
    border: 0 !important;
    border-radius: 25px !important;
    padding: 20px !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    margin-bottom: 0 !important;
    transition: transform .3s ease, box-shadow .3s ease !important;
}

/* The whole card is one link. Make it a column that fills the card,
   so the specs sit at the bottom and line up across a row. */
.woocommerce ul.products li.product > a.woocommerce-LoopProduct-link {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    text-decoration: none;
}
.woocommerce ul.products li.product > a.woocommerce-LoopProduct-link:focus-visible {
    outline: 2px solid #c7893D;
    outline-offset: 8px;
    border-radius: 16px;
}

/* Lift only for real mouse hover — on phones a tap no longer leaves
   the card stuck in the raised state. */
@media (hover: hover) {
    .woocommerce ul.products li.product:hover,
    .et_pb_module .woocommerce ul.products li.product:hover {
        transform: translateY(-5px) !important;
        box-shadow: 0 12px 24px rgba(0, 0, 0, .08) !important;
    }
}
@media (prefers-reduced-motion: reduce) {
    .woocommerce ul.products li.product { transition: none !important; }
    .woocommerce ul.products li.product:hover { transform: none !important; }
}

/* Title */
.woocommerce ul.products li.product h3,
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h3 a,
.woocommerce ul.products li.product .woocommerce-loop-product__title a {
    font-size: 25px !important;
    font-weight: 600 !important;
    color: #00205c !important;
    margin: 15px 0 10px 0 !important;
    padding: 0 !important;
    line-height: 1.4 !important;
    text-decoration: none !important;
}

/* No Divi overlay icon / image fade on hover */
.woocommerce ul.products li.product .et_shop_image .et_overlay,
.et_pb_module .woocommerce ul.products li.product .et_shop_image .et_overlay {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}
.woocommerce ul.products li.product:hover .et_shop_image img,
.et_pb_module .woocommerce ul.products li.product:hover .et_shop_image img {
    opacity: 1 !important;
    transform: none !important;
}

/* ---------- Grid ---------- */
.woocommerce ul.products,
.et_pb_module .woocommerce ul.products {
    display: flex !important;
    flex-wrap: wrap !important;
    row-gap: 40px !important;
}
/* Clearfix pseudo-elements turn into empty flex items — not needed here */
.woocommerce ul.products::before,
.woocommerce ul.products::after {
    display: none !important;
}

/* ---------- Specs ---------- */
li.product .nc-specs {
    margin: auto 0 0;          /* pushes the specs to the bottom of the card */
    padding: 15px 0 0;
    font-size: 13px;
    line-height: 1.5;
}
li.product .nc-spec {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px dashed #e2e8f0;
}
li.product .nc-spec:last-child {
    border-bottom: 0;
}
li.product .nc-specs dt,
li.product .nc-specs dd {
    margin: 0;
    padding: 0;
    overflow-wrap: break-word;
}
li.product .nc-specs dt {
    color: #64748b;
    font-weight: 500;
}
li.product .nc-specs dd {
    color: #0f172a;
    font-weight: 600;
    text-align: right;
}

/* ---------- Tablet & phone (under 1024px) ---------- */
@media (max-width: 1023px) {

    /* Regular grids (shop, categories): 2 columns on tablets */
    .woocommerce ul.products,
    .et_pb_module .woocommerce ul.products {
        column-gap: 20px !important;
        row-gap: 24px !important;
    }
    html .woocommerce ul.products[class*="columns-"] li.product {
        width: calc(50% - 10px) !important;
        margin: 0 !important;
        float: none !important;
        clear: none !important;
    }

    /* Specs: label above value */
    li.product .nc-spec {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 9px 0;
        border-bottom: 1px solid #f1f5f9;
    }
    li.product .nc-specs dd {
        text-align: left;
    }

    /* Swipe carousel — only inside .product-mobile-carousel
       ([nord_similar], [nord_compatible], any wrapped [products]) */
    .product-mobile-carousel {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding-bottom: 16px !important;
        scroll-snap-type: x mandatory;      /* cards stop cleanly after a swipe */
        overscroll-behavior-x: contain;     /* swiping doesn't trigger browser back */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    html .product-mobile-carousel .woocommerce ul.products {
        display: flex !important;
        flex-wrap: nowrap !important;
        width: max-content !important;
        column-gap: 20px !important;
        padding: 5px 0 !important;
        margin: 0 !important;
    }
    html .product-mobile-carousel .woocommerce ul.products[class*="columns-"] li.product {
        flex: 0 0 280px !important;
        width: 280px !important;
        min-width: 280px !important;
        max-width: 280px !important;
        margin: 0 !important;
        float: none !important;
        scroll-snap-align: start;
    }
}

/* ---------- Phone (600px and under): 1 column in regular grids ---------- */
@media (max-width: 600px) {
    html .woocommerce ul.products[class*="columns-"] li.product {
        width: 100% !important;
    }
}
