/*
 * Component: best-selling products grid.
 *
 * Sampled from production: 6 columns, 6px gap, section content ~1488px (a 36px
 * inset inside the 1560 container), cards ~243x329, title Bebas 18/600 #333,
 * price 15px #C62D3C (₾). Hover pill: absolute, bottom 10px, slides up + fades.
 */

.tr-bestsellers {
    background-color: transparent;   /* no distinct white card — global #F7F7F7 shows through */
    max-width: 1500px;
    margin: 0 auto;
    padding: 48px 36px 60px 36px;   /* spec: T48 R36 B60 L36 */
}

/* Neutralise the global .tr-home inter-section gap (padding is the spacing). */
.tr-home > .tr-bestsellers {
    margin-top: 0;
}

.tr-bestsellers__heading {
    margin: 0 0 18px;
    font-family: var(--tr-font-display);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--tr-text-strong);
    text-align: left;
}

.tr-bestsellers__grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

/* ── Card ── */

.tr-pcard {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;     /* white card */
    border: none;                  /* no border */
    border-radius: 5px;            /* rounded corners */
    overflow: hidden;              /* clip the image to the rounded corners */
}

.tr-pcard__top {
    position: relative;
    overflow: hidden;
}

.tr-pcard__imglink {
    display: block;
    aspect-ratio: 1 / 1;
}

.tr-pcard__img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    padding: 10px;
}

.tr-pcard__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    padding: 4px 8px;
    background: var(--tr-brand-sale);
    color: var(--tr-white);
    font-family: var(--tr-font-ka);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    border-radius: 4px;
}

/* ── Per-card brand logo (top-right) ── */

.tr-pcard__brand {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    max-width: 80px;
}
.tr-pcard__brand img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 40px;
    object-fit: contain;
}

/* ── SKU line ("არტიკული: <sku>") ── */
.tr-pcard__sku {
    margin: 0 0 10px;
    font-family: var(--tr-font-ka);
    font-size: 13px;
    line-height: 1.3;
    color: #9a9a9a;
}
.tr-pcard__sku-label {
    color: var(--tr-text-strong);
    font-weight: 600;
}

/* ── Hover pill: white floating bar with three action icons ── */

.tr-pcard__actions {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translate(-50%, 25px);
    width: auto;                     /* compact, content-sized */
    max-width: calc(100% - 16px);    /* never overflow a narrow card */
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    background: #ffffff;              /* solid white */
    border-radius: 0;                /* strict rectangle, sharp corners */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 3;
}

.tr-pcard:hover .tr-pcard__actions,
.tr-pcard:focus-within .tr-pcard__actions {
    opacity: 1;
    transform: translate(-50%, 0);
}

.tr-pcard__btn {
    width: 38px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tr-text-strong);
    background: transparent;
    transition: color 0.15s ease;
}
.tr-pcard__btn:hover,
.tr-pcard__btn.loading,
.tr-pcard__btn.added {
    color: var(--tr-brand);
    background: transparent;
}
.tr-pcard__btn svg { display: block; }

/* ── Bottom: title + price ── */

.tr-pcard__bottom {
    padding: 12px 12px 14px;
}

.tr-pcard__title {
    margin: 0 0 6px;
    font-family: var(--tr-font-display);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.15;
    color: var(--tr-text-strong);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tr-pcard__title a { color: inherit; }
.tr-pcard__title a:hover { color: var(--tr-brand); }

.tr-pcard__price {
    font-size: 15px;
    font-weight: 400;
    color: var(--tr-brand-sale);
}
.tr-pcard__price del {
    margin-right: 6px;
    color: var(--tr-text);
    opacity: 0.75;
    text-decoration: line-through;
}
.tr-pcard__price ins {
    text-decoration: none;
    color: var(--tr-brand-sale);
}

/* ── Responsive column counts ── */
@media (max-width: 1200px) {
    .tr-bestsellers__grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
    .tr-bestsellers { padding-inline: 16px; }
    .tr-bestsellers__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
    .tr-bestsellers__grid { grid-template-columns: repeat(2, 1fr); }
    .tr-pcard__actions { opacity: 1; transform: translate(-50%, 0); } /* touch: always visible */
}
