/* ========== TOP BAR ========== */
.products-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* flex-wrap: wrap; */
    gap: 40px;
    padding: 10px;
    padding-right: 20px;
    max-width: 1600px;
    margin: 0 auto 15px;

    position: sticky;
    top: 65px;
    z-index: 90;

    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);

}

.products-top-bar.is-stuck {
    background-color: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px) saturate(30%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
}

#appWrapper,
.main-content,
#mainContent,
.main-content > .container-fluid {
    overflow: visible !important;
}

/* ========== GRID SWITCHER ========== */
.grid-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
}

.grid-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.grid-btn:hover {
    background: #f0f0f0;
}

.grid-btn.active svg rect {
    fill: #222;
}

.grid-btn svg rect {
    fill: #c0c0c0;
    transition: fill 0.2s;
}


/* ========== FILTERS WRAPPER (YouTube-style, tight) ========== */
.products-filters-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;                    /* NO gap — arrows hug the strip */
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    padding-right: 10px;             /* breathing room for right arrow */
}

/* Scrollable strip — no wrapping, horizontal scroll */
.products-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1 1 auto;
    min-width: 0;
    padding: 2px 4px;          /* small breathing room inside */
    /* Edge fade — smaller so buttons don't look cut off */
    /* -webkit-mask-image: linear-gradient(
        to right,
        transparent 0,
        #000 14px,
        #000 calc(100% - 14px),
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0,
        #000 14px,
        #000 calc(100% - 14px),
        transparent 100%
    ); */
}

/* Hide the native scrollbar in WebKit */
.products-filters::-webkit-scrollbar {
    display: none;
    height: 0;
    width: 0;
}

/* ========== ARROW BUTTONS ========== */
/* Hide arrows until JS is ready — prevents flicker on load */
/* .products-filters-wrapper:not(.scroll-ready) .filter-scroll-arrow {
    visibility: hidden;
    opacity: 0;
} */

.filter-scroll-arrow {
    flex-shrink: 0;
    width: 33px;
    height: 33px;
    border-radius: 50%;
    border: 1px solid #f6f5f5;
    background: #fff;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    margin: 0;                 /* no margin — parent gap=0 controls spacing */
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    z-index: 2;
    /* Small negative margin so arrow visually overlaps strip padding */
    margin-inline: -14px;
}

.filter-scroll-arrow:hover {
    
    background: #1c1c1c;
    border-color: #1c1c1c;
    color: #fff;
    transform: scale(1.1);
}

.filter-scroll-arrow:active {
    transform: scale(0.94);
}

/* Hide arrows via class (JS toggles based on scroll position) */
.filter-scroll-arrow.is-hidden {
    display: none;
}

/* Also hide the whole wrapper's arrows if no overflow at all */
.products-filters-wrapper.no-overflow .filter-scroll-arrow {
    display: none;
}

/* ========== FILTER BUTTONS ========== */
.filter-btn {
    flex: 0 0 auto;
    border: none;
    background: #f2f2f2;
    color: #0f0f0f;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 15px;
    border-radius: 16px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    background: #dfdede;
}

.filter-btn.active {
    background: #000000;
    color: #FFFFFF;
}

/* Responsive: on very small screens, hide arrows and just use swipe */
@media (max-width: 480px) {
    .filter-scroll-arrow {
        /* display: none; */
    }
    .products-filters {
        -webkit-mask-image: none;
        mask-image: none;
    }
    .products-filters-wrapper{
        padding-right:10px;
        padding-left:10px;
    }
}





@media (max-width: 768px) {
    .grid-switcher {
        display: none;
    }

    .products-top-bar {
        gap: 10px;             /* smaller gap when switcher is gone */
        padding-right: 10px;   /* balance with left padding */
    }
}








.advertisement-wrap {
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0 8px; /* optional: keeps edges off the viewport on small screens */
    box-sizing: border-box;
}

/* Desktop bottom spacing */
@media (min-width: 768px) {
    .advertisement-wrap {
        margin-bottom: 10px;   /* adjust to taste: 12–24px */
    }
}

