/* Card-only palette: independent from the shared page surfaces. */
.product-card {
    --kinas-card-info-bg: #dce3e9;
    --kinas-card-border: #9eafbd;
    --kinas-card-divider: #b8c4ce;
    --kinas-card-meta-divider: #c6d0d8;
    --kinas-card-shadow: rgba(30, 45, 58, .08);
    --kinas-card-hover: #245475;
}

/* Bootstrap's grid already supplies the spacing between product rows.
   An extra margin on a 100%-height card inflates the row and its footer. */
.product-card.shadowcol {
    margin-bottom: 0;
}

/* Keep image areas and information panels aligned within each product row. */
.product-card > .card-body {
    flex: 0 0 auto;
}

.product-card > .card-footer {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.product-card > .card-footer > .card-text:first-child {
    min-height: 3em;
}

.product-card > .card-footer > :last-child {
    margin-top: auto;
}

/* Keep prices close to the product metadata. */
.product-card > .card-footer > .product-card-offer {
    margin-top: 0;
    margin-bottom: 0;
}

/* Quote already absorbs the free space; keep its details button adjacent. */
.product-card > .card-footer > .product-card-quote + :last-child {
    margin-top: 0;
}

.product-card-quote > .btn {
    display: block;
    width: 100%;
}

.product-card > .card-footer > hr {
    margin-bottom: 1px !important;
}

.product-card > .card-footer > hr + .d-flex {
    margin-bottom: 0 !important;
}

.product-card > .card-footer > .product-card-quote {
    margin-top: auto;
    margin-bottom: 8px;
}

/* Presentation option used only by the Home featured section. */
.product-card .product-featured-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
    padding: 3px 6px;
    border-radius: 4px;
    background: #ffc107;
    color: #212529;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
}
@media (max-width: 575.98px) {
    .product-card .product-featured-badge {
        top: 4px;
        left: 4px;
        padding: 3px 5px;
        font-size: 10px;
    }
}

/* Separate, fixed-height description: never covers the product photograph. */
.product-card.shadowcol {
    min-width: 0;
    background: #fff;
    border: 1.5px solid var(--kinas-card-border);
    border-radius: 6px;
    box-shadow: 0 2px 5px var(--kinas-card-shadow);
}
.product-card .card-img-frame {
    overflow: hidden;
    background: #fff;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
    border-radius: 4.5px 4.5px 0 0;
}
.product-card .card-img-frame > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: center center;
}
.product-card .card-body > a {
    color: inherit;
    text-decoration: none;
}
.product-card .product-card-description {
    display: block;
    padding: 4px 7px 0;
    border-top: 1px solid var(--kinas-card-divider);
    background: var(--kinas-card-info-bg);
    color: #263238;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.3;
    text-align: left;
}
.product-card-description > span {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    height: 3.9em;
    overflow: hidden;
    overflow-wrap: anywhere;
}
.product-card > .product-card-info {
    position: relative;
    min-width: 0;
    padding: 7px;
    gap: 5px;
    background: var(--kinas-card-info-bg);
    color: #343a40;
    border-radius: 0 0 4.5px 4.5px;
}
/* Use the existing 7px top padding: 3px above + 1px line + 3px below.
   Out of flow so description, metadata and buttons keep their geometry. */
