/* KANHA-MED Product Grid & Image v1.9.3 */
.km-pgi-catalog-shell {
    --km-green: #3f7f1f;
    --km-green-dark: #2d6416;
    --km-green-soft: #f2f8ed;
    --km-orange: #ff7a18;
    --km-blue: #238fd4;
    --km-ink: #181b18;
    --km-muted: #60675f;
    --km-line: #dfe3dd;
    --km-paper: #ffffff;
    width: 100%;
    margin: 0 auto;
    padding: 20px clamp(14px, 2vw, 28px) 26px;
    border: 1px solid #e1e8dd;
    border-radius: 16px;
    background: linear-gradient(180deg, #f5f8f3 0%, #eef3ec 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 8px 24px rgba(42, 65, 37, .06);
    color: var(--km-ink);
    font-family: Arial, Helvetica, sans-serif;
}
.km-pgi-catalog-shell,
.km-pgi-catalog-shell button,
.km-pgi-catalog-shell input,
.km-pgi-catalog-shell select,
.km-pgi-catalog-shell a,
.km-pgi-catalog-shell h1,
.km-pgi-catalog-shell h2,
.km-pgi-catalog-shell small,
.km-pgi-catalog-shell strong { font-family: Arial, Helvetica, sans-serif !important; }
.km-pgi-catalog-shell *,
.km-pgi-catalog-shell *::before,
.km-pgi-catalog-shell *::after { box-sizing: border-box; }
.km-pgi-catalog-shell .screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    clip-path: inset(50%) !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    white-space: nowrap !important;
}

.km-pgi-catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 0 20px;
}
.km-pgi-catalog-title {
    flex: 0 0 auto;
    margin: 0 !important;
    padding: 0 !important;
    color: #252825 !important;
    font-size: clamp(25px, 2.2vw, 34px) !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
    letter-spacing: .015em;
    text-transform: uppercase;
}
.km-pgi-catalog-title span { color: var(--km-green); }
.km-pgi-catalog-controls {
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(180px, 220px) minmax(190px, 220px) auto;
    gap: 14px;
    align-items: center;
    justify-content: end;
    min-width: 0;
}
.km-pgi-filter-select {
    width: 100%;
    height: 42px;
    margin: 0 !important;
    padding: 0 38px 0 14px !important;
    border: 1px solid #d3d8d1 !important;
    border-radius: 7px !important;
    background-color: #fff !important;
    color: #2b302b !important;
    box-shadow: 0 1px 3px rgba(24, 35, 22, .04) !important;
    font: inherit !important;
    font-size: 13px !important;
    line-height: 40px !important;
    cursor: pointer;
}
.km-pgi-filter-select:focus {
    border-color: #6e9d54 !important;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(63, 127, 31, .14) !important;
}
.km-pgi-view-controls { display: flex; gap: 7px; }
.km-pgi-view-button {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 1px solid #d3d8d1;
    border-radius: 7px;
    background: #fff;
    color: #171b17;
    cursor: pointer;
}
.km-pgi-view-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.km-pgi-view-button svg rect { fill: currentColor; stroke: none; }
.km-pgi-view-button.is-active,
.km-pgi-view-button:hover,
.km-pgi-view-button:focus {
    border-color: var(--km-green);
    background: var(--km-green);
    color: #fff;
    outline: 0;
}

.km-pgi-catalog-shell ul.km-pgi-products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 18px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: stretch !important;
    list-style: none !important;
}
.km-pgi-catalog-shell ul.km-pgi-products::before,
.km-pgi-catalog-shell ul.km-pgi-products::after { display: none !important; content: none !important; }
.km-pgi-catalog-shell ul.km-pgi-products li.product.km-pgi-product-item {
    display: block !important;
    float: none !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    list-style: none !important;
}
.km-pgi-catalog-shell ul.km-pgi-products li.product.km-pgi-product-item > :not(.km-pgi-card) {
    display: none !important;
}
/* Category tiles occupy their own row; never place the first product beside
   the final category tile when the category count does not fill the row. */
