/* Dedicated homepage grid. Card layout does not inherit Flatsome product boxes. */
#main .tts-home-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 24px;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}
#main .tts-home-product-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 0;
    padding: 16px;
    border: 1px solid #e6e6e6;
    border-radius: 6px;
    background: #fff;
    color: #111;
    text-align: left;
}
.tts-home-product-media { position: relative; width: 100%; margin-bottom: 12px; }
.tts-home-product-image { position: relative; display: block; aspect-ratio: 4 / 3; }
.tts-home-product-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.tts-home-product-hover-image { position: absolute; inset: 0; opacity: 0; transition: opacity .2s; }
@media (hover: hover) {
    .tts-home-product-image:hover .tts-home-product-hover-image { opacity: 1; }
}
.tts-home-product-discount { position: absolute; top: 0; left: 0; padding: 6px 8px; background: #c9252c; color: #fff; font-size: 12px; font-weight: 700; line-height: 1.2; }
.tts-home-product-stock { position: absolute; top: 40%; inset-inline: 0; padding: 6px; background: rgb(255 255 255 / 90%); font-size: 13px; text-align: center; }
#main .tts-home-product-name { flex-grow: 1; margin: 0 0 6px; color: #111; font-size: 17px; font-weight: 700; line-height: 1.4; text-transform: none; }
.tts-home-product-name a { display: block; color: inherit; }
.tts-home-product-rating { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
#main .tts-home-product-rating .star-rating { float: none; flex-shrink: 0; margin: 0; font-size: 16px; }
.tts-home-product-review-count { color: #777; font-size: 11px; }
.tts-home-product-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; margin: 0 0 4px; color: #c9252c; font-size: 16px; font-weight: 700; line-height: 1.4; }
.tts-home-product-price ins { order: -1; background: none; text-decoration: none; }
.tts-home-product-price del { color: #888; font-size: 12px; font-weight: 400; }
.tts-home-product-price :is(ins, del) .amount { color: inherit; }
#main .tts-home-product-price > .amount { color: #c9252c; }
.tts-home-product-sales { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; font-size: 13px; line-height: 1.5; }
.tts-home-product-sales strong { font-size: 16px; font-weight: 700; }
.tts-home-product-bestseller { padding: 3px 8px; background: #edf5ff; color: #3783ff; font-size: 12px; font-weight: 600; }
.tts-home-product-actions { display: flex; align-items: stretch; gap: 8px; }
.tts-home-product-cart { flex: 0 0 50px; }
#main .tts-home-product-cart-button { display: flex; align-items: center; justify-content: center; width: 100%; height: 38px; min-height: 0; margin: 0; padding: 0; border: 1px solid #c9252c; border-radius: 4px; background: #fff; color: #c9252c; font-size: 0; line-height: 1; }
.tts-home-product-cart-button::before { content: ''; display: block; width: 22px; height: 22px; background: currentColor; mask: url(../image/icon-cart.svg) center / contain no-repeat; -webkit-mask: url(../image/icon-cart.svg) center / contain no-repeat; }
#main .tts-home-product-cart-button:hover { background: #c9252c; color: #fff; }
.tts-home-product-cart .added_to_cart { display: none; }
#main .tts-home-product-actions a.devvn_buy_now { position: static; display: inline-flex; flex: 1; align-items: center; justify-content: center; gap: 6px; inset: auto; width: auto; min-width: 0; max-width: none; height: 38px; min-height: 0; margin: 0; padding: 0 10px; border: 1px solid #c9252c; border-radius: 4px; background: #c9252c; color: #fff; box-shadow: none; font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.4; letter-spacing: normal; text-transform: none; white-space: nowrap; }
.tts-home-product-actions a.devvn_buy_now::before { content: ''; flex: 0 0 20px; width: 20px; height: 20px; background: currentColor; mask: url(../image/icon-buynow-l.svg) center / contain no-repeat; -webkit-mask: url(../image/icon-buynow-l.svg) center / contain no-repeat; }
#main .tts-home-product-actions a.devvn_buy_now:hover { background: #ae2026; }
.tts-home-product-card :is(a, button):focus-visible { outline: 2px solid #c9252c; outline-offset: 3px; }
@media (max-width: 1024px) and (min-width: 850px) {
    #main .tts-home-product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}
@media (max-width: 849px) {
    #main .tts-home-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    #main .tts-home-product-card { padding: 8px; }
    .tts-home-product-media { margin-bottom: 8px; }
    #main .tts-home-product-name { font-size: 14px; line-height: 1.45; }
    #main .tts-home-product-rating .star-rating { font-size: 12px; }
    .tts-home-product-price { flex-direction: column; gap: 0; }
    .tts-home-product-sales { font-size: 11px; }
    .tts-home-product-sales strong { font-size: 13px; }
    .tts-home-product-sales-unit { display: none; }
    .tts-home-product-bestseller { padding: 3px 5px; font-size: 10px; }
    .tts-home-product-discount { font-size: 10px; }
    .tts-home-product-actions { gap: 5px; }
    .tts-home-product-cart { flex-basis: 30px; }
    #main .tts-home-product-cart-button { height: 32px; }
    .tts-home-product-cart-button::before { width: 18px; height: 18px; }
    #main .tts-home-product-actions a.devvn_buy_now { height: 32px; gap: 4px; padding-inline: 5px; font-size: 11px; }
    .tts-home-product-actions a.devvn_buy_now::before { flex-basis: 15px; width: 15px; height: 15px; }
}
