/* =========================================================
   GPLMART HOMEPAGE FILTER — SCOPED CSS FIX (BLUE EDITION)
   Product-grid/card styling is restricted to #gplmart-grid.
   This prevents Homepage Filter styles from affecting the TGM Elementor grid.
   Load More / View All controls remain outside-grid selectors as in the original.
   ========================================================= */
/* =========================================================
   GPLMART HOMEPAGE FILTER — CLEAN & OPTIMIZED STYLESHEET
   Responsive product cards, badges, prices and buttons
   ========================================================= */

/* ---------- Product grid ---------- */
#gplmart-grid{
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

/* ---------- Product card ---------- */
#gplmart-grid .gplmart-card{
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    isolation: isolate;
    box-sizing: border-box;
    border: 1px solid #d7dee5 !important;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(15,23,42,.055), 0 14px 32px rgba(15,23,42,.055);
    transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}

#gplmart-grid .gplmart-card::before{
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: transparent;
    pointer-events: none;
    z-index: 1;
}

#gplmart-grid .gplmart-card:hover{
    transform: translateY(-4px);
    border-color: #93c5fd !important;
    box-shadow: 0 12px 28px rgba(15,23,42,.09), 0 22px 44px rgba(50,32,180,.12);
}

/* ---------- Product image and type badge ---------- */
#gplmart-grid .gplmart-image{
    position: relative;
    width: 100%;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    isolation: isolate;
    border: 0;
    border-radius: 0;
    background: linear-gradient(145deg, #f8fafc 0%, #eef2f5 100%);
    box-shadow: none;
}

#gplmart-grid .gplmart-image img{
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    object-position: center;
    background: transparent;
    border-radius: 0;
    transform: translateZ(0);
    transition: transform .4s cubic-bezier(.2,.7,.2,1), filter .4s ease;
}

#gplmart-grid .gplmart-card:hover .gplmart-image img{
    transform: scale(1.025);
    filter: none;
}

#gplmart-grid .gplmart-type-badge{
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: calc(100% - 24px);
    padding: 5px 10px 5px 9px;
    overflow: hidden;
    border: 1px solid rgba(147,197,253,.28);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(12,18,48,.78), rgba(20,32,84,.72) 55%, rgba(8,12,32,.82));
    box-shadow: 0 10px 24px rgba(0,0,0,.26), 0 1px 0 rgba(255,255,255,.12) inset, 0 0 0 1px rgba(0,0,0,.14);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    backdrop-filter: blur(16px) saturate(150%);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .08em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
    transition: transform .28s ease, box-shadow .28s ease, background .28s ease, border-color .28s ease;
}

#gplmart-grid .gplmart-type-badge::before{
    content: "";
    position: relative;
    z-index: 1;
    flex: 0 0 5px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(255,255,255,.06);
}

#gplmart-grid .gplmart-type-badge::after{
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,.16), transparent 34%, rgba(255,255,255,.03) 68%, transparent), radial-gradient(circle at 20% 18%, rgba(50,32,180,.2), transparent 35%);
    pointer-events: none;
}