.km-pgi-catalog-shell ul.km-pgi-products li.product-category + li.km-pgi-product-item {
    grid-column: 1 !important;
}

.km-pgi-card {
    display: flex;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid #cbd8c5;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(27, 45, 23, .11), 0 0 0 2px rgba(255,255,255,.72);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.km-pgi-card > :not(.km-pgi-image-stage):not(.km-pgi-card-body):not(.km-pgi-actions) {
    display: none !important;
}
.km-pgi-image-stage > :not(.km-pgi-image-meta):not(.km-pgi-image-link),
.km-pgi-card-body > :not(.km-pgi-title):not(.km-pgi-salt):not(.km-pgi-presentations):not(.km-pgi-pricing):not(.km-pgi-packing),
.km-pgi-actions > :not(.km-pgi-qty):not(.km-pgi-cart-button):not(.km-pgi-icon-button):not(.km-pgi-stock-status) {
    display: none !important;
}
.km-pgi-card:hover {
    transform: translateY(-3px);
    border-color: #7da663;
    box-shadow: 0 12px 28px rgba(34, 65, 27, .17), 0 0 0 3px rgba(126, 173, 92, .16);
}
.km-pgi-card.km-pgi-segment-human {
    border-color: #ff7a18;
    box-shadow: 0 4px 14px rgba(27, 45, 23, .11), 0 0 0 2px rgba(255, 122, 24, .22), 0 0 14px rgba(255, 122, 24, .20);
}
.km-pgi-card.km-pgi-segment-veterinary {
    border-color: #43a52a;
    box-shadow: 0 4px 14px rgba(27, 45, 23, .11), 0 0 0 2px rgba(67, 165, 42, .22), 0 0 14px rgba(67, 165, 42, .20);
}
.km-pgi-card.km-pgi-segment-surgical {
    border-color: #238fd4;
    box-shadow: 0 4px 14px rgba(27, 45, 23, .11), 0 0 0 2px rgba(35, 143, 212, .22), 0 0 14px rgba(35, 143, 212, .20);
}
.km-pgi-card.km-pgi-segment-human:hover { border-color: #ff7a18; box-shadow: 0 12px 28px rgba(255, 122, 24, .20), 0 0 0 3px rgba(255, 122, 24, .28), 0 0 20px rgba(255, 122, 24, .28); }
.km-pgi-card.km-pgi-segment-veterinary:hover { border-color: #43a52a; box-shadow: 0 12px 28px rgba(67, 165, 42, .20), 0 0 0 3px rgba(67, 165, 42, .28), 0 0 20px rgba(67, 165, 42, .28); }
.km-pgi-card.km-pgi-segment-surgical:hover { border-color: #238fd4; box-shadow: 0 12px 28px rgba(35, 143, 212, .20), 0 0 0 3px rgba(35, 143, 212, .28), 0 0 20px rgba(35, 143, 212, .28); }
.km-pgi-image-stage {
    position: relative;
    display: flex;
    height: 215px;
    min-height: 215px;
    align-items: center;
    justify-content: center;
    padding: 25px 17px 12px;
    background: linear-gradient(180deg, #fbfcfb 0%, #f8faf7 100%);
}
.km-pgi-image-link {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
}
.km-pgi-image-stage .km-pgi-product-image,
.km-pgi-image-stage .woocommerce-placeholder {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    object-fit: contain !important;
}
.km-pgi-image-meta {
    position: absolute;
    z-index: 2;
    top: 14px;
    right: 14px;
    left: 14px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    pointer-events: none;
}
.km-pgi-badge {
    display: inline-flex;
    min-height: 23px;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--km-orange);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.km-pgi-segment-veterinary .km-pgi-badge { background: var(--km-green); }
.km-pgi-segment-surgical .km-pgi-badge { background: var(--km-blue); }
.km-pgi-brand {
    max-width: 58%;
    overflow: hidden;
    padding: 4px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .92);
    color: #245b2a;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.km-pgi-brand-logo {
    display: flex;
    width: auto;
    max-width: 94px;
    height: 30px;
    align-items: center;
    justify-content: flex-end;
    padding: 2px 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .9);
}
.km-pgi-brand-logo img {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 86px !important;
    max-height: 26px !important;
    margin: 0 !important;
    object-fit: contain !important;
}

.km-pgi-card-body {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 13px 14px 5px;
}
.km-pgi-catalog-shell ul.km-pgi-products li.product .km-pgi-title {
    min-height: 20px !important;
    margin: 0 0 4px !important;
    padding: 0 !important;
    color: #161916 !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    line-height: 1.28 !important;
    text-transform: none !important;
}
.km-pgi-title a { color: inherit !important; text-decoration: none !important; }
.km-pgi-title a:hover { color: var(--km-green-dark) !important; }
.km-pgi-salt {
    min-height: 0;
    margin: 0 0 4px;
    color: #3f453f;
    font-size: 12px;
    line-height: 1.35;
}
.km-pgi-presentations {
    display: flex;
    min-height: 29px;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 7px;
    margin: 5px 0 6px;
}
.km-pgi-presentations.is-empty { min-height: 0; margin: 0; }
.km-pgi-presentation {
    max-width: 100%;
    min-height: 29px;
    margin: 0 !important;
    padding: 5px 10px !important;
    border: 1px solid #cfd5cc !important;
    border-radius: 5px !important;
    background: #fff !important;
    color: #313731 !important;
    box-shadow: none !important;
    font: inherit !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    line-height: 1.15 !important;
    letter-spacing: normal !important;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: none !important;
    white-space: nowrap;
    cursor: pointer;
}
.km-pgi-presentation:hover,
.km-pgi-presentation:focus,
.km-pgi-presentation.is-active {
    border-color: #76ad58 !important;
    background: #f8fcf5 !important;
    color: #34701a !important;
    outline: 0;
}
.km-pgi-presentation.is-active { box-shadow: 0 0 0 1px rgba(63, 127, 31, .08) !important; font-weight: 700 !important; }
.km-pgi-segment-human .km-pgi-presentation.is-active { border-color: var(--km-orange) !important; color: #e7660a !important; background: #fff9f4 !important; }
.km-pgi-segment-surgical .km-pgi-presentation.is-active { border-color: var(--km-blue) !important; color: #1278ba !important; background: #f5fbff !important; }
.km-pgi-pricing {
    min-height: 38px;
    padding-top: 5px;
    border-top: 1px solid #f0f2ef;
}
.km-pgi-mrp,
.km-pgi-price { color: #222622; font-size: 12px; line-height: 1.6; }
.km-pgi-mrp strong,
.km-pgi-price strong { font-weight: 800; }
.km-pgi-mrp strong,
.km-pgi-price strong,
.km-pgi-mrp .amount,
.km-pgi-price .amount,
.km-pgi-mrp .woocommerce-Price-amount,
.km-pgi-price .woocommerce-Price-amount {
    display: inline !important;
    font-size: inherit !important;
    line-height: inherit !important;
}
.km-pgi-mrp .amount { color: #222622; }
.km-pgi-price,
.km-pgi-price .amount { color: #37791e; font-weight: 800; }
.km-pgi-mrp small,
.km-pgi-price small { font-size: inherit; }
.km-pgi-packing {
    min-height: 24px;
    margin-top: 2px;
    padding-top: 5px;
    border-top: 1px dashed #e0e5de;
    color: #363c36;
    font-size: 11px;
    line-height: 1.4;
}

.km-pgi-actions {
    display: flex;
    min-height: 52px;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
    padding: 7px 10px 9px;
}
.km-pgi-qty {
    display: flex;
    width: 75px;
    height: 36px;
    flex: 0 0 75px;
    overflow: hidden;
    align-items: stretch;
    border: 1px solid #ced4cc;
    border-radius: 5px;
    background: #fff;
}
.km-pgi-qty button {
    display: flex !important;
    width: 22px !important;
    min-width: 22px !important;
    height: 100% !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fafbfa !important;
    color: #343a34 !important;
    box-shadow: none !important;
    font-size: 15px !important;
    line-height: 1 !important;
    cursor: pointer;
}
.km-pgi-qty input {
    width: 31px !important;
    min-width: 0 !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-right: 1px solid #e1e5df !important;
    border-left: 1px solid #e1e5df !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #222 !important;
    box-shadow: none !important;
    appearance: textfield !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    text-align: center !important;
}
.km-pgi-qty input::-webkit-inner-spin-button,
.km-pgi-qty input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.km-pgi-cart-button:not(.km-pgi-login-order) {
    display: inline-flex !important;
    min-width: 0 !important;
    height: 36px !important;
    flex: 1 1 auto !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 5px !important;
    border: 0 !important;
    border-radius: 5px !important;
    background: #111 !important;
    color: #fff !important;
    box-shadow: 0 2px 5px rgba(48, 105, 23, .18) !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    text-align: center !important;
    text-decoration: none !important;
    letter-spacing: -.01em !important;
    white-space: nowrap !important;
}
.km-pgi-cart-button:not(.km-pgi-login-order):hover,
.km-pgi-cart-button:not(.km-pgi-login-order):focus { background: #2b2b2b !important; color: #fff !important; outline: 0; }
.km-pgi-cart-button:not(.km-pgi-login-order).is-loading { opacity: .68; pointer-events: none; }
.km-pgi-cart-button:not(.km-pgi-login-order).is-added { background: #000 !important; }
.km-pgi-icon-button {
    display: inline-flex !important;
    width: 26px !important;
    height: 36px !important;
    flex: 0 0 26px !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 4px !important;
    background: transparent !important;
    color: #333a33 !important;
    box-shadow: none !important;
    text-decoration: none !important;
    cursor: pointer;
}
.km-pgi-icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; }
.km-pgi-icon-button:hover,
.km-pgi-icon-button:focus,
.km-pgi-icon-button.is-saved { color: var(--km-green) !important; outline: 0; }
.km-pgi-icon-button.is-saved svg { fill: currentColor; }
.km-pgi-stock-status {
    display: inline-flex;
    height: 36px;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid #d8ddd5;
    border-radius: 5px;
    background: #f5f6f4;
    color: #6b726a;
    font-size: 10px;
    font-weight: 800;
}

.km-pgi-catalog-footer { margin-top: 22px; border-top: 1px solid #e2e5e0; }
.km-pgi-service-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 14px 0;
    border-bottom: 1px solid #e7e9e5;
}
.km-pgi-service-item {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 2px 18px;
    border-right: 1px solid #e2e5e0;
}
.km-pgi-service-item:last-child { border-right: 0; }
.km-pgi-service-icon { display: inline-flex; color: var(--km-green); }
.km-pgi-service-icon svg { width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.km-pgi-service-item strong,
.km-pgi-service-item small { display: block; }
.km-pgi-service-item strong { color: #4c514c; font-size: 12px; line-height: 1.3; }
.km-pgi-service-item small { margin-top: 2px; color: #707570; font-size: 11px; line-height: 1.25; }
.km-pgi-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 0 0;
}
.km-pgi-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 34px; }
.km-pgi-legend span { display: inline-flex; align-items: center; gap: 8px; color: #737873; font-size: 10px; text-transform: uppercase; }
.km-pgi-legend i { width: 11px; height: 11px; border-radius: 50%; background: var(--km-orange); }
.km-pgi-legend i.is-veterinary { background: var(--km-green); }
.km-pgi-legend i.is-surgical { background: var(--km-blue); }
.km-pgi-view-all {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
    border-radius: 5px;
    background: var(--km-green);
    color: #fff !important;
    font-size: 10px;
    font-weight: 800;
    text-decoration: none !important;
}
.km-pgi-view-all:hover,
.km-pgi-view-all:focus { background: var(--km-green-dark); color: #fff !important; }
.km-pgi-view-all svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

.km-pgi-catalog-shell nav.woocommerce-pagination { margin: 24px 0 0; }
.km-pgi-catalog-shell nav.woocommerce-pagination ul { border: 0 !important; }
.km-pgi-catalog-shell nav.woocommerce-pagination ul li { margin: 0 3px !important; border: 0 !important; }
.km-pgi-catalog-shell nav.woocommerce-pagination ul li a,
.km-pgi-catalog-shell nav.woocommerce-pagination ul li span {
    min-width: 35px;
    min-height: 35px;
    border: 1px solid #d7ddd4;
    border-radius: 5px;
    background: #fff;
    color: #394039;
    line-height: 33px;
}
.km-pgi-catalog-shell nav.woocommerce-pagination ul li span.current { border-color: var(--km-green); background: var(--km-green); color: #fff; }

.km-pgi-catalog-shell.is-list-view ul.km-pgi-products { grid-template-columns: 1fr !important; }
.km-pgi-catalog-shell.is-list-view .km-pgi-card {
    display: grid;
    grid-template-columns: 235px minmax(0, 1fr);
    grid-template-rows: 1fr auto;
}
.km-pgi-catalog-shell.is-list-view .km-pgi-image-stage { grid-row: 1 / 3; height: 240px; min-height: 240px; }
.km-pgi-catalog-shell.is-list-view .km-pgi-card-body { grid-column: 2; grid-row: 1; }
.km-pgi-catalog-shell.is-list-view .km-pgi-actions { grid-column: 2; grid-row: 2; justify-content: flex-end; }
.km-pgi-catalog-shell.is-list-view .km-pgi-cart-button { max-width: 210px; }

@media (max-width: 1200px) {
    .km-pgi-catalog-header { align-items: flex-start; flex-direction: column; }
    .km-pgi-catalog-controls { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
    .km-pgi-catalog-shell ul.km-pgi-products { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 880px) {
    .km-pgi-catalog-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .km-pgi-view-controls { justify-content: flex-start; }
    .km-pgi-catalog-shell ul.km-pgi-products { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 13px !important; }
    .km-pgi-service-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
    .km-pgi-service-item:nth-child(2) { border-right: 0; }
    .km-pgi-footer-row { align-items: flex-start; flex-direction: column; }
    .km-pgi-catalog-shell.is-list-view .km-pgi-card { grid-template-columns: 200px minmax(0, 1fr); }
}
@media (max-width: 580px) {
    .km-pgi-catalog-shell { padding: 12px 10px 18px; border-radius: 12px; }
    .km-pgi-catalog-header { padding-top: 10px; }
    .km-pgi-catalog-controls { grid-template-columns: 1fr; gap: 9px; }
    .km-pgi-view-controls { display: none; }
    .km-pgi-catalog-shell ul.km-pgi-products { grid-template-columns: 1fr !important; gap: 12px !important; }
    .km-pgi-image-stage { height: 205px; min-height: 205px; }
    .km-pgi-actions { gap: 6px; }
    .km-pgi-service-strip { grid-template-columns: 1fr; }
    .km-pgi-service-item { justify-content: flex-start; border-right: 0; border-bottom: 1px solid #eceeeb; }
    .km-pgi-service-item:last-child { border-bottom: 0; }
    .km-pgi-legend { gap: 14px 22px; }
    .km-pgi-view-all { width: 100%; }
    .km-pgi-catalog-shell.is-list-view .km-pgi-card { display: flex; }
    .km-pgi-catalog-shell.is-list-view .km-pgi-image-stage { height: 205px; min-height: 205px; }
}
@media (prefers-reduced-motion: reduce) {
    .km-pgi-card { transition: none; }
    .km-pgi-card:hover { transform: none; }
}
