/* KC Bulk Order Table Styles */

/* Container */

.kcbo-sticky {
    position: sticky;
    top: 0;              /* Adjust if you have an admin bar, e.g., top: 32px; */
    z-index: 102;        /* Ensure it's above the table and other content */
    background: #f8f9fa; /* Match your search/filter bar background */
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}
#kcbo-bulk-table-container {
    max-width: 100%;
    margin: 0px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
}

/* Category Section */
.kcbo-category-section {
    margin-bottom: 40px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Category Header */
.kcbo-category-header {
    background: linear-gradient(135deg, #ff6b35 0%, #f7941d 100%);
    padding: 15px 20px;
    position: relative;
    overflow: hidden;
}

.kcbo-category-header::before {
    content: "✨";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.5; transform: translateY(-50%) scale(1); }
    50% { opacity: 1; transform: translateY(-50%) scale(1.2); }
}

.kcbo-category-title {
    color: white;
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

/* Table Wrapper */
.kcbo-table-wrapper {
    overflow-x: auto;
    background: white;
}

/* Table Styles */
.kcbo-bulk-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 14px;
}

.kcbo-bulk-table th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    padding: 12px 8px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    white-space: wrap;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kcbo-bulk-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.kcbo-bulk-table tbody tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s ease;
}

/* Column Specific Styles */
.kcbo-col-image {
    width: 60px;
    text-align: center;
}

.kcbo-product-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.kcbo-col-code {
    width: 80px;
    font-family: monospace;
    font-weight: 600;
    color: #6c757d;
}

.kcbo-col-name {
    min-width: 200px;
}

.kcbo-col-name strong {
    color: #212529;
    font-weight: 600;
}

.kcbo-col-content {
    width: 100px;
    text-align: center;
    font-weight: 500;
    color: #495057;
}

.kcbo-col-actual-price,
.kcbo-col-price,
.kcbo-col-total {
    width: 100px;
    text-align: right;
    font-weight: 600;
}

.kcbo-original-price {
    color: #dc3545;
    text-decoration: line-through;
    font-size: 12px;
}

.kcbo-discounted-price {
    color: #28a745;
    font-size: 14px;
    font-weight: 700;
}

.kcbo-row-total {
    color: #007bff;
    font-size: 14px;
    font-weight: 700;
}

.kcbo-col-quantity {
    width: 80px;
    text-align: center;
}

/* Quantity Input */
.kcbo-quantity-input {
    width: 60px;
    padding: 6px 8px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    transition: border-color 0.2s ease;
}

.kcbo-quantity-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.kcbo-quantity-input::-webkit-outer-spin-button,
.kcbo-quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.kcbo-quantity-input[type=number] {
    -moz-appearance: textfield;
}

/* Cart Summary */
.kcbo-cart-summary {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #000000 !important;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
 transform:none !important;
    transition: transform 0.3s ease;
}

.kcbo-cart-summary.kcbo-show {
    transform: translateY(0);
}

.kcbo-cart-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
	width: 80%;
}

.kcbo-cart-info span {
    font-size: 14px;
    font-weight: 500;
}

.kcbo-cart-info strong {
    font-weight: 700;
    margin-left: 5px;
}

.kcbo-cart-actions {
    display: flex;
    align-items: center;
}

/* Checkout Button */
.kcbo-checkout-btn {
    background: #212529;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kcbo-checkout-btn:hover:not(:disabled) {
    background: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
button#kcbo-add-to-cart{
            font-size: 14px;
    font-weight: bold;
border-radius: 20px;
    background: #E36129;
    opacity: 1 !important;
    cursor: pointer !important;
    opacity: 0.6;
    padding: 0px 24px !important;
    color: white;
}

.kcbo-checkout-btn:disabled {
        font-size: 14px;
    font-weight: bold;
border-radius: 20px;
    background: #E36129;
    opacity: 1 !important;
    cursor: pointer !important;
    opacity: 0.6;
    padding: 0px 24px !important;
    color: white;
}

.kcbo-checkout-btn.kcbo-loading {
    position: relative;
    color: transparent;
}

