/* ============================================
   Woo Discount Rules - Frontend (Table & Bar)
   ============================================ */

.awdr_discount_bar {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-sizing: border-box;
}

.awdr_discount_bar_content {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Bulk discount table - base */
.awdr-bulk-customizable-table {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.awdr-bulk-customizable-table .wdr_bulk_table_msg.sar-table {
    width: 100%;
    border-collapse: collapse;
}

.awdr-bulk-customizable-table .wdr_bulk_table_msg,
.awdr-bulk-customizable-table .wdr_bulk_table_tr,
.awdr-bulk-customizable-table .wdr_bulk_table_td {
    padding: 10px;
    border: 1px solid #bfc6cb;
}

.awdr-bulk-customizable-table .wdr_bulk_table_thead .wdr_bulk_table_td {
    font-weight: 600;
}

/* ----- Mobile: discount bar ----- */
@media screen and (max-width: 480px) {
    .awdr_discount_bar {
        padding: 12px 10px;
        margin-bottom: 12px;
        font-size: 0.95em;
    }

    .awdr_discount_bar_content {
        line-height: 1.4;
    }
}

/* ----- Mobile: table as cards (small screens) ----- */
@media screen and (max-width: 640px) {
    .awdr-bulk-customizable-table {
        overflow-x: visible;
    }

    .awdr-bulk-customizable-table .wdr_bulk_table_msg.sar-table,
    .awdr-bulk-customizable-table .wdr_bulk_table_msg.sar-table thead,
    .awdr-bulk-customizable-table .wdr_bulk_table_msg.sar-table tbody,
    .awdr-bulk-customizable-table .wdr_bulk_table_msg.sar-table tr {
        display: block;
    }

    .awdr-bulk-customizable-table .wdr_bulk_table_msg.sar-table thead tr {
        position: absolute;
        left: -9999px;
        top: -9999px;
    }

    .awdr-bulk-customizable-table .wdr_bulk_table_msg.sar-table tbody tr {
        margin-bottom: 12px;
        border: 1px solid #bfc6cb;
        border-radius: 6px;
        padding: 10px;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }

    .awdr-bulk-customizable-table .wdr_bulk_table_msg.sar-table tbody tr.bulk_table_row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .awdr-bulk-customizable-table .wdr_bulk_table_msg.sar-table .wdr_bulk_table_td {
        display: flex;
        align-items: center;
        padding: 8px 10px;
        border: none;
        border-bottom: 1px solid #eee;
    }

    .awdr-bulk-customizable-table .wdr_bulk_table_msg.sar-table .wdr_bulk_table_td:last-child {
        border-bottom: none;
    }

    .awdr-bulk-customizable-table .wdr_bulk_table_msg.sar-table .wdr_bulk_table_td::before {
        content: attr(data-label);
        font-weight: 600;
        min-width: 100px;
        margin-right: 10px;
        color: #555;
    }
}

/* Sale badge - mobile friendly */
.onsale.wdr-onsale {
    display: inline-block;
    max-width: 100%;
    box-sizing: border-box;
}
@media screen and (max-width: 480px) {
    .onsale.wdr-onsale { font-size: 0.85em; padding: 4px 8px; }
}

/* Small mobile: tighter padding */
@media screen and (max-width: 380px) {
    .awdr-bulk-customizable-table .wdr_bulk_table_msg.sar-table .wdr_bulk_table_td {
        padding: 6px 8px;
        font-size: 0.9em;
    }

    .awdr-bulk-customizable-table .wdr_bulk_table_msg.sar-table .wdr_bulk_table_td::before {
        min-width: 80px;
        font-size: 0.95em;
    }
}