#gplmart-grid .badge-theme{ color: #93c5fd; border-color: rgba(147,197,253,.24); }
#gplmart-grid .badge-theme::before{ background: linear-gradient(180deg,#dbeafe,#3220b4); box-shadow: 0 0 0 3px rgba(50,32,180,.15), 0 0 12px rgba(50,32,180,.3); }
#gplmart-grid .badge-plugin{ color: #93c5fd; border-color: rgba(147,197,253,.24); }
#gplmart-grid .badge-plugin::before{ background: linear-gradient(180deg,#dbeafe,#3220b4); box-shadow: 0 0 0 3px rgba(50,32,180,.15), 0 0 12px rgba(50,32,180,.3); }
#gplmart-grid .badge-membership{ color: #fcd34d; border-color: rgba(252,211,77,.24); }
#gplmart-grid .badge-membership::before{ background: linear-gradient(180deg,#fef3c7,#f59e0b); box-shadow: 0 0 0 3px rgba(245,158,11,.12), 0 0 12px rgba(245,158,11,.26); }
#gplmart-grid .badge-updater{ color: #c4b5fd; border-color: rgba(196,181,253,.24); }
#gplmart-grid .badge-updater::before{ background: linear-gradient(180deg,#ede9fe,#8b5cf6); box-shadow: 0 0 0 3px rgba(139,92,246,.12), 0 0 12px rgba(139,92,246,.26); }
#gplmart-grid .badge-product{ color: #e5e7eb; border-color: rgba(229,231,235,.18); }
#gplmart-grid .badge-product::before{ background: linear-gradient(180deg,#f3f4f6,#9ca3af); box-shadow: 0 0 0 3px rgba(156,163,175,.10), 0 0 10px rgba(156,163,175,.20); }

/* ---------- Card content, category and title ---------- */
#gplmart-grid .gplmart-content{
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    padding: 0 16px 16px;
}

#gplmart-grid .gplmart-category{
    position: relative;
    top: 5px;
    display: inline-flex;
    align-self: center;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    margin-bottom: 12px;
    padding: 5px 12px;
    overflow: hidden;
    box-sizing: border-box;
    border: 1px solid #d9dee5;
    border-radius: 999px;
    background: #f7f8fa;
    box-shadow: 0 1px 2px rgba(15,23,42,.035);
    color: #5b6472;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.25;
    text-transform: uppercase;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#gplmart-grid .gplmart-category::before{
    content: "";
    display: inline-block;
    flex: 0 0 12px;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    background-color: #6b7280;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9.568 3H5.25A2.25 2.25 0 0 0 3 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581a2.25 2.25 0 0 0 3.181 0l5.103-5.103a2.25 2.25 0 0 0 0-3.181l-9.581-9.58A2.25 2.25 0 0 0 9.568 3Z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 6h.008v.008H6V6Z'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9.568 3H5.25A2.25 2.25 0 0 0 3 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581a2.25 2.25 0 0 0 3.181 0l5.103-5.103a2.25 2.25 0 0 0 0-3.181l-9.581-9.58A2.25 2.25 0 0 0 9.568 3Z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 6h.008v.008H6V6Z'/%3E%3C/svg%3E") no-repeat center / contain;
}

#gplmart-grid .gplmart-title{
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    min-height: calc(1.3em * 2);
    max-height: calc(1.3em * 2);
    margin: 0 0 12px;
    padding: 0 0 12px;
    overflow: hidden;
    overflow-wrap: anywhere;
    border-bottom: 1px dashed rgba(15,23,42,.12);
    color: #111827;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    text-overflow: ellipsis;
}

#gplmart-grid .gplmart-title a{
    color: inherit;
    font: inherit;
    text-decoration: none;
}

/* ---------- Discount badge ---------- */
#gplmart-grid .gplmart-discount{
    position: relative;
    z-index: 6;
    display: flex;
    align-self: flex-start;
    justify-content: flex-start;
    margin: 0;
}

#gplmart-grid .gplmart-discount span,
#gplmart-grid .gplmart-discount .amount,
#gplmart-grid .gplmart-discount b{
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 4px 11px 4px 10px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 0 999px 999px 0;
    background: linear-gradient(135deg,#111827 0%,#1f2937 48%,#3220b4 100%);
    box-shadow: 0 12px 26px rgba(15,23,42,.24), 0 24px 44px rgba(50,32,180,.12), inset 0 1px 0 rgba(255,255,255,.10);
    color: #eef2ff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

#gplmart-grid .gplmart-discount span::before,
#gplmart-grid .gplmart-discount .amount::before,
#gplmart-grid .gplmart-discount b::before{
    content: "";
    display: inline-block;
    flex: 0 0 11px;
    width: 11px;
    height: 11px;
    margin-right: 5px;
    clip-path: polygon(50% 0%,61% 36%,100% 36%,67% 58%,78% 100%,50% 76%,22% 100%,33% 58%,0 36%,39% 36%);
    background: linear-gradient(180deg,#fde68a,#f59e0b);
}

#gplmart-grid .gplmart-discount span::after,
#gplmart-grid .gplmart-discount .amount::after,
#gplmart-grid .gplmart-discount b::after{
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg,transparent 0%,rgba(255,255,255,.16) 35%,rgba(255,255,255,.04) 50%,transparent 65%);
    transform: translateX(-120%);
    animation: badgeSweep 3.2s infinite;
}

