/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

/* Quantity Selectors */
.wbfsqpr-quantity-default,
.wbfsqpr-quantity-dropdown,
.wbfsqpr-quantity-buttons,
.wbfsqpr-quantity-plusminus,
.wbfsqpr-quantity-swatches {
    display: inline-block;
    margin: 10px 0;
}

/* Labeled Swatches Selector */
.wbfsqpr-quantity-swatches {
    width: 100%;
}

.wbfsqpr-swatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 10px;
}

.wbfsqpr-swatch-item {
    border: 2px solid #eee;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: #fff;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 70px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.wbfsqpr-swatch-item:hover {
    border-color: #aaa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.wbfsqpr-swatch-item.active {
    border-color: #2c3e50;
    background: #f8faff;
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.15);
    position: relative;
}

.wbfsqpr-swatch-item.active::after {
    content: "\f147";
    font-family: dashicons;
    position: absolute;
    top: -8px;
    right: -8px;
    background: #2c3e50;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 14px;
    line-height: 20px;
}

.wbfsqpr-swatch-label {
    display: block;
    font-weight: 700;
    font-size: 14px;
    color: #222;
    margin-bottom: 2px;
}

.wbfsqpr-swatch-qty-text {
    display: block;
    font-size: 12px;
    color: #666;
}

.wbfsqpr-swatch-item.active .wbfsqpr-swatch-label {
    color: #2c3e50;
}

/* Plus/Minus Selector */
.wbfsqpr-quantity-plusminus {
    display: flex;
    align-items: center;
    gap: 5px;
}

.wbfsqpr-quantity-plusminus button {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: #f7f7f7;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s;
    border-radius: 4px;
}

.wbfsqpr-quantity-plusminus button:hover {
    background: #e0e0e0;
    border-color: #999;
}

.wbfsqpr-quantity-plusminus input.qty {
    width: 60px;
    height: 40px;
    text-align: center;
    border: 1px solid #ddd;
    font-size: 16px;
    font-weight: bold;
    border-radius: 4px;
}

/* Button Group Selector */
.wbfsqpr-quantity-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wbfsqpr-quantity-buttons .qty-button {
    min-width: 50px;
    padding: 10px 15px;
    border: 2px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    border-radius: 4px;
}

.wbfsqpr-quantity-buttons .qty-button:hover {
    border-color: #999;
    background: #f7f7f7;
}

.wbfsqpr-quantity-buttons .qty-button.active {
    border-color: #2c3e50;
    background: #2c3e50;
    color: #fff;
}

/* Dropdown Selector */
.wbfsqpr-quantity-dropdown select {
    min-width: 100px;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Premium Limit Indicators */
.wbfsqpr-premium-limit-indicators {
    margin: 20px 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    overflow: hidden;
    max-width: 100%;
}

.wbfsqpr-indicators-header {
    background: #f8faff;
    padding: 10px 15px;
    border-bottom: 1px solid #edf2f7;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wbfsqpr-indicators-header .dashicons {
    font-size: 16px;
    color: #3182ce;
    width: 16px;
    height: 16px;
}

.wbfsqpr-indicators-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    background: #f0f0f0;
}

.wbfsqpr-indicator-card {
    flex: 1;
    min-width: 120px;
    background: #fff;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.2s ease;
}

.wbfsqpr-indicator-card:hover {
    background: #fcfdfe;
}

