/* =========================================================
   BestMarket – frontend.css (ETSY optimalizace)
   Verze: FINAL FULL
   ========================================================= */

/* Wrapper */
.bm-hotproducts-wrapper {
    max-width: 1320px;
    margin: 0 auto 60px auto;
    padding: 0 16px 40px;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* CATEGORY GRID -------------------------------------------------- */

.bm-hotproducts-categories {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin: 24px 0 32px;
}

@media (max-width: 1024px) {
    .bm-hotproducts-categories {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .bm-hotproducts-categories {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px !important; /* ETSY style */
        padding: 0 6px !important;
    }
}

.bm-hot-cat-card {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    padding: 0;
    cursor: pointer;
    background: #f3f3f3;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
    transition: transform .18s ease, box-shadow .18s ease;
}

.bm-hot-cat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.bm-hot-cat-card.is-active {
    box-shadow: 0 0 0 2px #111827, 0 18px 40px rgba(15, 23, 42, 0.2);
}

.bm-hot-cat-image {
    position: relative;
    width: 100%;
    padding-top: 60%;
}

.bm-hot-cat-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bm-hot-cat-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.05));
}

.bm-hot-cat-name {
    position: absolute;
    left: 14px;
    bottom: 12px;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.45);
}

/* PRODUCT GRID -------------------------------------------------- */

.bm-hotproducts-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

@media (max-width: 1024px) {
    .bm-hotproducts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .bm-hotproducts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* MOBILE ETSY MODE – CORE FIX */
@media (max-width: 480px) {

    .bm-hotproducts-wrapper {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    .bm-hotproducts-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;         /* ETSY small gap */
        padding: 0 6px !important;   /* light edge padding */
    }

    .bm-hotproduct-card {
        margin: 0 !important;
        width: 100% !important;
        border-radius: 14px !important;
    }

    .bm-hotproduct-image-wrap {
        padding-top: 88% !important; /* bigger photo */
    }
}

/* PRODUCT CARD -------------------------------------------------- */

.bm-hotproduct-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    transition: transform .18s ease, box-shadow .18s ease;
}

.bm-hotproduct-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}

.bm-hotproduct-card a {
    color: inherit;
    text-decoration: none;
    display: block;
}

/* IMAGE */
.bm-hotproduct-image-wrap {
    position: relative;
    width: 100%;
    padding-top: 85%;
    overflow: hidden;
    background: #f5f5f5;
}

.bm-hotproduct-image-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* BADGE */
.bm-hotproduct-badge {
    position: absolute;
    left: 10px;
    top: 10px;
    background: #b91c1c;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 999px;
}

/* CARD BODY */
.bm-hotproduct-body {
    padding: 10px 10px !important;
}

.bm-hotproduct-category {
    font-size: 10px !important;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 2px !important;
}

/* TITLE */
.bm-hotproduct-title {
    font-size: 13px !important;
    font-weight: 600;
    margin: 0 0 4px 0 !important;
    color: #111827;
    line-height: 1.3 !important;
    max-height: 2.6em !important;
    overflow: hidden;
}

/* SHOP NAME – REMOVE */
.bm-hotproduct-shop {
    display: none !important;
}

/* PRICE */
.bm-hotproduct-price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.bm-price-main {
    font-size: 16px;
    font-weight: 700;
    color: #b91c1c;
}

.bm-price-original {
    font-size: 12px;
    color: #9ca3af;
    text-decoration: line-through;
}

/* STATUS */
.bm-hotproducts-status {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: #4b5563;
}

.bm-hotproducts-loading,
.bm-hotproducts-end,
.bm-hotproducts-error {
    display: none;
}
