/* H&G SearchWP Product Grid v2.3.1
   Styles the browser-enhanced result cards (see searchwp-product-grid.js). */

/* Keep Enfold from clipping the grid. */
body.hag-searchwp-grid-active .template-search,
body.hag-searchwp-grid-active main,
body.hag-searchwp-grid-active #main {
    overflow: visible;
}

/* Hide leftover Enfold list scaffolding between/after cards. */
body.hag-searchwp-grid-active .post_delimiter,
body.hag-searchwp-grid-active .hag-swp-card + .post_delimiter,
body.hag-searchwp-grid-active .hag-swp-card .post-meta-infos,
body.hag-searchwp-grid-active .hag-swp-card .blog-categories,
body.hag-searchwp-grid-active .hag-swp-card .text-sep {
    display: none !important;
}

body.hag-searchwp-grid-active .hag-swp-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 30px !important;
    align-items: stretch !important;
    width: 100% !important;
    margin: 30px 0 0 !important;
    padding: 0 !important;
    clear: both !important;
    list-style: none !important;
}

body.hag-searchwp-grid-active .hag-swp-card {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #fff !important;
    border: 1px solid #e1e3e5 !important;
    border-radius: 24px !important;
    box-shadow: 0 12px 30px rgba(35, 47, 55, .07) !important;
    list-style: none !important;
}

body.hag-searchwp-grid-active .hag-swp-card-media {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 300px !important;
    min-height: 300px !important;
    padding: 22px !important;
    overflow: hidden !important;
    background: #f4f1ea !important;
    text-decoration: none !important;
}

body.hag-searchwp-grid-active .hag-swp-card-media img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 256px !important;
    margin: 0 auto !important;
    object-fit: contain !important;
    background: transparent !important;
    border-radius: 0 !important;
}

body.hag-searchwp-grid-active .hag-swp-image-placeholder {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    background: #eceadf !important;
}

body.hag-searchwp-grid-active .hag-swp-card-badge {
    position: absolute !important;
    top: 16px !important;
    left: 16px !important;
    z-index: 2 !important;
    display: inline-flex !important;
    align-items: center !important;
    padding: 9px 16px !important;
    border-radius: 999px !important;
    background: #32647f !important;
    color: #fff !important;
    font-size: 12px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    letter-spacing: .07em !important;
    text-transform: uppercase !important;
}

body.hag-searchwp-grid-active .hag-swp-card-body {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    min-width: 0 !important;
    padding: 24px 26px 26px !important;
}

body.hag-searchwp-grid-active .hag-swp-card-title,
body.hag-searchwp-grid-active .hag-swp-card-desc {
    max-width: 100% !important;
}

body.hag-searchwp-grid-active .hag-swp-card-title {
    display: -webkit-box !important;
    min-height: 47px !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
    overflow: hidden !important;
    color: #202527 !important;
    font-size: 18px !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
}

body.hag-searchwp-grid-active .hag-swp-card-title a {
    color: #202527 !important;
    white-space: normal !important;
    text-decoration: none !important;
}

body.hag-searchwp-grid-active .hag-swp-card-desc {
    display: -webkit-box !important;
    margin: 0 0 16px !important;
    padding: 0 !important;
    overflow: hidden !important;
    color: #6b7075 !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    font-weight: 400 !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 1 !important;
}

body.hag-searchwp-grid-active .hag-swp-card-prices {
    display: flex !important;
    align-items: baseline !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    margin: auto 0 14px !important;
}

body.hag-searchwp-grid-active .hag-swp-card-old-price,
body.hag-searchwp-grid-active .hag-swp-card-old-price .amount {
    color: #8f9295 !important;
    font-size: 18px !important;
    font-weight: 500 !important;
    text-decoration: line-through !important;
}

body.hag-searchwp-grid-active .hag-swp-card-price-dot {
    color: #202527 !important;
    font-size: 20px !important;
    font-weight: 800 !important;
}

body.hag-searchwp-grid-active .hag-swp-card-current-price,
body.hag-searchwp-grid-active .hag-swp-card-current-price .amount {
    color: #111 !important;
    font-size: 23px !important;
    font-weight: 800 !important;
}

body.hag-searchwp-grid-active .hag-swp-card-saving {
    align-self: flex-start !important;
    margin: 0 0 18px !important;
    padding: 9px 16px !important;
    border-radius: 999px !important;
    background: #f4e3d8 !important;
    color: #c15f35 !important;
    font-size: 15px !important;
    line-height: 1.1 !important;
    font-weight: 800 !important;
}

body.hag-searchwp-grid-active .hag-swp-card-button {
    display: block !important;
    width: 100% !important;
    margin: auto 0 0 !important;
    padding: 15px 18px !important;
    border: 1px solid #d7e0e5 !important;
    border-radius: 14px !important;
    background: #edf3f6 !important;
    color: #2e5367 !important;
    font-size: 17px !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
    text-align: center !important;
    text-decoration: none !important;
}

body.hag-searchwp-grid-active .hag-swp-card-button:hover {
    background: #e1ebef !important;
    color: #23485d !important;
}

@media (max-width: 1200px) {
    body.hag-searchwp-grid-active .hag-swp-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 24px !important;
    }
}

@media (max-width: 900px) {
    body.hag-searchwp-grid-active .hag-swp-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 20px !important;
    }
    body.hag-searchwp-grid-active .hag-swp-card-media {
        height: 260px !important;
        min-height: 260px !important;
    }
    body.hag-searchwp-grid-active .hag-swp-card-body {
        padding: 20px 20px 22px !important;
    }
}

/* Phones — single column, compact card so the whole product fits the screen */
@media (max-width: 600px) {
    body.hag-searchwp-grid-active .hag-swp-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 16px !important;
        margin-top: 18px !important;
    }
    body.hag-searchwp-grid-active .hag-swp-card {
        border-radius: 18px !important;
    }
    body.hag-searchwp-grid-active .hag-swp-card-media {
        height: 200px !important;
        min-height: 200px !important;
        padding: 14px !important;
    }
    body.hag-searchwp-grid-active .hag-swp-card-media img {
        max-height: 172px !important;
    }
    body.hag-searchwp-grid-active .hag-swp-card-body {
        padding: 18px 20px 20px !important;
    }
    body.hag-searchwp-grid-active .hag-swp-card-title {
        min-height: 0 !important;
        font-size: 17px !important;
        margin-bottom: 8px !important;
    }
    body.hag-searchwp-grid-active .hag-swp-card-desc {
        margin-bottom: 12px !important;
    }
    body.hag-searchwp-grid-active .hag-swp-card-prices {
        margin-bottom: 10px !important;
    }
    body.hag-searchwp-grid-active .hag-swp-card-saving {
        margin-bottom: 14px !important;
        padding: 7px 14px !important;
        font-size: 14px !important;
    }
    body.hag-searchwp-grid-active .hag-swp-card-current-price,
    body.hag-searchwp-grid-active .hag-swp-card-current-price .amount {
        font-size: 21px !important;
    }
    body.hag-searchwp-grid-active .hag-swp-card-button {
        font-size: 16px !important;
        padding: 13px 16px !important;
    }
}

/* Narrow phones — keep the single column, shrink the image box a touch more */
@media (max-width: 380px) {
    body.hag-searchwp-grid-active .hag-swp-card-body {
        padding: 16px 16px 18px !important;
    }
    body.hag-searchwp-grid-active .hag-swp-card-media {
        height: 180px !important;
        min-height: 180px !important;
    }
    body.hag-searchwp-grid-active .hag-swp-card-media img {
        max-height: 152px !important;
    }
}
