/**
 * Discount Rules for WooCommerce - Custom Modifications
 * 
 * Contains styles for modifying the bulk discount table display
 * 
 * @package Flatsome-Child
 * @subpackage Assets
 */

/* Discount Rules Bulk Table Customizations - New Design */
.awdr-bulk-customizable-table {
    font-family: inherit;
    margin-bottom: 20px;
    position: relative;
}

/* Title outside the table */
.awdr-discount-table-title {
    font-family: Inter, sans-serif;
    font-weight: 700;
    font-size: 15px;
    line-height: 22px;
    letter-spacing: 0%;
    color: #000000;
    margin: 0 0 12px 0;
    padding: 0;
}

/* Enhanced table styling - clean design with rounded corners */
/* Use same selector as plugin but with higher specificity */
.awdr-bulk-customizable-table table.wdr_bulk_table_msg {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Table header styling - no background, specific font */
.wdr_bulk_table_thead th {
    font-family: Inter, sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 100%;
    letter-spacing: 0%;
    color: #000000;
    background: transparent !important;
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 16px;
    text-transform: none !important;
}

/* Checkbox column styling */
.wdr_bulk_table_thead th.wdr-column-checkbox {
    width: 50px;
    padding: 12px 8px;
    text-align: center;
}

.wdr_bulk_table_msg td.wdr-column-checkbox {
    width: 50px;
    padding: 12px 8px;
    text-align: center;
    vertical-align: middle;
}

/* Column alignments */
.wdr_bulk_table_thead th.wdr-column-antal {
    text-align: left;
}

.wdr_bulk_table_thead th.wdr-column-styckpris {
    text-align: right;
}

.wdr_bulk_table_thead th.wdr-column-spara {
    text-align: right;
    color: #000000;
    padding-right: 24px;
}

/* Table body cells */
.wdr_bulk_table_msg td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}

/* Column cell alignments */
.wdr_bulk_table_msg td.wdr-column-antal {
    text-align: left;
    font-weight: 500;
    color: #333;
}

.wdr_bulk_table_msg td.wdr-column-styckpris {
    text-align: right;
    font-weight: 600;
    color: #333;
}

.wdr_bulk_table_msg td.wdr-column-spara {
    text-align: right;
    font-weight: 600;
    color: #dc3545;
    padding-right: 24px;
}

/* Quantity range styling */
.wdr_bulk_range {
    font-weight: 500;
    color: #333;
}

/* Price display */
.wdr_table_discounted_price {
    display: inline-block;
    font-weight: 600;
    color: #333;
}

/* Discount percentage display (Spara column) */
.wdr_table_discounted_value {
    display: inline-block !important;
    font-weight: 600;
    color: #dc3545;
    font-size: 14px;
}

/* Table row styling */
.bulk_table_row {
    background: #ffffff;
    transition: all 0.2s ease;
    position: relative;
}

.bulk_table_row:last-child td {
    border-bottom: none;
}

.bulk_table_row:hover {
    background-color: rgba(0, 0, 0, 0.01);
}

/* Active/selected row styling - light grey background with bold text */
.bulk_table_row.active-discount-tier {
    background-color: #E4F4ED !important;
}

.bulk_table_row.active-discount-tier td {
    font-weight: 700 !important;
}

.bulk_table_row.active-discount-tier td.wdr-column-antal {
    font-weight: 700;
}

.bulk_table_row.active-discount-tier td.wdr-column-styckpris {
    font-weight: 700;
}

.bulk_table_row.active-discount-tier td.wdr-column-spara {
    font-weight: 700;
}

/* Checkbox SVG container for active row - positioned in left column */
.bulk_table_row.active-discount-tier .active-row-checkbox {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin: 0 auto;
    visibility: visible !important;
    opacity: 1 !important;
}

.bulk_table_row.active-discount-tier .active-row-checkbox svg {
    width: 18px;
    height: 18px;
    display: block !important;
    visibility: visible !important;
}

/* Ensure checkbox cell is visible */
.bulk_table_row.active-discount-tier td.wdr-column-checkbox {
    display: table-cell !important;
    visibility: visible !important;
}

/* Make sure checkbox is visible even if row is not active (for debugging) */
.bulk_table_row td.wdr-column-checkbox .active-row-checkbox {
    display: inline-flex !important;
    visibility: visible !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .awdr-discount-table-title {
        font-size: 16px;
    }
    
    .wdr_bulk_table_thead th,
    .wdr_bulk_table_msg td {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Cart Discount Display Styles */
.discount-save-box {
    display: inline-block;
    background: transparent;
    color: #000;
    padding: 4px 8px;
    border-radius: 0;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: inherit;
    box-shadow: 0 0 0 1px #000;
    position: relative;
}

/* Product-level discount display */
.product-discount-save {
    margin-top: 4px;
}

.product-discount-save .discount-save-box {
    font-size: 11px;
    padding: 3px 6px;
}





/* Responsive adjustments for discount boxes */
@media (max-width: 768px) {
    .discount-save-box {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .product-discount-save .discount-save-box {
        font-size: 10px;
        padding: 2px 5px;
    }
    
}