/*
 Theme Name:   Woodmart Child
 Description:  Woodmart Child Theme - Optimized for B2B E-commerce
 Author:       Child Theme Optimization Team
 Author URI:   https://example.com
 Template:     woodmart
 Version:      2.0.0
 Text Domain:  woodmart
 Tags:         e-commerce, b2b, performance, security
*/

/* ==========================================================================
   CHILD THEME OPTIMIZATIONS
   ========================================================================== */

/* Performance Optimizations */
* {
    box-sizing: border-box;
}

/* Reduce paint and layout thrashing */
.woodmart-scroll-content {
    will-change: transform;
    transform: translateZ(0);
}

/* Optimize font loading */
@font-face {
    font-family: 'Woodmart-Font';
    src: url('../fonts/woodmart-font.woff2') format('woff2'),
         url('../fonts/woodmart-font.woff') format('woff');
    font-display: swap;
}

/* Critical CSS for above-the-fold content */
.site-header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 999;
    transition: box-shadow 0.3s ease;
}

.main-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}

/* Hero section optimization */
.hero-section {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* Button optimizations */
.btn-primary {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #005a87 0%, #004066 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,124,186,0.3);
}

/* Container optimization */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ==========================================================================
   B2B ENHANCEMENTS
   ========================================================================== */

/* B2B Customer Tiers */
.b2b-tier-bronze { border-left: 4px solid #cd7f32; }
.b2b-tier-silver { border-left: 4px solid #c0c0c0; }
.b2b-tier-gold { border-left: 4px solid #ffd700; }
.b2b-tier-platinum { border-left: 4px solid #e5e4e2; }

/* B2B Dashboard Widgets */
.b2b-dashboard-widget {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

.b2b-dashboard-widget:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.b2b-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.b2b-metric:last-child {
    border-bottom: none;
}

.b2b-metric-label {
    font-weight: 600;
    color: #333;
}

.b2b-metric-value {
    font-weight: 700;
    color: #007cba;
    font-size: 1.1em;
}

/* B2B Quote Request Form */
.b2b-quote-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 2px dashed #007cba;
    margin: 20px 0;
}

.b2b-quote-form h3 {
    color: #007cba;
    margin-bottom: 15px;
    font-size: 1.2em;
}

/* Bulk Order Interface */
.b2b-bulk-order {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.bulk-order-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.bulk-order-table th,
.bulk-order-table td {
    padding: 10px;
    border: 1px solid #e1e1e1;
    text-align: left;
}

.bulk-order-table th {
    background: #f5f5f5;
    font-weight: 600;
}

/* ==========================================================================
   WOOCOMMERCE ENHANCEMENTS
   ========================================================================== */

/* Cart Enhancements */
.cart-savings-notice {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.cart-savings-notice i {
    margin-right: 8px;
    font-size: 1.2em;
}

/* Checkout Progress Bar */
.checkout-progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 2px solid #f5f5f5;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
}

.progress-step::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #e1e1e1;
    z-index: 1;
}

.progress-step:last-child::after {
    display: none;
}

.progress-step.active::after {
    background: #007cba;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e1e1e1;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    z-index: 2;
    position: relative;
    margin-bottom: 8px;
}

.progress-step.active .step-number {
    background: #007cba;
    color: white;
}

.step-title {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

.progress-step.active .step-title {
    color: #007cba;
    font-weight: 600;
}

/* Product Enquiry Button */
.product-enquiry-wrapper {
    margin: 15px 0;
}

.product-enquiry-btn {
    background: transparent;
    border: 2px solid #007cba;
    color: #007cba;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
}

.product-enquiry-btn:hover {
    background: #007cba;
    color: white;
    transform: translateY(-1px);
}

/* Quick View Button */
.quick-view-wrapper {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
}

.quick-view-btn {
    background: rgba(0,124,186,0.9);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
}

.product:hover .quick-view-btn {
    opacity: 1;
    transform: translateY(0);
}

/* Order Tracking */
.order-tracking-info {
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.order-tracking-info h3 {
    color: #007cba;
    margin-bottom: 15px;
}

/* Account Dashboard Widgets */
.account-dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.dashboard-widget {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.dashboard-widget h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1em;
    border-bottom: 2px solid #007cba;
    padding-bottom: 8px;
}

.recent-orders-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-orders-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.recent-orders-list li:last-child {
    border-bottom: none;
}

.recent-orders-list a {
    text-decoration: none;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-status {
    background: #e1e1e1;
    color: #666;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
}

.order-status.completed {
    background: #4CAF50;
    color: white;
}

.order-status.processing {
    background: #FF9800;
    color: white;
}

.order-status.pending {
    background: #FFC107;
    color: #333;
}

/* ==========================================================================
   ADMIN DASHBOARD ENHANCEMENTS
   ========================================================================== */

/* Dashboard Widget Styles */
.woodmart-dashboard-widget {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.woodmart-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f1;
}

.woodmart-widget-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #1d2327;
}

.woodmart-refresh-btn {
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.woodmart-refresh-btn:hover {
    background: linear-gradient(135deg, #135e96 0%, #0f4771 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(34,113,177,0.3);
}

.woodmart-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f6f7f7;
    transition: background-color 0.2s ease;
}

.woodmart-metric:hover {
    background-color: #f9f9f9;
}

.woodmart-metric:last-child {
    border-bottom: none;
}

.woodmart-metric-label {
    font-weight: 500;
    color: #50575e;
    font-size: 14px;
}

.woodmart-metric-value {
    font-weight: 600;
    color: #1e1e1e;
    font-size: 14px;
}

/* Status Colors */
.woodmart-status-good { 
    color: #00a32a !important; 
    font-weight: 600;
}

.woodmart-status-warning { 
    color: #dba617 !important; 
    font-weight: 600;
}

.woodmart-status-error { 
    color: #d63638 !important; 
    font-weight: 600;
}

/* Chart Container */
.woodmart-chart-container {
    position: relative;
    height: 220px;
    margin: 15px 0;
    background: #fff;
    border-radius: 4px;
    padding: 10px;
}

/* Quick Actions */
.woodmart-quick-action {
    display: inline-block;
    margin: 8px 12px 8px 0;
    padding: 10px 16px;
    background: linear-gradient(135deg, #f6f7f7 0%, #eaeaea 100%);
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    text-decoration: none;
    color: #50575e;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.woodmart-quick-action:hover {
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(34,113,177,0.2);
}

/* Error Items */
.woodmart-error-item {
    padding: 12px;
    background: linear-gradient(135deg, #fcf9e8 0%, #f9f6e4 100%);
    border-left: 4px solid #dba617;
    margin-bottom: 10px;
    font-size: 13px;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.woodmart-error-time {
    color: #646970;
    font-size: 11px;
    margin-top: 4px;
}

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

@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    .account-dashboard-widgets {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .checkout-progress-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .progress-step::after {
        display: none;
    }
    
    .woodmart-dashboard-widget {
        padding: 15px;
    }
    
    .woodmart-widget-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .woodmart-quick-action {
        width: 100%;
        margin: 5px 0;
        text-align: center;
    }
    
    .bulk-order-table {
        font-size: 0.9em;
    }
    
    .bulk-order-table th,
    .bulk-order-table td {
        padding: 8px 4px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        min-height: 40vh;
        padding: 20px 0;
    }
    
    .btn-primary {
        width: 100%;
        padding: 15px;
        font-size: 16px;
    }
    
    .woodmart-metric {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .woodmart-chart-container {
        height: 180px;
    }
}

/* ==========================================================================
   PERFORMANCE OPTIMIZATIONS
   ========================================================================== */

/* GPU acceleration for smooth animations */
.btn-primary,
.woodmart-refresh-btn,
.quick-view-btn,
.woodmart-quick-action {
    transform: translateZ(0);
    will-change: transform;
}

/* Optimize repaints */
.woodmart-dashboard-widget,
.b2b-dashboard-widget,
.dashboard-widget {
    contain: layout style paint;
}

/* Reduce layout shifts */
.woodmart-chart-container,
.account-dashboard-widgets,
.checkout-progress-bar {
    aspect-ratio: attr(width) / attr(height);
}

/* ==========================================================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================================================== */

/* Focus indicators */
.btn-primary:focus,
.woodmart-refresh-btn:focus,
.product-enquiry-btn:focus,
.quick-view-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .woodmart-status-good { color: #006400 !important; }
    .woodmart-status-warning { color: #b8860b !important; }
    .woodmart-status-error { color: #8b0000 !important; }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .woodmart-refresh-btn,
    .quick-view-btn,
    .woodmart-quick-action {
        display: none;
    }
    
    .woodmart-dashboard-widget {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