@keyframes badgeSweep {
    0% { transform: translateX(-120%); }
    55%, 100% { transform: translateX(120%); }
}

/* ---------- Price capsule ---------- */
#gplmart-grid .gplmart-bottom{
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 9px;
    margin-top: auto;
    padding-top: 6px;
}

#gplmart-grid .gplmart-price{
    position: relative;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    gap: 5px;
    width: fit-content;
    margin: -1px 0 1px;
    padding: 3px 13px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 0 999px 999px 0;
    background: linear-gradient(180deg,#3220b4 0%,#23148a 100%);
    box-shadow: 0 6px 14px rgba(50,32,180,.2), 0 1px 0 rgba(255,255,255,.2) inset;
}

#gplmart-grid .gplmart-price del{
    color: rgba(255,255,255,.68);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.15;
    text-decoration: line-through;
}

#gplmart-grid .gplmart-price ins{
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.01em;
    text-decoration: none;
}

#gplmart-grid .gplmart-price ins .amount,
#gplmart-grid .gplmart-price ins .woocommerce-Price-amount,
#gplmart-grid .gplmart-price ins bdi{
    color: inherit;
    font: inherit;
}

/* ---------- Buy button ---------- */
#gplmart-grid .gplmart-buy-btn{
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    width: 100% !important;
    min-height: 44px !important;
    height: 44px !important;
    padding: 8px 16px !important;
    border: 1px solid #4a38d4 !important;
    border-top-color: rgba(255,255,255,.45) !important;
    border-radius: 999px !important;
    background: linear-gradient(180deg,#3220b4 0%,#23148a 100%) !important;
    box-shadow: inset 0 1px 1px rgba(255,255,255,.40), 0 4px 12px rgba(50,32,180,.3) !important;
    color: #fff !important;
    font-size: 14.5px !important;
    font-weight: 700 !important;
    letter-spacing: .3px !important;
    text-decoration: none !important;
    transition: transform .35s ease, background .35s ease, box-shadow .35s ease !important;
}

#gplmart-grid .gplmart-buy-btn::after{
    content: "→";
    display: inline-block;
    margin-left: 6px;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
}

#gplmart-grid .gplmart-buy-btn:hover,
#gplmart-grid .gplmart-card:hover .gplmart-buy-btn{
    transform: translateY(-2px) !important;
    background: linear-gradient(180deg,#3d29c8 0%,#2a189e 100%) !important;
    box-shadow: inset 0 1px 1px rgba(255,255,255,.5), 0 6px 16px rgba(50,32,180,.4) !important;
}

/* ---------- Load More and View All ---------- */
.gplmart-loadmore-wrap{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 14px;
    width: 100%;
    margin: 40px 0 10px;
    clear: both;
}

.gplmart-load-more,
.gplmart-view-all{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 56px !important;
    height: 56px !important;
    padding: 0 30px !important;
    border: 1px solid #3220b4 !important;
    border-radius: 999px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    vertical-align: middle !important;
    transition: all .3s ease !important;
}

