/* ======================================================
   BASE – MARKETPLACE DAMAJU
   ====================================================== */
.dmj-scroll-sentinel {
    height: 40px;
}
/* ===============================
   FILTROS – MOBILE UX (DAMJU)
   =============================== */


.dmj-button-close {
    background: #0071dc;
    border-radius: 10px;
    padding: 5px 16px;
    font-size: 20px;
    font-weight: 600;
}
.dmj-filters {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #fff;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}

.dmj-filter-btn {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    background: #0071dc;
    font-weight: 600;
    margin: 0px 0px 12px 0px;
}

/* Drawer */
.dmj-filters-drawer {
    position: fixed;
    inset: 0;
    background: #fff;
    transform: translateY(100%);
    transition: transform .3s ease;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.dmj-filters-drawer.open {
    transform: translateY(0);
}

/* Header */
.dmj-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
    font-weight: 700;
}

/* Body */
.dmj-filters-drawer > *:not(.dmj-filters-header):not(.dmj-filter-actions) {
    padding: 12px 14px;
}

/* Groups */
.dmj-filter-group {
    margin-bottom: 14px;
}

.dmj-filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.dmj-filter-group input,
.dmj-filter-group select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 14px;
}

/* Price range */
.dmj-price-range {
    display: flex;
    gap: 8px;
}

/* Checkboxes */
.dmj-filter-group input[type="checkbox"] {
    width: auto;
    margin-right: 6px;
}

/* Footer actions */
.dmj-filter-actions {
    margin-top: auto;
    padding: 12px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #eee;
}

.dmj-btn-clear {
    flex: 1;
    background: #f5f5f5;
    border: 0;
    border-radius: 10px;
    padding: 12px;
    font-weight: 700;
}

.dmj-btn-apply {
    flex: 1;
    background: #d32f2f;
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 12px;
    font-weight: 800;
}

.dmj-filters {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
    padding: 10px;
    border-bottom: 1px solid #eee;
}


.dmj-filters-drawer {
    position: fixed;
    inset: 0;
    background: #fff;
    transform: translateY(100%);
    transition: transform .3s ease;
    z-index: 999;
    padding: 16px;
}

.dmj-filters-drawer.open {
    transform: translateY(0);
}

.dmj-filter-group {
    margin-bottom: 14px;
}

.dmj-filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.dmj-price-range {
    display: flex;
    gap: 10px;
}

.dmj-filter-actions {
    display: flex;
    gap: 10px;
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-top: 10px;
}

.dmj-marketplace-wrapper {
    width: 100%;
}

.dmj-list-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dmj-product-list-item {
    position: relative;
    display: flex;
    gap: 20px;
    padding: 16px;
    border: 1px solid #eee;
    border-radius: 12px;
    background: #fff;
}

/* Forzar visibilidad (debug / seguridad) */
.dmj-marketplace-wrapper,
.dmj-list-view,
.dmj-product-list-item {
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
}

/* ======================================================
   IMAGEN
   ====================================================== */

.dmj-pi-image img {
    width: 140px;
    height: auto;
    border-radius: 10px;
}

/* ======================================================
   CUERPO
   ====================================================== */

.dmj-pi-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dmj-pi-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.dmj-pi-title a {
    color: #1a73e8;
    text-decoration: none;
}

.dmj-pi-title a:hover {
    text-decoration: underline;
}

/* ======================================================
   RATING
   ====================================================== */

.dmj-pi-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
}

.star-rating {
    font-size: 12px;
  color: #0071dc;
}

/* ======================================================
   PRECIO
   ====================================================== */

.dmj-pi-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 18px;
    font-weight: 800;
    color: #00a650;
}

.dmj-pi-price del {
    font-size: 13px;
    color: #999;
    font-weight: 400;
}

.dmj-pi-sale-badge {
    font-size: 13px;
    font-weight: 700;
    color: #00a650; /* verde MercadoLibre */
}

/* ======================================================
   BENEFICIOS
   ====================================================== */

.dmj-pi-benefits {
    list-style: disc;
    padding-left: 18px;
    font-size: 13px;
    color: #555;
    margin: 4px 0;
}

/* ======================================================
   BADGES
   ====================================================== */

.dmj-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.dmj-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 999px;
    color: #fff;
    line-height: 1;
}

.badge-shipping {
    background: #00a650;
    color: #ffffff;
    padding: 0;
}

.badge-cod {
    background: #1565c0;
}

.badge-discount {
    background: #c62828;
}

.badge-stock {
    background: #ef6c00;
}

/* ======================================================
   ACCIONES (DESKTOP)
   ====================================================== */

.dmj-pi-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.dmj-btn-view,
.dmj-btn-buy {
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
}

.dmj-btn-view {
    background: #f1f3f4;
    color: #333;
}

.dmj-btn-buy {
    background: #d32f2f;
    color: #fff;
}

/* ======================================================
   ================= MOBILE – ESTILO MERCADOLIBRE =================
   ====================================================== */

@media (max-width: 768px) {

    /* GRID 2 COLUMNAS */
    .dmj-list-view {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 8px;
    }

    .dmj-product-list-item {
        flex-direction: column;
        padding: 10px;
        gap: 8px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,.08);
    }

    /* Imagen cuadrada */
    .dmj-pi-image {
        width: 100%;
        aspect-ratio: 1 / 1;
        overflow: hidden;
        border-radius: 10px;
    }

    .dmj-pi-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    /* Badges sobre imagen */
    .dmj-badges {
        position: absolute;
        top: 8px;
        left: 8px;
        gap: 4px;
        z-index: 2;
    }

    .dmj-badge {
        font-size: 10px;
        padding: 3px 6px;
    }

    /* Título */
    .dmj-pi-title {
        font-size: 13px;
        font-weight: 600;
        line-height: 1.25;

        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Precio protagonista */
    .dmj-pi-price {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        font-size: 16px;
    }

    .dmj-pi-price del {
        font-size: 12px;
    }

    .dmj-pi-sale-badge {
        font-size: 12px;
    }

    /* Rating compacto */
    .dmj-pi-meta {
        font-size: 12px;
    }

    /* Beneficios */
    .dmj-pi-benefits {
        font-size: 12px;
        padding-left: 16px;
        margin: 4px 0;
    }

    /* ❌ QUITAR BOTONES EN MOBILE */
    .dmj-pi-actions,
    .dmj-btn-buy,
    .dmj-btn-view {
        display: none !important;
    }

    /* Tap feedback */
    .dmj-product-list-item:active {
        transform: scale(.98);
    }
}
