/**
 * WooCommerce Metal Price Updater - Frontend Styles
 */

/* Price Breakdown Wrapper */
.wcmpu-price-breakdown-wrapper {
    margin: 15px 0;
    padding: 0;
}

/* Toggle Link */
.wcmpu-breakdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 15px;
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.wcmpu-breakdown-toggle:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.wcmpu-breakdown-toggle:hover .dashicons {
    color: #fff;
}

.wcmpu-breakdown-toggle.active {
    background: #f0f0f0;
    border-color: #ccc;
}

.wcmpu-breakdown-toggle .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #0073aa;
    transition: color 0.2s ease;
}

/* Price Breakdown Table */
.wcmpu-price-breakdown {
    margin-top: 15px;
    background: linear-gradient(135deg, #f9f9f9 0%, #fff 100%);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.wcmpu-price-breakdown table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.wcmpu-price-breakdown table tr {
    border-bottom: 1px solid #eee;
}

.wcmpu-price-breakdown table tr:last-child {
    border-bottom: none;
}

.wcmpu-price-breakdown table td {
    padding: 10px 5px;
    vertical-align: middle;
}

.wcmpu-price-breakdown table td.label {
    color: #666;
    font-weight: 500;
}

.wcmpu-price-breakdown table td.value {
    text-align: right;
    font-weight: 600;
    color: #333;
}

/* Subtotal Row */
.wcmpu-price-breakdown table tr.subtotal {
    background: #f5f5f5;
}

.wcmpu-price-breakdown table tr.subtotal td {
    font-weight: 600;
}

/* Discount Row */
.wcmpu-price-breakdown table tr.discount td {
    color: #46b450;
}

.wcmpu-price-breakdown table tr.discount td.value {
    color: #46b450;
}

/* Total Row */
.wcmpu-price-breakdown table tr.total {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    border-radius: 4px;
}

.wcmpu-price-breakdown table tr.total td {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    padding: 12px 10px;
}

.wcmpu-price-breakdown table tr.total td.label {
    color: rgba(255, 255, 255, 0.9);
}

.wcmpu-price-breakdown table tr.total td.value {
    color: #fff;
}

/* Metal Type Badge */
.wcmpu-metal-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #f0c14b;
    color: #111;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.wcmpu-metal-badge.silver {
    background: #c0c0c0;
}

.wcmpu-metal-badge.platinum {
    background: #e5e4e2;
}

.wcmpu-metal-badge.palladium {
    background: #bec2cb;
}

/* Animation */
.wcmpu-price-breakdown {
    animation: wcmpu-fade-in 0.3s ease;
}

@keyframes wcmpu-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Styles */
@media screen and (max-width: 600px) {
    .wcmpu-price-breakdown {
        padding: 15px;
    }
    
    .wcmpu-price-breakdown table {
        font-size: 13px;
    }
    
    .wcmpu-price-breakdown table td {
        padding: 8px 3px;
    }
    
    .wcmpu-breakdown-toggle {
        font-size: 13px;
        padding: 6px 12px;
    }
}

/* RTL Support */
[dir="rtl"] .wcmpu-price-breakdown table td.value {
    text-align: left;
}

[dir="rtl"] .wcmpu-breakdown-toggle {
    flex-direction: row-reverse;
}

/* Print Styles */
@media print {
    .wcmpu-breakdown-toggle {
        display: none;
    }
    
    .wcmpu-price-breakdown {
        display: block !important;
        border: 1px solid #000;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .wcmpu-price-breakdown table tr.total {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
    }
    
    .wcmpu-price-breakdown table tr.total td {
        color: #000 !important;
    }
}

/* Theme Compatibility - Override common conflicts */
.woocommerce .wcmpu-price-breakdown-wrapper {
    clear: both;
}

.woocommerce .wcmpu-price-breakdown table {
    margin: 0;
    background: transparent;
}

.woocommerce .wcmpu-price-breakdown table td {
    border: none;
}

/* Variation-specific Styles */
.variations_form .wcmpu-price-breakdown-wrapper {
    margin-top: 20px;
}

.wcmpu-price-breakdown .regular-price .value {
    text-decoration: line-through;
    opacity: 0.7;
}


/* High Contrast Mode */
@media (prefers-contrast: high) {
    .wcmpu-price-breakdown {
        border-width: 2px;
        border-color: #000;
    }
    
    .wcmpu-breakdown-toggle {
        border-width: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .wcmpu-price-breakdown {
        animation: none;
    }
    
    .wcmpu-breakdown-toggle {
        transition: none;
    }
}