.indicator-icon {
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.indicator-icon .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.indicator-label {
    font-size: 11px;
    color: #718096;
    text-transform: uppercase;
    margin-bottom: 4px;
    font-weight: 500;
}

.indicator-value {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
}

/* Color Accents */
.min-limit .indicator-icon {
    color: #3182ce;
    background: #ebf8ff;
}

.max-limit .indicator-icon {
    color: #e53e3e;
    background: #fff5f5;
}

.step-limit .indicator-icon {
    color: #38a169;
    background: #f0fff4;
}

.min-limit .indicator-value {
    color: #2b6cb0;
}

.max-limit .indicator-value {
    color: #c53030;
}

.step-limit .indicator-value {
    color: #2f855a;
}

/* Premium Live Pricing Box */
.wbfsqpr-live-price-wrapper {
    margin: 15px 0 !important;
    padding: 12px 18px !important;
    background: #f8fbff !important;
    border: 1px solid #e1e8f0 !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

.wbfsqpr-live-price-label {
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wbfsqpr-live-price-label::before {
    content: "\f464";
    /* Dashicon money */
    font-family: dashicons;
    color: #3182ce;
}

.wbfsqpr-live-price-amount {
    font-size: 18px;
    font-weight: 700;
    color: #2b6cb0;
}

/* Dark Mode for Price Box */
@media (prefers-color-scheme: dark) {
    .wbfsqpr-live-price-wrapper {
        background: #1a202c !important;
        border-color: #2d3748 !important;
    }

    .wbfsqpr-live-price-label {
        color: #edf2f7;
    }

    .wbfsqpr-live-price-amount {
        color: #63b3ed;
    }
}

/* Pricing Table Refresh - Premium Card Style */
.wbfsqpr-pricing-table {
    margin: 30px 0;
    padding: 24px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f4f8;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wbfsqpr-pricing-table:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
}

.wbfsqpr-pricing-table-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f4f8;
}

.wbfsqpr-pricing-table-header .dashicons {
    color: #38a169;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.wbfsqpr-pricing-table h4 {
    margin: 0;
    color: #e9ebf0 !important;
    /* Force high contrast */
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.wbfsqpr-table-wrapper {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.wbfsqpr-tier-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff !important;
}

.wbfsqpr-tier-table thead {
    background: #f1f5f9;
}

.wbfsqpr-tier-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 800;
    color: #4a5568 !important;
    /* Darker header text */
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid #e2e8f0;
}

.wbfsqpr-tier-table td {
    padding: 16px;
    font-size: 14px;
    color: #2d3748 !important;
    /* High contrast body text */
    border-bottom: 1px solid #f1f5f9;
}

.wbfsqpr-tier-table tbody tr:last-child td {
    border-bottom: none;
}

.wbfsqpr-tier-table tbody tr {
    transition: background 0.2s ease;
}

.wbfsqpr-tier-table tbody tr:hover {
    background: #f8fafc;
}

.wbfsqpr-col-qty {
    font-weight: 800;
    color: #1a202c !important;
}

.wbfsqpr-col-price {
    font-weight: 700;
    color: #2b6cb0 !important;
}

/* Enhanced Discount Badges */
.wbfsqpr-discount-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    background: linear-gradient(135deg, #38a169 0%, #48bb78 100%);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(56, 161, 105, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Dark Mode Refresh */
@media (prefers-color-scheme: dark) {
    .wbfsqpr-pricing-table {
        background: #1a202c;
        border-color: #2d3748;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }

    .wbfsqpr-pricing-table h4 {
        color: #edf2f7;
    }

    .wbfsqpr-tier-table thead {
        background: #2d3748;
    }

    .wbfsqpr-tier-table th {
        color: #a0aec0;
    }

    .wbfsqpr-col-qty {
        color: #f7fafc;
    }
}

/* Quantity Notices */
.wbfsqpr-quantity-notice {
    margin: 15px 0;
    padding: 12px 15px;
    border-radius: 4px;
    animation: wbfsqpr-slide-in 0.3s ease;
}

@keyframes wbfsqpr-slide-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Error States */
input.qty.error {
    border-color: #d63638 !important;
    box-shadow: 0 0 0 2px rgba(214, 54, 56, 0.2);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wbfsqpr-limit-indicator {
        flex-direction: column;
        gap: 8px;
    }

    .wbfsqpr-quantity-buttons {
        justify-content: center;
    }

    .wbfsqpr-quantity-buttons .qty-button {
        min-width: 45px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .wbfsqpr-tier-table {
        font-size: 13px;
    }

    .wbfsqpr-tier-table th,
    .wbfsqpr-tier-table td {
        padding: 8px 10px;
    }

    .wbfsqpr-pricing-table {
        padding: 15px;
    }
}

/* Cart Page Styles */
.cart_item .wbfsqpr-quantity-plusminus {
    margin: 0;
}

/* Print optimized styles for Quotes */
@media print {

    header,
    footer,
    nav,
    .sidebar,
    .widget-area,
    .woocommerce-pagination,
    .wbfsqpr-print-quote-button,
    .checkout-button,
    .cart-collaterals .shop_table tr.shipping {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
    }

    .woocommerce-cart .entry-content {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .shop_table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    .shop_table th,
    .shop_table td {
        border: 1px solid #ddd !important;
        padding: 8px !important;
    }
}

.cart_item .wbfsqpr-limit-indicator {
    margin: 5px 0;
    padding: 5px 10px;
    font-size: 12px;
}

/* Product Page Integration */
.single-product .wbfsqpr-pricing-table {
    margin-top: 20px;
}

.single-product .wbfsqpr-limit-indicator {
    margin-bottom: 15px;
}

/* Loading State */
.wbfsqpr-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2c3e50;
    border-radius: 50%;
    animation: wbfsqpr-spin 1s linear infinite;
}

@keyframes wbfsqpr-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Accessibility */
.wbfsqpr-quantity-plusminus button:focus,
.wbfsqpr-quantity-buttons .qty-button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .wbfsqpr-pricing-table {
        background: #1e1e1e;
        border-color: #444;
    }

    .wbfsqpr-tier-table {
        background: #2a2a2a;
    }

    .wbfsqpr-tier-table th,
    .wbfsqpr-tier-table td {
        border-bottom-color: #444;
        color: #e0e0e0;
    }

    .wbfsqpr-tier-table tbody tr:hover {
        background: #333;
    }

    .wbfsqpr-premium-limit-indicators {
        background: #1a202c;
        border-color: #2d3748;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

    .wbfsqpr-indicators-header {
        background: #2d3748;
        color: #edf2f7;
        border-bottom-color: #4a5568;
    }

    .wbfsqpr-indicators-grid {
        background: #2d3748;
    }

    .wbfsqpr-indicator-card {
        background: #2d3748;
    }

    .wbfsqpr-indicator-card:hover {
        background: #343e4e;
    }

    .indicator-label {
        color: #a0aec0;
    }

    .indicator-value {
        color: #fff;
    }

    .min-limit .indicator-icon {
        background: rgba(49, 130, 206, 0.15);
    }

    .max-limit .indicator-icon {
        background: rgba(229, 62, 62, 0.15);
    }

    .step-limit .indicator-icon {
        background: rgba(56, 161, 105, 0.15);
    }
}

/* Print Styles */
@media print {

    .wbfsqpr-quantity-plusminus button,
    .wbfsqpr-quantity-buttons .qty-button {
        display: none;
    }

    .wbfsqpr-pricing-table {
        page-break-inside: avoid;
    }
}

/* Quick Order Table Styles */
.wbfsqpr-quick-order-wrapper {
    margin: 20px 0;
    overflow-x: auto;
}

.wbfsqpr-quick-order-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #ddd;
}

.wbfsqpr-quick-order-table th,
.wbfsqpr-quick-order-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    vertical-align: middle;
}

.wbfsqpr-quick-order-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.wbfsqpr-quick-order-table .product-thumbnail img {
    max-width: 60px;
    height: auto;
    border-radius: 4px;
}

.wbfsqpr-quick-order-table .product-name a {
    font-weight: 600;
    color: #2c3e50;
    text-decoration: none;
}

.wbfsqpr-quick-order-table .product-quantity {
    width: 150px;
}

.wbfsqpr-quick-order-table .product-quantity .quantity {
    margin: 0;
}

.wbfsqpr-quick-order-table .wbfsqpr-quick-add-btn {
    padding: 8px 15px;
    background: #2c3e50;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.wbfsqpr-quick-order-table .wbfsqpr-quick-add-btn:hover {
    background: #1a252f;
}

.wbfsqpr-quick-order-table .added_to_cart {
    /* background: #1a252f; */
    margin-left: 5px !important;
}

.wbfsqpr-quick-order-table .wbfsqpr-qo-status {
    display: inline-block;
    margin-left: 10px;
    font-size: 13px;
}

.wbfsqpr-quick-order-table .wbfsqpr-qo-status.success {
    color: #00a32a;
}

.wbfsqpr-quick-order-table .wbfsqpr-qo-status.error {
    color: #d63638;
}

/* Premium Savings Progress Bar */
.wbfsqpr-premium-nudge {
    margin: 25px 0;
    background: #ffffff;
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #edf2f7;
    position: relative;
    overflow: hidden;
}

.wbfsqpr-nudge-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.wbfsqpr-nudge-header .dashicons {
    color: #38a169;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.wbfsqpr-progress-message {
    font-size: 14px;
    color: #2d3748;
    font-weight: 600;
    line-height: 1.4;
}

.wbfsqpr-progress-outer {
    height: 10px;
    background: #f1f5f9;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.wbfsqpr-progress-inner {
    height: 100%;
    width: 0;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: linear-gradient(90deg, #38a169, #48bb78, #68d391);
    box-shadow: 0 0 10px rgba(56, 161, 105, 0.4);
    position: relative;
}

.wbfsqpr-progress-inner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
}

/* Success Glow Animation */
@keyframes wbfsqpr-success-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 161, 105, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(56, 161, 105, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(56, 161, 105, 0);
    }
}

.wbfsqpr-nudge-success {
    animation: wbfsqpr-success-glow 1.5s infinite;
    border-color: #38a169;
}

/* Dark Mode support for Nudge */
@media (prefers-color-scheme: dark) {
    .wbfsqpr-premium-nudge {
        background: #2d3748;
        border-color: #4a5568;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    .wbfsqpr-progress-message {
        color: #edf2f7;
    }

    .wbfsqpr-progress-outer {
        background: #1a202c;
    }
}

/* Sticky Mobile Nudge */
@media (max-width: 768px) {
    .wbfsqpr-sticky-mobile {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 9999 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border-top: 2px solid #38a169 !important;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15) !important;
        background: #ffffff !important;
        padding: 15px 20px !important;
    }
}

/* Cart & Mini-Cart Nudges */
.wbfsqpr-cart-nudge-wrapper {
    margin: 20px 0 30px 0 !important;
    border-left: 5px solid #38a169 !important;
}

.wbfsqpr-mini-cart-nudge {
    background: #f0fff4;
    color: #276749;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    margin: 10px 0;
    text-align: center;
    border: 1px dashed #38a169;
}

/* Unit-Price Badge */
.wbfsqpr-unit-price-badge {
    display: inline-block;
    background: #e6fffa;
    color: #2c7a7b;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    margin-left: 10px;
    vertical-align: middle;
    border: 1px solid #b2f5ea;
    text-transform: uppercase;
    animation: wbfsqpr-badge-pulse 2s infinite;
}

@keyframes wbfsqpr-badge-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
        background: #b2f5ea;
    }

    100% {
        transform: scale(1);
    }
}

/* Dark Mode for new elements */
@media (prefers-color-scheme: dark) {
    .wbfsqpr-sticky-mobile {
        background: #1a202c !important;
        border-top-color: #48bb78 !important;
    }

    .wbfsqpr-mini-cart-nudge {
        background: #22543d;
        color: #9ae6b4;
        border-color: #48bb78;
    }

    .wbfsqpr-unit-price-badge {
        background: #234e52;
        color: #81e6d9;
        border-color: #285e61;
    }
}