.kcbo-checkout-btn.kcbo-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* WhatsApp Redirect Styles */
.kcbo-whatsapp-redirect {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.kcbo-whatsapp-redirect h3 {
    color: #28a745;
    margin-bottom: 10px;
}

.kcbo-whatsapp-redirect .button {
    background: #25d366;
    border-color: #25d366;
    padding: 12px 24px;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
    margin-top: 10px;
}

.kcbo-whatsapp-redirect .button:hover {
    background: #1da851;
    border-color: #1da851;
}

/* Responsive Design */
@media (max-width: 768px) {

	.kcbo-bulk-table th{
		    white-space: wrap;
line-height: 1;
	}
    .kcbo-bulk-table {
        font-size: 12px;
    }

    .kcbo-bulk-table th,
    .kcbo-bulk-table td {
        padding: 8px 4px;
    }

    .kcbo-product-image {
        width: 40px;
        height: 40px;
    }

    .kcbo-quantity-input {
        width: 50px;
        padding: 4px 6px;
    }

    .kcbo-cart-summary {
    border-radius: 0px ! Important;
        flex-direction: row;
        gap: 10px;
        padding: 5px 5px ! Important;
    }

    .kcbo-cart-info {
        justify-content: center;
        gap: 15px;
        font-size: 13px;
    }

    .kcbo-checkout-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .kcbo-category-title {
        font-size: 16px;
    }

    .kcbo-cart-info {
        flex-direction: row;
        gap: 5px;
        text-align: center;
        align-items: baseline;
		width:60%;
    }

    .kcbo-table-wrapper {
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
}

/* Loading and Success States */
.kcbo-success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    animation: slideInRight 0.3s ease;
}

.kcbo-error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #dc3545;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* KC Bulk Order Table Styles - Enhanced with Search & Filter */

/* Search and Filter Container */
#kcbo-search-filter-container {
 
   margin-bottom: 0px;
    background: #f8f9fa;
    padding: 0px;
    border-radius: 0px;
    box-shadow: none;
}
.kcbo-search-wrapper p {
    display: none;
}
.kcbo-search-section {
    display: flex;
    gap: 0px;
    align-items: baseline;
    flex-wrap: wrap;
    justify-content: space-between;
}

/* Search Input Wrapper */
.kcbo-search-wrapper {
    position: relative;
    flex: 2;
    min-width: 300px;
}
div#kcbo-search-filter-container p {
    display: none;
}

.kcbo-search-input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #dee2e6;
    border-radius: 25px;
    font-size: 16px;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.kcbo-search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    transform: translateY(-1px);
}

.kcbo-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.kcbo-search-suggestion {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f1f1f1;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.kcbo-search-suggestion:hover,
.kcbo-search-suggestion.selected {
    background-color: #f8f9fa;
}

.kcbo-search-suggestion:last-child {
    border-bottom: none;
}

.kcbo-suggestion-image {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.kcbo-suggestion-text {
    flex: 1;
}

.kcbo-suggestion-name {
    font-weight: 600;
    color: #212529;
    margin-bottom: 2px;
}

.kcbo-suggestion-details {
    font-size: 12px;
    color: #6c757d;
}

/* Category Filter */
.kcbo-filter-wrapper {
    flex: 1;
    min-width: 200px;
}

.kcbo-category-filter {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.kcbo-category-filter:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Highlighted search results */
.kcbo-product-row.kcbo-search-highlight {
    background-color: #fff3cd !important;
    animation: highlightPulse 2s ease-in-out;
}

@keyframes highlightPulse {
    0%, 100% { background-color: #fff3cd; }
    50% { background-color: #ffeaa7; }
}

/* Hidden rows for filtering */
.kcbo-product-row.kcbo-hidden {
    display: none;
}

/* Responsive Styles */
@media (max-width: 768px) {
	
    .kcbo-search-section {
        flex-direction: row;
        gap: 0px;
    }
	.kcbo-bulk-table td span {
    font-size: 10px;
}
td.kcbo-col-quantity input.kcbo-quantity-input {
    width: 40px;
    height: 25px;
}
.kcbo-col-name {
    min-width: max-content;
}
    .kcbo-search-wrapper, .kcbo-filter-wrapper {
        min-width: auto;
        width: 100%;
    }
    .kcbo-bulk-table {
        font-size: 12px;
    }
    .kcbo-bulk-table th, .kcbo-bulk-table td {
        padding: 8px 4px;
        font-size: 10px !important;
text-align: center;
        text-transform: capitalize;
    }
    .kcbo-product-image {
        width: 40px;
        height: 40px;
    }
    .kcbo-quantity-input {
        width: 50px;
        padding: 4px 6px;
    }
    .kcbo-cart-summary {
        flex-direction: row;
        gap: 10px;
        padding: 12px 15px;
    }
    .kcbo-cart-info {
        justify-content: center;
        gap: 15px;
        font-size: 13px;
    }
    .kcbo-checkout-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}
@media (max-width: 480px) {
.kcbo-cart-actions{
		    width: 42%;
	}
    #kcbo-search-filter-container {
        padding: 0px;
    }
    .kcbo-category-title {
        font-size: 16px;
    }
    .kcbo-cart-info {
flex-direction: row;
        gap: 5px;
        text-align: center;
        width: 71%;
        justify-content: flex-start;
    }
    .kcbo-table-wrapper {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }
}

button#kcbo-add-to-cart {
    font-size: 11px;
}