.gplmart-load-more{
    min-width: 220px !important;
    border-top-color: rgba(255,255,255,.45) !important;
    background: linear-gradient(180deg,#3220b4 0%,#23148a 100%) !important;
    box-shadow: inset 0 1px 1px rgba(255,255,255,.40), 0 6px 16px rgba(50,32,180,.3) !important;
    color: #fff !important;
    cursor: pointer !important;
}

.gplmart-load-more:hover{
    transform: translateY(-3px) !important;
    background: linear-gradient(180deg,#3d29c8 0%,#2a189e 100%) !important;
    box-shadow: inset 0 1px 1px rgba(255,255,255,.5), 0 8px 22px rgba(50,32,180,.45) !important;
}

.gplmart-load-more:active{ transform: translateY(0) !important; }

.gplmart-view-all{
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #111827 !important;
}

.gplmart-view-all:hover{
    transform: translateY(-1px);
    border-color: #23148a !important;
    background: rgba(50,32,180,.07) !important;
    box-shadow: 0 5px 14px rgba(50,32,180,.12) !important;
    color: #23148a !important;
}

#gplmart-grid .gplmart-buy-btn:focus-visible,
.gplmart-load-more:focus-visible,
.gplmart-tab:focus-visible,
.gplmart-view-all:focus-visible{
    outline: 3px solid rgba(50,32,180,.35);
    outline-offset: 3px;
}

/* ---------- Tabs (if used by the plugin) ---------- */
.gplmart-tab{
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    border: 0;
    background: none;
    color: #6b7280;
    font-weight: 600;
    cursor: pointer;
    transition: color .3s ease;
}

.gplmart-tab:hover,
.gplmart-tab.active{ color: #111827; }

.gplmart-tab::after{
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 0;
    height: 3px;
    border-radius: 999px;
    background: #3220b4;
    transform: translateX(-50%);
    transition: width .3s ease;
}

.gplmart-tab.active::after{ width: 42px; }

/* ---------- Skeleton loading ---------- */
#gplmart-grid .gplmart-skeleton{ pointer-events: none; }
#gplmart-grid .gplmart-skeleton .gplmart-content{ padding: 18px; }
#gplmart-grid .sk-image{ min-height: 170px; border-radius: 0; background: #f2f4f7; }
#gplmart-grid .sk-title{ width: 100%; height: 16px; margin-bottom: 10px; border-radius: 20px; }
#gplmart-grid .sk-title.short{ width: 72%; }
#gplmart-grid .sk-discount{ width: 84px; height: 28px; margin: 18px 0 0; border-radius: 30px; }
#gplmart-grid .sk-price{ width: 110px; height: 24px; margin: 14px 0 0; border-radius: 30px; }
#gplmart-grid .sk-button{ height: 48px; margin-top: auto; border-radius: 999px; }

#gplmart-grid .shimmer{
    background: linear-gradient(90deg,#f2f2f2 25%,#e6e6e6 50%,#f2f2f2 75%);
    background-size: 300% 100%;
    animation: gplmart-shimmer .9s linear infinite;
}

@keyframes gplmart-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ---------- Responsive layout ---------- */
@media (max-width: 1200px) {
    #gplmart-grid{ grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
    #gplmart-grid .gplmart-content{ padding: 0 14px 14px; }
    #gplmart-grid .gplmart-title{ font-size: 16px; }
}

/* Tablet */
@media screen and (min-width: 577px) and (max-width: 991px) {
    #gplmart-grid{ grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
    #gplmart-grid .gplmart-card{ border-radius: 18px; }
    #gplmart-grid .gplmart-content{ padding: 0 13px 13px; }
    #gplmart-grid .gplmart-title{
        font-size: 19px;
        line-height: 1.3;
        min-height: calc(1.3em * 2);
        max-height: calc(1.3em * 2);
        margin-bottom: 10px;
        padding-bottom: 10px;
    }
    #gplmart-grid .gplmart-price{ padding: 3px 11px; }
    #gplmart-grid .gplmart-price ins{ font-size: 18px; }
    #gplmart-grid .gplmart-price del{ font-size: 12px; }
}

/* Larger tablet / small laptop */
@media screen and (min-width: 992px) and (max-width: 1024px) {
    #gplmart-grid .gplmart-title{ font-size: 19px; line-height: 1.3; }
    #gplmart-grid .gplmart-price ins{ font-size: 18px; }
    #gplmart-grid .gplmart-price del{ font-size: 12px; }
}

/* Mobile: one card per row */
@media (max-width: 576px) {
    #gplmart-grid{ grid-template-columns: minmax(0,1fr) !important; gap: 16px; }
    #gplmart-grid .gplmart-card{ width: 100%; min-width: 0; margin-bottom: 2px; border-radius: 15px; }
    #gplmart-grid .gplmart-image,
    #gplmart-grid .gplmart-image img{ aspect-ratio: 4 / 3; }
    #gplmart-grid .gplmart-content{ padding: 0 12px 12px; }
    #gplmart-grid .gplmart-category{ top: 4px; max-width: calc(100% - 8px); padding: 4px 9px; margin-bottom: 10px; font-size: 8px; }
    #gplmart-grid .gplmart-category::before{ flex-basis: 10px; width: 10px; height: 10px; margin-right: 4px; }
    #gplmart-grid .gplmart-title{
        font-size: 17px;
        line-height: 1.3;
        min-height: calc(1.3em * 2);
        max-height: calc(1.3em * 2);
        margin-bottom: 8px;
        padding-bottom: 8px;
    }
    #gplmart-grid .gplmart-bottom{ padding-top: 4px; gap: 8px; }
    #gplmart-grid .gplmart-price{ gap: 5px; padding: 4px 10px; }
    #gplmart-grid .gplmart-price ins{ font-size: 16px; line-height: 1.2; }
    #gplmart-grid .gplmart-price del{ font-size: 10px; line-height: 1.2; }
    #gplmart-grid .gplmart-discount span,
    #gplmart-grid .gplmart-discount .amount,
    #gplmart-grid .gplmart-discount b{
        min-height: 22px;
        padding: 3px 7px;
        font-size: 8px;
        letter-spacing: .04em;
    }
    #gplmart-grid .gplmart-discount span::before,
    #gplmart-grid .gplmart-discount .amount::before,
    #gplmart-grid .gplmart-discount b::before{
        flex-basis: 9px;
        width: 9px;
        height: 9px;
        margin-right: 4px;
    }
    #gplmart-grid .gplmart-type-badge{ top: 7px; left: 7px; padding: 3px 6px; gap: 3px; font-size: 6px; }
    .gplmart-view-all{ padding: 0 22px !important; }
    #gplmart-grid .gplmart-card:hover{ transform: none; }
}

/* Very narrow mobile */
@media (max-width: 360px) {
    #gplmart-grid{ gap: 8px; }
    #gplmart-grid .gplmart-content{ padding: 0 9px 10px; }
    #gplmart-grid .gplmart-title{ font-size: 15px; }
    #gplmart-grid .gplmart-price{ gap: 3px; padding: 3px 7px; }
    #gplmart-grid .gplmart-price ins{ font-size: 14px; }
    #gplmart-grid .gplmart-price del{ font-size: 9px; }
}

/* Landscape phones / compact landscape screens */
@media screen and (orientation: landscape) and (max-height: 600px) and (max-width: 1024px) {
    #gplmart-grid .gplmart-title{ font-size: 17px; line-height: 1.3; }
    #gplmart-grid .gplmart-price ins{ font-size: 16px; line-height: 1.2; }
    #gplmart-grid .gplmart-price del{ font-size: 10px; }
}

/* ---------- Accessibility / reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    #gplmart-grid .gplmart-card,
    #gplmart-grid .gplmart-image img,
    #gplmart-grid .gplmart-buy-btn,
    .gplmart-load-more,
    .gplmart-view-all,
    .gplmart-tab{
        transition: none !important;
        animation: none !important;
    }
}