/**
 * WooCommerce POS Role Discounts Styles - FIXED VERSION
 * Version: 1.0.1
 * 
 * FIXED: Removed all strikethrough price styling for frontend display
 * Prices now show normally on category and product pages as requested
 */

/* ==========================================================================
   DISCOUNT PRICE DISPLAY - NO STRIKETHROUGH ON FRONTEND
   ========================================================================== */

.discount-price {
    color: #e74c3c !important;
    font-weight: bold;
    font-size: 1.1em;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.discount-badge {
    background-color: #e74c3c;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: bold;
    margin-left: 8px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* REMOVED: Original price strikethrough styling 
   This was causing the unwanted strikethrough on frontend */
/* 
.woocommerce-Price-amount del,
.price del {
    color: #999;
    text-decoration: line-through;
    font-weight: normal;
    margin-right: 8px;
}
*/

/* ==========================================================================
   ROLE DISCOUNT INFORMATION BOXES
   ========================================================================== */

.role-discount-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.role-discount-info h4 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1.1em;
    border-bottom: 2px solid #28a745;
    padding-bottom: 5px;
    display: inline-block;
}

.discount-tier {
    background-color: #d4edda;
    border-left: 4px solid #28a745;
    padding: 10px 15px;
    margin: 8px 0;
    border-radius: 0 6px 6px 0;
    transition: all 0.3s ease;
}

.discount-tier:hover {
    background-color: #c3e6cb;
    transform: translateX(5px);
}

.discount-tier .tier-label {
    font-weight: 600;
    color: #155724;
}

.discount-tier .tier-percentage {
    float: right;
    font-weight: bold;
    color: #28a745;
    font-size: 1.1em;
}

/* ==========================================================================
   POS SPECIFIC STYLES (STILL ALLOWS STRIKETHROUGH IN POS)
   ========================================================================== */

.pos-discount-applied {
    color: #28a745;
    font-weight: bold;
    font-size: 0.9em;
    background-color: #d4edda;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
}

.pos-original-price {
    text-decoration: line-through;
    color: #6c757d;
    margin-right: 8px;
    font-size: 0.9em;
}

.pos-discount-percentage {
    background: #ffc107;
    color: #212529;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: bold;
    margin-left: 4px;
}

/* POS Product Grid Enhancements */
.pos-product-item {
    position: relative;
}

.pos-discount-ribbon {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #e74c3c;
    color: white;
    padding: 2px 6px;
    border-radius: 0 0 0 8px;
    font-size: 0.7em;
    font-weight: bold;
    z-index: 10;
}

/* ==========================================================================
   CART DISCOUNT SUMMARY
   ========================================================================== */

.woocommerce-cart .role-discount-summary,
.role-discount-summary {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border: 1px solid #86cfda;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.role-discount-summary h3 {
    color: #0c5460;
    margin-bottom: 15px;
    font-size: 1.3em;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.discount-breakdown {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
    padding: 8px 0;
    border-bottom: 1px solid rgba(12, 84, 96, 0.1);
}

.discount-breakdown:last-child {
    border-bottom: none;
    font-weight: bold;
    font-size: 1.1em;
    border-top: 2px solid #0c5460;
    padding-top: 12px;
    margin-top: 12px;
}

.discount-breakdown .label {
    font-weight: 500;
    color: #495057;
}

.discount-breakdown .amount {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.1em;
}

.total-savings {
    background: #28a745;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    text-align: center;
    margin-top: 15px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   PRODUCT PAGE ENHANCEMENTS
   ========================================================================== */

.single-product .role-discount-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 12px 15px;
    border-radius: 6px;
    margin: 15px 0;
    font-size: 0.95em;
}

.single-product .role-discount-notice .discount-icon {
    display: inline-block;
    margin-right: 8px;
    font-size: 1.2em;
}

.product-discount-tiers {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
}

.product-discount-tiers h5 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tier-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #e9ecef;
}

.tier-item:last-child {
    border-bottom: none;
}

/* ==========================================================================
   ADMIN PAGE STYLES
   ========================================================================== */

.wc-pos-discounts-admin .wrap {
    background: #f1f1f1;
    margin: 0 -20px;
    padding: 20px;
}

.wc-pos-discounts-admin .card {
    background: white;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 25px;
    margin: 25px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.wc-pos-discounts-admin .card h2 {
    margin-top: 0;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
    color: #23282d;
}

.wc-pos-discounts-admin table {
    margin-top: 15px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.wc-pos-discounts-admin table th {
    background: #0073aa;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85em;
}

.wc-pos-discounts-admin table td {
    vertical-align: middle;
}

.wc-pos-discounts-admin .test-results {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    border-left: 4px solid #0073aa;
    padding: 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

.wc-pos-discounts-admin .button-primary {
    background: #0073aa;
    border-color: #005a87;
    text-shadow: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wc-pos-discounts-admin .button-primary:hover {
    background: #005a87;
    border-color: #004a6b;
}

/* ==========================================================================
   CHECKOUT PAGE ENHANCEMENTS
   ========================================================================== */

.woocommerce-checkout .role-discount-applied {
    color: #28a745;
    font-weight: bold;
    font-size: 0.9em;
}

.checkout-discount-summary {
    background: #e8f5e8;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
}

.checkout-discount-summary h4 {
    color: #155724;
    margin-bottom: 10px;
    font-size: 1.1em;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .discount-breakdown {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .discount-badge {
        display: block;
        margin: 8px 0;
        width: fit-content;
        font-size: 0.7em;
        padding: 2px 6px;
    }
    
    .role-discount-summary {
        padding: 15px;
        margin: 15px 0;
    }
    
    .role-discount-summary h3 {
        font-size: 1.1em;
    }
    
    .tier-percentage {
        float: none !important;
        display: block;
        margin-top: 5px;
    }
    
    .pos-discount-ribbon {
        font-size: 0.6em;
        padding: 1px 4px;
    }
    
    .wc-pos-discounts-admin .card {
        padding: 15px;
        margin: 15px 0;
    }
    
    .product-discount-tiers {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .discount-price {
        font-size: 1em;
    }
    
    .discount-badge {
        font-size: 0.65em;
        padding: 1px 4px;
        margin-left: 4px;
    }
    
    .role-discount-info {
        padding: 10px;
    }
    
    .discount-tier {
        padding: 8px 10px;
    }
    
    .wc-pos-discounts-admin table {
        font-size: 0.9em;
    }
    
    .wc-pos-discounts-admin .card {
        padding: 10px;
    }
}

/* ==========================================================================
   ACCESSIBILITY ENHANCEMENTS
   ========================================================================== */

.discount-badge:focus,
.discount-price:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.role-discount-info {
    role: "region";
    aria-label: "Discount Information";
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .discount-price {
        color: #000 !important;
        background: #ff0 !important;
        padding: 2px 4px;
        border-radius: 2px;
    }
    
    .discount-badge {
        background: #000 !important;
        color: #fff !important;
        border: 2px solid #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .discount-badge {
        animation: none;
    }
    
    .discount-tier {
        transition: none;
    }
    
    .discount-tier:hover {
        transform: none;
    }
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }

.font-bold { font-weight: bold !important; }
.font-normal { font-weight: normal !important; }

.hidden { display: none !important; }
.visible { display: block !important; }

/* Custom discount status indicators */
.discount-status-active {
    color: #28a745;
}

.discount-status-inactive {
    color: #6c757d;
}

.discount-status-pending {
    color: #ffc107;
}

/* Loading states */
.discount-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.discount-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   FIXED VERSION NOTES
   ========================================================================== */

/*
CHANGES MADE IN VERSION 1.0.1:

1. REMOVED: All frontend price strikethrough styling
   - Commented out/removed .woocommerce-Price-amount del and .price del styles
   - This fixes the issue where variation products showed strikethrough on category/product pages

2. MAINTAINED: POS strikethrough styling
   - POS-specific classes like .pos-original-price still have strikethrough
   - This ensures POS functionality remains intact

3. MAINTAINED: Cart discount functionality
   - All cart discount calculations and display remain unchanged
   - Discount summaries and cart item discount info still work

4. MAINTAINED: Product page discount information
   - Discount notices and tier information still display
   - Just without affecting the actual price display

5. MAINTAINED: Admin functionality
   - All admin settings and test functionality remain intact

The plugin now shows normal prices on frontend while maintaining all discount functionality in cart and POS.
*/
