/* Extracted from templates/components/productbox.html so it is sent ONCE and
   cached, instead of being re-emitted inside every product card (~7.6 KB x N). */
/* --- MODERN PRODUCT CARD (modified per product-details) --- */
.product-card {
    width: 100%;
    max-width: 260px;
    background: #ffffff;
    border-radius: 0;
    overflow: hidden;              /* clips the image zoom; .price-modal is position:fixed so it escapes the clip */
    /* no border (per request) - elevation does the work */
    border: none;
    box-shadow: 0 2px 8px rgba(52, 58, 64, 0.08), 0 0 0 1px rgba(52, 58, 64, 0.05);
    transition: top .18s ease, box-shadow .18s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    top: -4px;
    box-shadow: 0 14px 28px rgba(52, 58, 64, 0.16), 0 0 0 1px rgba(255, 131, 17, 0.35);
    z-index: 3;
}

/* --- IMAGE WRAPPER (uniform size) --- */
.product-card .image-wrapper {
    width: 100%;
    height: 150px;                     /* fixed height = no gaps */
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    overflow: hidden;                  /* frame for the hover zoom */
}

.product-card .image-wrapper img,
.product-card .image-wrapper .image-link img {
    transition: transform .25s ease;
}

.product-card:hover .image-wrapper img {
    transform: scale(1.05);
}

.product-card img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}
/* Ensure anchor wrapping the image doesn't change sizing */
.product-card .image-wrapper .image-link {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
}
.product-card .image-wrapper .image-link img {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

/* --- CARD BODY (Material UI spacing) --- */
.product-card .body {
    padding: 0.85rem 0.9rem 1rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: transparent;
}

/* --- TITLE --- */
.product-card .title {
    font-size: 0.95rem;
    /* do not bold the title text */
    font-weight: 500;
    color: #222;
    /* reserve space for up to 3 lines; if fewer lines, the remaining space stays blank */
    line-height: 1.2em;
    height: calc(1.2em * 3);
    margin: 0;
    text-decoration: none;
    display: block;
    overflow: hidden;
    word-wrap: break-word;
}

.product-card:hover .title {
    color: #FF8311;
}
/* Price label directly under the title (matches +Quote orange) */
.product-card .product-price {
    color: #FF9E1A;
    margin: 1px 0; /* tightened vertical spacing above and below */
    font-size: 0.95rem;
    font-weight: 400; /* not bold */
    text-decoration: none;
    cursor: pointer;
    background: transparent;
    border: none;
    line-height: 1; /* tighten spacing */
}
/* lightweight modal for "no price" info — scoped and minimal */
.price-modal {
    display: none;
    position: fixed;
    z-index: 2100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.price-modal.open {
    display: flex;
}
.price-modal-content {
    background: #fff;
    color: #222;
    padding: 18px;
    border-radius: 8px;
    max-width: 520px;
    width: 100%;
    box-sizing: border-box;
}
.price-modal-close {
    float: right;
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

/* --- STATUS & BADGES --- */
.product-card .status-row {
    display: flex;
    align-items: center;
}

.product-card .badge-featured {
    background: #ff8311;
    color: #fff;
    padding: 2px 7px;
    font-size: 0.7rem;
    border-radius: 8px;
    font-weight: 500;
}

/* --- WISHLIST BUTTON (icon-button style) --- */
.product-card .wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.95);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.product-card .wishlist-btn i {
    font-size: 1.1rem;
    color: #ff8311;
}

/* --- ACTION ROW (quantity + button) --- */
.product-card .action-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end; /* Align items to the bottom */
    margin-top: 6px;
}

.input-group-sm {
    width: 100px;
}

/* CTA styling aligned with product-details */
.product-card .btn-add-to-quote,
.product-card .quote-btn {
    background-color: #FF9E1A;
    color: #ffffff;
    border: 1px solid #FF9E1A;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.88rem;
    transition: all 0.12s ease;
    font-weight: 600;
    position: relative; /* for badge placement */
    box-shadow: none;
    cursor: pointer;
    flex-shrink: 0; /* Prevent button from shrinking */
}
.product-card .btn-add-to-quote:hover,
.product-card .quote-btn:hover {
    background-color: #e36f0c;
    color: #fff;
}
.product-card .btn-add-to-quote.in-cart {
    background-color: #FF9E1A;
    color: #ffffff;
    border-color: #FF9E1A;
    box-shadow: none;
}

/* small badge stuck to top-right of the button */
.product-card .product-inline-cart-icon {
    /* inline cart icon styling (appears next to +Quote) */
    font-size: 1rem;
    position: relative;
    top: 0;
    margin-left: 0.5rem;
    color: #343a40;
    opacity: 0.9;
    width: 1rem;  /* Fixed width */
    height: 1rem; /* Fixed height */
}
/* Ensure the +Quote label is always visible and inline inside the button */
.product-card .quote-label {
    display: inline-block;
    color: inherit;
    font-weight: 600;
    vertical-align: middle;
    pointer-events: none;
}
.btn-add-to-quote .product-inline-cart-icon {
    margin-left: .5rem;
}
/* Ensure +Quote text is always visible inside the button */
.product-card .btn-add-to-quote {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 72px; /* ensure there is room for label */
    padding: 6px 8px; /* Reduced padding */
    width: 90px; /* Reduced Fixed width */
    height: 38px; /* Fixed height, matching quantity input wrapper */
}
.product-card .btn-add-to-quote .quote-label {
    display: inline-block !important;
    color: #fff !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 2;
}

/* Quantity selector styles copied from product-details (compact pill) */
.product-card .quantity-input-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    padding: 0.2rem 0.4rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: #fff;
    height: 38px; /* Fixed height, matching quote button */
    flex-shrink: 0; /* Prevent quantity input from shrinking */
    width: 72px; /* Reduced Fixed width by 20% */
}
.product-card .quantity-input-wrapper:focus-within {
    border-color: #ff8c00;
    box-shadow: 0 0 0 3px rgba(255,140,0,0.06);
}
.product-card .quantity-input {
    width: 37px; /* Reduced by 20% */
    padding: 0.18rem 0.3rem;
    border: none;
    font-size: 0.95rem;
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
    background: transparent;
}
.product-card .quantity-input::-webkit-outer-spin-button,
.product-card .quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.product-card .quantity-input {
    -webkit-appearance: none;
    /* keep -moz-appearance already present for Firefox */
}
.product-card .quantity-btn {
    background: transparent;
    border: none;
    padding: 0 6px;
    font-size: 1rem;
    color: #6c757d;
    cursor: pointer;
}
.product-card .quantity-btn:hover {
    color: #343a40;
}

/* --- GRID ALIGNMENT --- */
.product-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

/* --- MOBILE OPTIMIZATION --- */
@media (max-width: 576px) {
    .product-card {
        max-width: 95%;
    }

    .product-card .image-wrapper {
        height: 135px;
    }
}