.product-card > .product-card-info::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 7px;
    right: 7px;
    height: 1px;
    background: var(--kinas-card-meta-divider);
    pointer-events: none;
}
.product-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 5px;
    min-width: 0;
    font-size: 11px;
    line-height: 1.4;
}
.product-card-sku { color: #59636b; flex: 0 0 auto; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.product-card-brand {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    text-align: right;
    font-size: 12px;
    font-weight: 700;
    color: #374550;
    overflow-wrap: break-word;
    word-break: normal;
    white-space: normal;
}
.product-card-status {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 3px;
    font-size: 11px;
    line-height: 1.3;
}
.product-card-status > span { color: #146c43 !important; }
.product-card-stock {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
    margin-inline: 0;
    text-align: center;
    overflow-wrap: anywhere;
    color: #17643c;
    padding: 2px 5px;
    border-radius: 4px;
    background: #d6ebdf;
    font-variant-numeric: tabular-nums;
}
.product-card-stock.product-card-stock-empty {
    color: #a12638 !important;
    background: #f5d9dd;
}
/* Presentation-only ranges: same boxes for amounts and availability messages. */
/* Avoid adding footer gaps to the explicit authenticated-card spacing.
   Auto margin on the actions still aligns buttons across each product row. */
.product-card > .product-card-info:has(> .product-card-price-summary) { gap: 0; }
.product-card-info:has(> .product-card-price-summary) > .product-card-status:not(:has(*)) { display: none; }
/* One metadata row for authorized profiles, including cards without a badge. */
.product-card-info:has(> .product-card-price-summary) > .product-card-meta { flex-wrap: nowrap; align-items: center; min-height: 21px; }
.product-card-info:has(> .product-card-price-summary) .product-card-brand { flex: 1 1 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-card-info:has(> .product-card-price-summary) .product-card-stock { white-space: nowrap; }

.product-card-price-summary { display: grid; gap: 3px; margin-block: 4px 5px; min-width: 0; }
.product-card-price-box { display: flex; flex-direction: column; justify-content: center; text-align: center; min-width: 0; min-height: 38px; padding: 1px 3px; border: 1px solid; border-radius: 5px; line-height: 1.1; }
.product-card-price-box > span { font-size: 11px; font-weight: 600; }
.product-card-price-value { display: block; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.product-card-price-message { font-size: 11px; font-weight: 500; }
.product-card-price-unit { background: #e7f3ec; border-color: #b8d7c2; color: #18734b; }
.product-card-price-wholesale { background: #fff4d8; border-color: #e7d39a; color: #856019; }
.product-card-price-unavailable .product-card-price-box { background: #f0f2f4; border-color: #b8c4ce; color: #52616d; }
.product-card-price-value .btn { color: inherit; border: 0; background: transparent; white-space: normal; max-width: 100%; text-decoration: underline; text-underline-offset: 2px; }
.product-card-price-value .btn:focus-visible { outline: 2px solid #245475; outline-offset: 1px; }
.product-card-info .btn-outline-warning {
    --bs-btn-color: #805500;
    --bs-btn-border-color: #b78113;
}
.product-card-commercial { align-items: stretch; min-width: 0; }
.product-card-commercial > a:first-child {
    --bs-btn-bg: #245580;
    --bs-btn-border-color: #245580;
    --bs-btn-color: #fff;
    --bs-btn-hover-bg: #1c456a;
    --bs-btn-hover-border-color: #1c456a;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #173c5d;
    --bs-btn-active-border-color: #173c5d;
    --bs-btn-active-color: #fff;
    flex: 1 1 0 !important;
    min-width: 0;
    white-space: normal !important;
    font-size: 12px !important;
    line-height: 1.25;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-card-commercial > form { flex: 0 0 34px; margin: 0; }
.product-card-commercial > form > .btn {
    width: 34px;
    height: 100%;
    min-height: 34px;
    --bs-btn-bg: #dce9f2;
    --bs-btn-border-color: #245580;
    --bs-btn-color: #245580;
    --bs-btn-hover-bg: #c5d9e8;
    --bs-btn-hover-border-color: #1c456a;
    --bs-btn-hover-color: #1c456a;
    --bs-btn-active-bg: #d3e1ed;
    --bs-btn-active-border-color: #173c5d;
    --bs-btn-active-color: #173c5d;
    --bs-btn-disabled-bg: #dce9f2;
    --bs-btn-disabled-border-color: #245580;
    --bs-btn-disabled-color: #245580;
}
.product-details-mobile { display: none; }
.product-card-admin {
    display: flex;
    gap: 5px;
    margin-top: 5px;
    padding: 3px 4px;
    background: #e0e5e9;
    border-radius: 5px;
    box-shadow: inset 0 0 0 1px #ced6dd;
    flex-wrap: wrap;
}
.product-card-price-summary + .product-card-actions .product-card-admin {
    margin-top: 4px;
    padding-block: 2px;
}
.product-card-admin > .btn,
.product-card-admin > form > .btn {
    width: 32px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.product-card-admin > form { margin: 0; }
.product-card-admin .btn-secondary {
    --bs-btn-bg: #edf0f3; --bs-btn-border-color: #cbd3db; --bs-btn-color: #435261;
}
.product-card-admin .btn-success {
    --bs-btn-bg: #e8f4ec; --bs-btn-border-color: #b8d9c3; --bs-btn-color: #24663e;
}
.product-card-admin .btn-warning {
    --bs-btn-bg: #fff3cd; --bs-btn-border-color: #e9d395; --bs-btn-color: #775400;
}
@media (min-width: 576px) {
    .product-card .product-card-description { font-size: 14px; }
}
@media (max-width: 575.98px) {
    .product-details-desktop { display: none; }
    .product-details-mobile { display: inline; }
}
.product-card a:focus-visible { outline: 2px solid #245580; outline-offset: 2px; }

/* Photo-only zoom on precise pointers; transforms do not change layout. */
@media (hover: hover) and (pointer: fine) {
    .product-card-interactive {
        transition: border-color .25s ease, box-shadow .25s ease;
    }

    .product-card-interactive .card-img-frame > img {
        transition: opacity .25s ease, transform .28s ease;
    }

    .product-card-interactive:hover {
        border-color: var(--kinas-card-hover);
        box-shadow: 0 0 0 1px var(--kinas-card-hover), 0 4px 12px rgba(32, 44, 54, .18);
    }

    .product-card-interactive .card-img-frame:hover > img {
        transform: scale(1.06);
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-card-interactive,
    .product-card-interactive .card-img-frame > img {
        transition: none;
    }

    .product-card-interactive .card-img-frame:hover > img {
        transform: none;
    }
}