.advertisement-link {
    display: block;      /* not inline — so the image fills the anchor */
    max-width: 100%;     /* never overflow the wrap on narrow screens */
    line-height: 0;      /* removes the inline-element baseline gap under the img */
}

.advertisement-img {
    display: block;      /* removes inline gap + allows max-width to behave */
    width: 100%;         /* scale down when the wrap is narrower than the image */
    height: auto;        /* keep aspect ratio */
    max-width: 1600px;
    border-radius: 16px;
    object-fit: cover;
}

@media (max-width: 767px) {
    .advertisement-wrap{
        padding: 0 0 10px 0; 
    }
    .advertisement-img {
        border-radius: 10px;
    }
}




/* ========== PRODUCTS GRID ========== */
.products-grid {
    display: grid;
    gap: 8px;
    transition: grid-template-columns 0.3s ease;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.products-grid[data-cols="4"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0px;
}
.products-grid[data-cols="5"] {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0px;
}
.products-grid[data-cols="6"] {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0px;
}

/* ========== CARD ========== */
.product-card {
    position: relative;
    background: #FFF;
    border: 1px solid transparent;
    border-radius: 14px;
    box-shadow: none;
    padding: 10px 10px 12px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    width: 100%;
    cursor: pointer;
    transition:
        transform 0.28s cubic-bezier(.2,.7,.3,1),
        box-shadow 0.28s ease,
        border-color 0.28s ease,
        background-color 0.28s ease;
    isolation: isolate;
}

.product-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: -1;
    background: linear-gradient(135deg, #fff 0%, #fff 100%);
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow:
        0 10px 24px -12px rgba(15, 15, 30, 0.18),
        0 2px 6px -2px rgba(15, 15, 30, 0.06);
}

.product-card:hover::before {
    opacity: 0.55;
}

.product-card:nth-child(8n+1)::before { background: linear-gradient(135deg, #FFD5DF 0%, #FFF0D5 100%); }
.product-card:nth-child(8n+2)::before { background: linear-gradient(135deg, #D5E5FF 0%, #D5F5FF 100%); }
.product-card:nth-child(8n+3)::before { background: linear-gradient(135deg, #DBFFD5 0%, #EEFFD5 100%); }
.product-card:nth-child(8n+4)::before { background: linear-gradient(135deg, #FFE5D5 0%, #FFD5E5 100%); }
.product-card:nth-child(8n+5)::before { background: linear-gradient(135deg, #E5D5FF 0%, #FFD5FA 100%); }
.product-card:nth-child(8n+6)::before { background: linear-gradient(135deg, #D5FFF0 0%, #D5E5FF 100%); }
.product-card:nth-child(8n+7)::before { background: linear-gradient(135deg, #FFF5D5 0%, #D5FFE2 100%); }
.product-card:nth-child(8n+8)::before { background: linear-gradient(135deg, #FFD5CF 0%, #D5DAFF 100%); }

/* ========== IMAGE ========== */
.product-image-link {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    overflow: hidden;
    isolation: isolate;
}

.product-image-link:hover {
    text-decoration: none;
    color: inherit;
}

.product-image {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 16px;
    overflow: hidden;
    background: #f2f2f2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(.2,.7,.3,1);
}

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

/* ========== POST HEADER ========== */
.product-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.product-avatar-link {
    flex-shrink: 0;
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: #f2f2f2;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.product-avatar-link:hover {
    transform: scale(1.06);
    text-decoration: none;
}

.product-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-weight: 800;
    font-size: 14px;
    font-family: inherit;
    user-select: none;
}

.product-card:nth-child(8n+1) .product-avatar-fallback { background: linear-gradient(135deg, #e0ecff 0%, #ffd5df 100%); }
.product-card:nth-child(8n+2) .product-avatar-fallback { background: linear-gradient(135deg, #d5f5ff 0%, #e0ecff 100%); }
.product-card:nth-child(8n+3) .product-avatar-fallback { background: linear-gradient(135deg, #dbffd5 0%, #eeffd5 100%); }
.product-card:nth-child(8n+4) .product-avatar-fallback { background: linear-gradient(135deg, #ffe5d5 0%, #ffd5e5 100%); }
.product-card:nth-child(8n+5) .product-avatar-fallback { background: linear-gradient(135deg, #e5d5ff 0%, #ffd5fa 100%); }
.product-card:nth-child(8n+6) .product-avatar-fallback { background: linear-gradient(135deg, #d5fff0 0%, #d5e5ff 100%); }
.product-card:nth-child(8n+7) .product-avatar-fallback { background: linear-gradient(135deg, #fff5d5 0%, #d5ffe2 100%); }
.product-card:nth-child(8n+8) .product-avatar-fallback { background: linear-gradient(135deg, #ffd5cf 0%, #d5daff 100%); }

.product-header-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
    line-height: 1.35;
}

.product-publisher-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.product-publisher-link:hover {
    text-decoration: none;
    color: inherit;
}

.product-publisher-link:hover .product-publisher {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.product-publisher {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.product-card:hover .product-publisher {
    color: #000;
}

.product-time {
    font-size: 11px;
    color: #9a9a9a;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 4px;
}

/* ========== TITLE ========== */
.product-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #111;
    line-height: 1.55;
    text-align: right;
    margin: 2px 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.products-grid[data-cols="6"] .product-title { font-size: 13.5px; }
.products-grid[data-cols="5"] .product-title { font-size: 14px; }
.products-grid[data-cols="4"] .product-title { font-size: 14px; }

.product-card:hover .product-title {
    color: #000;
}

.price-row {
    flex-direction: row;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
}
.price-old { order: 1; }
.price-new { order: 2; font-size: 16px; }
.discount { order: 3; align-self: flex-end; }

.price-old {
    color: #b8b8b8;
    text-decoration: line-through;
    font-size: 13px;
    font-weight: 500;
}

.price-new {
    color: #111;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: -0.2px;
}

.discount {
    background: #d32f2f;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 7px;
    padding-top: 4px;
    border-radius: 10px;
    line-height: 1.4;
    flex-wrap: nowrap;
}

/* ========== ACTIONS ========== */
.product-actions {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 6px;
    margin-top: 10px;
    padding-top: 12px;
    flex-wrap: nowrap;
    min-width: 0;
}

.product-btn-link {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.product-btn-link:hover {
    text-decoration: none;
    color: #333;
}

.product-btn.is-in-cart {
    opacity: 0.55;
    cursor: not-allowed;
}

.product-btn.is-in-cart:hover {
    background: #fff;
    border-color: #e6e6e6;
}

.product-btn {
    border: 1px solid #e6e6e6;
    background: #fff;
    color: #333;
    font-size: 12px;
    font-weight: 700;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease;
    white-space: nowrap;
    /* flex: 1 1 0; */
    flex-grow: 1;
    min-width: 0;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    letter-spacing: -0.1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    /* padding: 8px 12px; */
    box-sizing: border-box;
}

.product-btn:hover {
    background: #f5f5f5;
    border-color: #ddd;
}

.product-btn:active {
    transform: scale(0.97);
}

.product-btn.btn-secondary-action {
    background-color: transparent !important;
    border-color: #E2E2E2 !important;
}

.product-btn.btn-secondary-action:hover {
    background: linear-gradient(180deg, #535353 0%, #1c1c1c 100%) !important;
    border-color: #1c1c1c;
    color: #fff !important;
}

.product-btn.btn-primary-action {
    background-color: transparent !important;
    border-color: #E2E2E2 !important;
}

.product-btn.btn-primary-action:hover {
    background: linear-gradient(180deg, #535353 0%, #1c1c1c 100%) !important;
    border-color: #1c1c1c;
    color: #fff !important;
}

.product-btn.btn-primary-action.is-in-cart {
    opacity: 0.55;
    cursor: not-allowed;
    background: #111;
    border-color: #111;
}

.product-btn.btn-primary-action.is-in-cart:hover {
    background: #111;
    border-color: #111;
}

.btn-medium { display: none; }

.btn-short {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1;
    font-weight: bolder;
}

.btn-short i {
    font-size: 10px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    top: 1px;
    margin: 0;
    padding: 0;
    vertical-align: middle;
    font-weight: bolder;
}

.products-grid[data-cols="6"] .btn-long { display: none; }
.products-grid[data-cols="6"] .btn-medium { display: none; }
.products-grid[data-cols="6"] .btn-short { display: inline-flex; }

.products-grid[data-cols="5"] .btn-long { display: none; }
.products-grid[data-cols="5"] .btn-medium { display: inline; }
.products-grid[data-cols="5"] .btn-short { display: none; }

.products-grid[data-cols="4"] .btn-long { display: inline; }
.products-grid[data-cols="4"] .btn-medium { display: none; }
.products-grid[data-cols="4"] .btn-short { display: none; }

.products-grid[data-cols="6"] .product-avatar-link {
    width: 28px;
    height: 28px;
}

.products-grid[data-cols="6"] .product-avatar-fallback { font-size: 12px; }
.products-grid[data-cols="6"] .product-publisher { font-size: 12px; }
.products-grid[data-cols="6"] .product-time { font-size: 10px; }

.products-grid[data-cols="6"] .product-btn {
    font-size: 11px;
    min-height: 32px;
    padding: 7px 0px;
    gap: 2px;
}

.products-grid[data-cols="5"] .product-btn {
    padding-left: 10px;
    padding-right: 10px;
    padding: 7px 8px;
}

.products-grid[data-cols="4"] .product-btn {
    padding-left: 12px;
    padding-right: 12px;
    padding: 6px 8px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1400px) {
    .products-grid[data-cols="6"] {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 12px;
    }
}
@media (max-width: 1200px) {
    .products-grid[data-cols="6"],
    .products-grid[data-cols="5"] {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px;
    }
}
@media (max-width: 992px) {
    .products-grid[data-cols="4"],
    .products-grid[data-cols="5"],
    .products-grid[data-cols="6"] {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }
}
@media (max-width: 768px) {
    .products-grid[data-cols="4"],
    .products-grid[data-cols="5"],
    .products-grid[data-cols="6"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}
@media (max-width: 480px) {
    .products-grid[data-cols="4"],
    .products-grid[data-cols="5"],
    .products-grid[data-cols="6"] {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* ========== SKELETON LOADING ========== */
@keyframes skeleton-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.skeleton {
    background: #eef1f5;
    background-image: linear-gradient(
        90deg,
        #eef1f5 0%,
        #f7f9fc 50%,
        #eef1f5 100%
    );
    background-size: 800px 100%;
    background-repeat: no-repeat;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
    border-radius: 8px;
}

.skeleton-card {
    position: relative;
    background: #FFF;
    border-radius: 14px;
    padding: 10px 10px 12px;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.skeleton-image {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 16px;
    margin-bottom: 10px;
}

.skeleton-title-1 {
    height: 14px;
    width: 100%;
    margin: 4px 0 4px;
}

.skeleton-title-2 {
    height: 14px;
    width: 70%;
    margin: 0 0 10px;
}

.skeleton-price {
    height: 18px;
    width: 55%;
    margin-bottom: 12px;
}

.skeleton-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-header-meta {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.skeleton-publisher {
    height: 12px;
    width: 60%;
}

.skeleton-time {
    height: 10px;
    width: 40%;
}

.skeleton-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    padding-top: 12px;
}

.skeleton-btn {
    flex: 1 1 0;
    height: 34px;
    border-radius: 20px;
}

/* ========== SKELETON ↔ GRID SWAP (driven by <body>) ========== */
/* Livewire never touches <body>, so the class survives every morph */
body:not(.grid-loaded) #productsGridWrapper { display: none; }
body.grid-loaded #productsGridSkeleton { display: none !important; }

/* Skeleton grid — same column behavior as the real grid */
.skeleton-grid[data-cols="4"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
}
.skeleton-grid[data-cols="5"] {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
}
.skeleton-grid[data-cols="6"] {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
}

/* Match the real grid's responsive breakpoints */
@media (max-width: 1400px) {
    .skeleton-grid[data-cols="6"] {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 12px;
    }
}
@media (max-width: 1200px) {
    .skeleton-grid[data-cols="6"],
    .skeleton-grid[data-cols="5"] {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px;
    }
}
@media (max-width: 992px) {
    .skeleton-grid[data-cols="4"],
    .skeleton-grid[data-cols="5"],
    .skeleton-grid[data-cols="6"] {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }
}
@media (max-width: 768px) {
    .skeleton-grid[data-cols="4"],
    .skeleton-grid[data-cols="5"],
    .skeleton-grid[data-cols="6"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}
@media (max-width: 480px) {
    .skeleton-grid[data-cols="4"],
    .skeleton-grid[data-cols="5"],
    .skeleton-grid[data-cols="6"] {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}







/* ============================================================
MOBILE PRODUCT CARD — HORIZONTAL LAYOUT (from scratch)
Image LEFT · content RIGHT · actions full-width below
Only active on ≤ 640px. Desktop layout untouched.
============================================================ */
@media (max-width: 640px) {

    /* ---- 1. Card becomes a 2-column grid ---- */
    .product-card {
        display: grid;
        grid-template-columns: 110px 1fr;
        grid-template-rows: auto auto auto auto;
        grid-template-areas:
            "image  title"
            "image  price"
            "image  header"
            "actions actions";
        column-gap: 12px;
        row-gap: 6px;
        padding: 12px;
        border-radius: 14px;
        background: #fff;
        border: 1px solid rgba(0, 0, 0, 0.06);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
        align-items: start;
        /* disable hover-lift on touch */
        transform: none !important;
        cursor: default;
    }

    /* Turn off the desktop "colored gradient hover" effect on mobile */
    .product-card::before {
        display: none !important;
    }

    .product-card:hover {
        transform: none !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
        border-color: rgba(0, 0, 0, 0.06) !important;
    }

    /* ---- 2. Image (left column, spans first 3 rows) ---- */
    .product-image-link {
        grid-area: image;
        display: block;
        width: 110px;
        height: 110px;
        border-radius: 10px;
        overflow: hidden;
        align-self: start;
        background: #f4f4f4;
        /* prevent hover zoom on mobile */
        pointer-events: none;
    }

    .product-image {
        width: 110px;
        height: 110px;
        border-radius: 10px;
        margin: 0;
        aspect-ratio: unset;
    }

    .product-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: none;
    }

    .product-card:hover .product-image img {
        transform: none;
    }

    /* ---- 3. Title (top-right) ---- */
    .product-title {
        grid-area: title;
        font-size: 13.5px !important;
        line-height: 1.4 !important;
        font-weight: 700 !important;
        color: #111 !important;
        text-align: right !important;
        margin: 0 !important;
        -webkit-line-clamp: 2 !important;
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        align-self: start;
        min-width: 0;
    }

    /* ---- 4. Price row (below title) ---- */
    .price-row {
        grid-area: price;
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: baseline !important;
        gap: 6px !important;
        margin: 0 !important;
        padding: 0 !important;
        flex-direction: row !important;
    }

    .price-old {
        font-size: 11px !important;
        color: #b8b8b8 !important;
    }

    .price-new {
        font-size: 14px !important;
        font-weight: 800 !important;
        color: #111 !important;
    }

    .discount {
        font-size: 9px !important;
        padding: 2px 6px !important;
        border-radius: 8px !important;
    }

    /* ---- 5. Publisher header (below price) ---- */
    .product-header {
        grid-area: header;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        margin: 0 !important;
        padding-top: 4px !important;
        border-top: 1px dashed rgba(0, 0, 0, 0.05);
        min-width: 0;
    }

    /* Smaller avatar */
    .product-avatar-link,
    .products-grid[data-cols="6"] .product-avatar-link {
        width: 22px !important;
        height: 22px !important;
        flex-shrink: 0;
        pointer-events: auto;
    }

    .product-avatar-fallback,
    .products-grid[data-cols="6"] .product-avatar-fallback {
        font-size: 10px !important;
    }

    .product-header-meta {
        align-items: flex-start !important;     /* was: flex-end */
        text-align: right !important;
        min-width: 0;
        line-height: 1.25 !important;
        flex: 1 1 auto;
        margin-inline-start: 0 !important;      /* kill any auto margins */
    }

    .product-publisher,
    .products-grid[data-cols="6"] .product-publisher {
        font-size: 11px !important;
        font-weight: 600 !important;
        color: #444 !important;
    }

    .product-time,
    .products-grid[data-cols="6"] .product-time {
        font-size: 10px !important;
        color: #999 !important;
        margin-top: 1px !important;
    }

    /* ---- 6. Actions (FULL-WIDTH ROW, below both columns) ---- */
    .product-actions {
        grid-area: actions;
        display: flex !important;
        gap: 6px !important;                    /* was 8 */
        margin-top: 6px !important;
        padding-top: 8px !important;            /* was 10 */
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        align-self: stretch;
        min-width: 0;
    }

    /* Force "long" label on mobile since we have full row width */
    .products-grid[data-cols="6"] .btn-long,
    .products-grid[data-cols="5"] .btn-long,
    .products-grid[data-cols="4"] .btn-long {
        display: inline !important;
    }

    .products-grid[data-cols="6"] .btn-medium,
    .products-grid[data-cols="5"] .btn-medium,
    .products-grid[data-cols="4"] .btn-medium,
    .products-grid[data-cols="6"] .btn-short,
    .products-grid[data-cols="5"] .btn-short,
    .products-grid[data-cols="4"] .btn-short {
        display: none !important;
    }

    .product-btn,
    .products-grid[data-cols="6"] .product-btn,
    .products-grid[data-cols="5"] .product-btn,
    .products-grid[data-cols="4"] .product-btn {
        flex: 1 1 0 !important;
        min-height: 28px !important;            /* was 34 → smaller */
        font-size: 10.5px !important;           /* was 11.5 → smaller */
        padding: 4px 8px !important;            /* was 6px 10px → tighter */
        border-radius: 14px !important;         /* was 18 → matches new height */
        font-weight: 700 !important;
    }

    /* ---- 7. Grid container — single column, tighter gap ---- */
    .products-grid[data-cols="4"],
    .products-grid[data-cols="5"],
    .products-grid[data-cols="6"],
    .skeleton-grid[data-cols="4"],
    .skeleton-grid[data-cols="5"],
    .skeleton-grid[data-cols="6"] {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    /* ---- 8. Skeleton cards: match mobile horizontal layout too ---- */
    .skeleton-card {
        display: grid;
        grid-template-columns: 110px 1fr;
        grid-template-rows: auto auto auto auto;
        grid-template-areas:
            "image title"
            "image title2"
            "image price"
            "actions actions";
        column-gap: 12px;
        row-gap: 6px;
        padding: 12px;
        align-items: start;
    }

    .skeleton-image {
        grid-area: image;
        width: 110px;
        height: 110px;
        aspect-ratio: unset;
        border-radius: 10px;
        margin: 0;
    }

    .skeleton-title-1 { grid-area: title;  height: 12px; margin: 0; }
    .skeleton-title-2 { grid-area: title2; height: 12px; margin: 0; width: 70%; justify-self: end; }
    .skeleton-price  { grid-area: price;  height: 14px; margin: 0; width: 50%; justify-self: end; }

    .skeleton-header {
        display: none;   /* hide avatar block on mobile skeleton for simplicity */
    }

    .skeleton-actions {
        grid-area: actions;
        display: flex;
        gap: 8px;
        margin-top: 6px;
        padding-top: 10px;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
    }

    .skeleton-btn {
        flex: 1 1 0;
        height: 34px;
        border-radius: 18px;
    }
}

/* ---- Extra-small phones ---- */
@media (max-width: 380px) {
    .product-card {
        grid-template-columns: 96px 1fr;
        column-gap: 10px;
        padding: 10px;
    }

    .product-image-link,
    .product-image,
    .skeleton-card .skeleton-image {
        width: 96px;
        height: 96px;
    }

    .product-title {
        font-size: 12.5px !important;
    }

    .price-new {
        font-size: 13px !important;
    }

    .product-btn {
        font-size: 11px !important;
        min-height: 32px !important;
        padding: 5px 8px !important;
    }
}   