/* ================================================
   FH WooCommerce Product Grid Widget
   Developer: Faizan Habib | https://faizanhabib.com
   ================================================ */

/* ── Grid ── */
.fh-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    width: 100%;
}

/* ── Card ── */
.fh-product-card {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.fh-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

/* ── Image ── */
.fh-product-card__image-wrap {
    position: relative;
    width: 100%;
    height: 260px;
    overflow: hidden;
    flex-shrink: 0;
}

.fh-product-card__image-wrap img,
.fh-product-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    transition: transform 0.35s ease;
}

.fh-product-card:hover .fh-product-card__image {
    transform: scale(1.04);
}

/* ── Badge ── */
.fh-product-card__badge {
    position: absolute;
    z-index: 2;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1;
    padding: 5px 12px;
    border-radius: 20px;
    background-color: #e63946;
    color: #ffffff;
    pointer-events: none;
}

.fh-badge--top-left     { top: 12px; left: 12px; }
.fh-badge--top-right    { top: 12px; right: 12px; }
.fh-badge--bottom-left  { bottom: 12px; left: 12px; }
.fh-badge--bottom-right { bottom: 12px; right: 12px; }

/* ── Body ── */
.fh-product-card__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    flex-grow: 1;
}

/* ── Category ── */
.fh-product-card__category {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #3d8bff;
    line-height: 1;
}

.fh-product-card__category a {
    color: inherit;
    text-decoration: none;
}

.fh-product-card__category a:hover {
    text-decoration: underline;
}

/* ── Title ── */
.fh-product-card__title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: #1a1a2e;
    margin: 0;
    padding: 0;
}

.fh-product-card__title a {
    color: inherit;
    text-decoration: none;
}

.fh-product-card__title a:hover {
    color: #3d8bff;
}

/* ── Tags ── */
.fh-product-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.fh-product-card__tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    color: #555555;
    background-color: #f2f2f2;
    border-radius: 20px;
    padding: 4px 10px;
    line-height: 1.3;
}

.fh-product-card__tag a {
    color: inherit;
    text-decoration: none;
}

.fh-product-card__tag:hover {
    background-color: #e5e5e5;
}

/* ── Swatches ── */
.fh-product-card__swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

/* GetWooPlugins swatch overrides inside card */
.fh-product-card__swatches .wvs-pro-wavs-wrap,
.fh-product-card__swatches .wvs-pro-wavs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0;
    padding: 0;
}

.fh-product-card__swatches .swatch-anchor {
    margin: 0 !important;
}

/* Native fallback swatches */
.fh-native-swatches__row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.fh-native-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    font-size: 11px;
    border: 1.5px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: border-color 0.2s;
}

.fh-native-swatch:hover {
    border-color: #333;
}

/* ── Rating ── */
.fh-product-card__rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fh-product-card__stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.fh-product-card__stars .fh-star-filled {
    color: #f5a623;
}

.fh-product-card__stars .fh-star-empty {
    color: #cccccc;
}

.fh-product-card__stars i,
.fh-product-card__stars svg {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.fh-product-card__rating-text {
    font-size: 12px;
    color: #666666;
    line-height: 1;
}

/* ── Footer (price + button) ── */
.fh-product-card__footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    flex-wrap: wrap;
}

/* ── Price ── */
.fh-product-card__price-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fh-product-card__price-label {
    font-size: 12px;
    font-weight: 600;
    color: #e63946;
}

.fh-product-card__price {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fh-product-card__price .woocommerce-Price-amount {
    font-size: 18px;
    font-weight: 700;
    color: #e63946;
}

.fh-product-card__price del {
    font-size: 13px;
    color: #aaaaaa;
    text-decoration: line-through;
}

.fh-product-card__price del .woocommerce-Price-amount {
    font-size: 13px;
    color: #aaaaaa;
}

.fh-product-card__price ins {
    text-decoration: none;
}

.fh-product-card__price ins .woocommerce-Price-amount {
    color: #e63946;
}

/* ── Button ── */
.fh-product-card__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: #ffffff;
    background-color: #1d6ff3;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    line-height: 1;
}

.fh-product-card__button:hover {
    background-color: #1558d0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29, 111, 243, 0.35);
    color: #ffffff;
    text-decoration: none;
}

/* ── No products ── */
.fh-no-products {
    text-align: center;
    padding: 32px;
    color: #888;
    font-style: italic;
}

/* ── Pagination ── */
.fh-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
    width: 100%;
}

.fh-pagination__item,
.fh-pagination__prev,
.fh-pagination__next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    background-color: #f5f5f5;
    color: #444444;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    line-height: 1;
    box-sizing: border-box;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.fh-pagination__prev,
.fh-pagination__next {
    padding: 8px 18px;
}

.fh-pagination__item:not(.fh-pagination__item--active):hover,
.fh-pagination__prev:not(.fh-pagination__prev--disabled):hover,
.fh-pagination__next:not(.fh-pagination__next--disabled):hover {
    background-color: #1d6ff3;
    color: #ffffff;
    text-decoration: none;
}

.fh-pagination__item--active {
    background-color: #1d6ff3;
    color: #ffffff;
    cursor: default;
}

.fh-pagination__dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 38px;
    color: #999999;
    font-weight: 700;
    background: transparent;
}

.fh-pagination__prev--disabled,
.fh-pagination__next--disabled {
    background-color: #f5f5f5;
    color: #bbbbbb;
    cursor: not-allowed;
    pointer-events: none;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 1024px) {
    .fh-product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .fh-product-grid {
        grid-template-columns: 1fr;
    }

    .fh-product-card__image-wrap {
        height: 220px;
    }

    .fh-product-card__footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .fh-product-card__button {
        width: 100%;
        justify-content: center;
    }

    .fh-pagination__item,
    .fh-pagination__prev,
    .fh-pagination__next,
    .fh-pagination__dots {
        min-width: 32px;
        height: 32px;
        padding: 6px 10px;
        font-size: 13px;
    }

    .fh-pagination__prev,
    .fh-pagination__next {
        padding: 6px 12px;
    }
}
