* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.product-selection-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.product-selection-container .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.product-selection-header {
    background: linear-gradient(135deg, #ff7f00, #ff9500);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(255, 127, 0, 0.3);
}

.product-selection-header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.product-selection-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    align-items: start;
}

/* Sidebar Filters */
.filter-sidebar {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.filter-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #ff7f00;
    position: relative;
}

.filter-header .close-modal {
    position: absolute;
    right: 0;
}

.view-selected-btn {
    background: linear-gradient(135deg, #28a745, #34ce57);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.2);
    min-width: 140px;
    justify-content: center;
}

.view-selected-btn:hover {
    background: linear-gradient(135deg, #218838, #28a745);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.view-selected-btn:active {
    transform: translateY(0);
}

.view-selected-count {
    background: rgba(255, 255, 255, 0.9);
    color: #28a745;
    padding: 0.15rem 0.5rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.filter-header h3 {
    color: #ff7f00;
    font-size: 1.3rem;
    font-weight: 600;
}

.mobile-filter-toggle {
    display: none;
    background: #ff7f00;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 1rem;
}

.search-box {
    margin-bottom: 1.5rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #ff7f00;
}

.category-tabs {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
}

.category-tab {
    font-family: 'Dodger', sans-serif;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    color: black;
}

.category-tab.active {
    font-family: 'Dodger', sans-serif;
    background: #ff7f00;
    color: white;
    border-color: #ff7f00;
}

.category-tab:hover:not(.active) {
    border-color: #ff7f00;
    background: #fff5e6;
    color: black;
}

.subcategory-filters {
    margin-bottom: 1rem;
}

.subcategory-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.subcategory-item:last-child {
    border-bottom: none;
}

.subcategory-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

.subcategory-item input[type="checkbox"] {
    margin-right: 0.75rem;
    transform: scale(1.2);
    accent-color: #ff7f00;
}

/* Product Table */
.product-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.product-header h2 {
    color: #333;
    font-size: 1.8rem;
    font-weight: 600;
}

.selected-count {
    background: #ff7f00;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
}

.loading-skeleton {
    display: none;
}

.loading-skeleton.active {
    display: block;
}

.skeleton-row {
    height: 60px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: 1rem;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.product-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.product-table th,
.product-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.product-table th {
    background: #EB7E25;
    font-weight: 600;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.product-table tr:hover {
    background: #fff5e6;
}

.product-checkbox {
    transform: scale(1.3);
    accent-color: #ff7f00;
}

.unit-select {
    padding: 0.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 100px;
    background: white;
}

.unit-select:focus {
    outline: none;
    border-color: #ff7f00;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    background: #ff7f00;
    color: white;
    padding: 1.5rem;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.close-modal:hover {
    background: rgba(255,255,255,0.2);
}

.modal-content {
    padding: 2rem;
}

.selected-product-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 120px auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 2px solid #f0f0f0;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.selected-product-item:hover {
    border-color: #ff7f00;
    background: #fff5e6;
}

.product-info h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #333;
}

.product-info p {
    color: #666;
    font-size: 0.9rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    background: #ff7f00;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
    margin: auto;
}

.quantity-btn:hover {
    background: #e66d00;
}

.quantity-input {
    width: 60px;
    text-align: center;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.5rem;
    font-weight: 600;
}

.quantity-input:focus {
    outline: none;
    border-color: #ff7f00;
}

.remove-product {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

.remove-product:hover {
    background: #c82333;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 1rem;
}

.total-display {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ff7f00;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-primary {
    background: #ff7f00;
    color: white;
}

.btn-primary:hover {
    background: #e66d00;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #333;
}

.product-selection-container .toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateX(400px);
    transition: transform 0.3s ease-in-out;
    z-index: 1100;
    font-size: 14px;
    font-weight: 500;
    min-width: 250px;
    max-width: 400px;
    word-wrap: break-word;
}

.product-selection-container .toast.show {
    transform: translateX(0);
}

.product-selection-container .toast.error {
    background: #dc3545;
}

.product-selection-container .toast.info {
    background: #17a2b8;
}

.product-selection-container .toast.warning {
    background: #ffc107;
    color: #212529;
}

/* Selected Products Section */
.selected-products-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #c4c4c4;
}

.selected-products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.selected-products-header h3 {
    color: #333;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.selected-products-count {
    background: #28a745;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.selected-products-table {
    margin-top: 1rem;
}

.selected-products-table tbody tr {
    background: #fff5e6;
    border-left: 4px solid #ff7f00;
}

.selected-products-table tbody tr:hover {
    background: #ffe6cc;
}

.selected-product-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.selected-product-name {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.selected-product-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #666;
    flex-wrap: wrap;
}

.selected-product-unit {
    background: #ff7f00;
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.selected-unit-select {
    padding: 0.4rem 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background-color: white;
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1rem;
    padding-right: 2.5rem;
    appearance: none;
}

.selected-unit-select:focus {
    outline: none;
    border-color: #ff7f00;
    box-shadow: 0 0 0 3px rgba(255, 127, 0, 0.1);
}

.selected-unit-select:hover {
    border-color: #ff7f00;
    background-color: #fff5e6;
}    .selected-unit-select option {
        padding: 0.5rem;
        color: #333;
        background-color: white;
    }

    /* Success Popup Modal */
    .success-popup-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        backdrop-filter: blur(5px);
    }

    .success-popup-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .success-popup {
        background: white;
        border-radius: 16px;
        padding: 2.5rem;
        max-width: 500px;
        width: 90%;
        text-align: center;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
        transform: scale(0.8) translateY(20px);
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }

    .success-popup-overlay.active .success-popup {
        transform: scale(1) translateY(0);
    }

    .success-popup::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 5px;
        background: linear-gradient(90deg, #ff7f00, #ff9500, #ffb300);
    }

    .success-popup-icon {
        width: 80px;
        height: 80px;
        background: linear-gradient(135deg, #28a745, #20c997);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 1.5rem;
        animation: successBounce 0.6s ease;
    }

    .success-popup-icon::before {
        content: '✓';
        color: white;
        font-size: 2.5rem;
        font-weight: bold;
    }

    @keyframes successBounce {
        0% { transform: scale(0); }
        50% { transform: scale(1.1); }
        100% { transform: scale(1); }
    }

    .success-popup h2 {
        color: #333;
        font-size: 1.8rem;
        font-weight: 700;
        margin-bottom: 1rem;
        line-height: 1.3;
    }

    .success-popup-order-number {
        background: linear-gradient(135deg, #ff7f00, #ff9500);
        color: white;
        padding: 0.75rem 1.5rem;
        border-radius: 25px;
        font-size: 1.1rem;
        font-weight: 600;
        margin: 1rem 0;
        display: inline-block;
    }

    .success-popup p {
        color: #666;
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }

    .success-popup-actions {
        display: flex;
        gap: 1rem;
        justify-content: center;
        flex-wrap: wrap;
        margin-top: 2rem;
    }

    .success-popup-btn {
        padding: 0.75rem 1.5rem;
        border: none;
        border-radius: 8px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
    }

    .success-popup-btn-primary {
        background: linear-gradient(135deg, #ff7f00, #ff9500);
        color: white;
    }

    .success-popup-btn-primary:hover {
        background: linear-gradient(135deg, #e66f00, #e68500);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(255, 127, 0, 0.3);
    }

    .success-popup-btn-secondary {
        background: #f8f9fa;
        color: #333;
        border: 2px solid #dee2e6;
    }

    .success-popup-btn-secondary:hover {
        background: #e9ecef;
        border-color: #adb5bd;
    }

    .success-popup-close {
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: #999;
        cursor: pointer;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: all 0.2s ease;
    }

    .success-popup-close:hover {
        background: #f8f9fa;
        color: #333;
    }

.selected-product-price {
    font-weight: 600;
    color: #28a745;
}

.quantity-controls-inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
}

.quantity-controls-inline .quantity-btn {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
}

.quantity-controls-inline .quantity-input {
    width: 80px;
    height: 36px;
    font-size: 1rem;
    text-align: center;
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.remove-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.remove-btn:active {
    transform: translateY(0);
}

/* Remove button responsive text */
.remove-btn-mobile {
    display: none;
}

.remove-btn-desktop {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Mobile responsive remove button text */
@media (max-width: 768px) {
    .remove-btn-mobile {
        display: inline-block;
    }
    
    .remove-btn-desktop {
        display: none;
    }
    
    /* Adjust remove button for mobile */
    .remove-btn,
    .remove-product {
        padding: 0.5rem;
        min-width: 44px;
        justify-content: center;
        font-size: 1.2rem;
    }
    
    /* Compact add custom button for mobile */
    .add-custom-btn {
        padding: 0.3rem 0.4rem;
        min-width: 50px;
        font-size: 0.75rem;
        gap: 0.2rem;
    }
}

@media (max-width: 480px) {
    .remove-btn,
    .remove-product {
        padding: 0.4rem;
        min-width: 40px;
        font-size: 1.1rem;
    }
}

.empty-selected-state {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

/* Custom Product Input Row */
.custom-product-row {
    background: #f8f9fa !important;
    border-top: 3px solid #ff7f00;
}

.custom-product-row:hover {
    background: #e9ecef !important;
}

.custom-product-input,
.custom-unit-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: white;
}

.custom-product-input:focus,
.custom-unit-input:focus {
    outline: none;
    border-color: #ff7f00;
    box-shadow: 0 0 0 2px rgba(255, 127, 0, 0.2);
}

.custom-product-input:hover,
.custom-unit-input:hover {
    border-color: #ff9500;
}

.custom-product-input::placeholder,
.custom-unit-input::placeholder {
    color: #999;
    font-style: italic;
}

.add-custom-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.9rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    justify-content: center;
    min-width: 60px;
    white-space: nowrap;
}

.add-custom-btn:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.add-custom-btn:active {
    transform: translateY(0);
}

.add-custom-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.custom-product-row .quantity-controls-inline .quantity-input {
    background: white;
    border: 2px solid #e0e0e0;
}

.custom-product-row .quantity-controls-inline .quantity-input:focus {
    border-color: #ff7f00;
    box-shadow: 0 0 0 2px rgba(255, 127, 0, 0.2);
}

/* Company Information Form */
.company-form-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.company-form-container h3 {
    color: #ff7f00;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-description {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.company-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff7f00;
    box-shadow: 0 0 0 3px rgba(255, 127, 0, 0.1);
    background-color: white;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #999;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

/* Required field indicator */
.form-group label::after {
    content: "";
}

.form-group label[for="companyName"]::after,
.form-group label[for="companyEmail"]::after {
    content: " *";
    color: #e74c3c;
}

/* Form validation styles */
.form-group input:invalid:not(:placeholder-shown) {
    border-color: #e74c3c;
    background-color: #fdf2f2;
}

.form-group input:valid:not(:placeholder-shown) {
    border-color: #27ae60;
    background-color: #f2fdf2;
}

/* Form validation error styles */
.form-group input.error,
.form-group textarea.error {
    border-color: #e74c3c !important;
    background-color: #fdf2f2 !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

/* Success state for forms */
.form-group input:valid:not(:placeholder-shown):not(.error) {
    border-color: #27ae60;
    background-color: #f2fdf2;
}

/* Focus states for better UX */
.form-group input:focus,
.form-group textarea:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 127, 0, 0.15), 0 0 0 3px rgba(255, 127, 0, 0.1);
}

/* Responsive design for company form */
@media (max-width: 768px) {
    .company-form-section {
        margin: 1rem 0;
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .company-form-container h3 {
        font-size: 1.3rem;
    }
    
    .selected-unit-select {
        min-width: 100px;
        font-size: 0.85rem;
        padding: 0.35rem 0.6rem;
        padding-right: 2rem;
    }
    
    .view-selected-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
        min-width: 120px;
        border-radius: 20px;
    }
    
    .view-selected-count {
        font-size: 0.75rem;
        padding: 0.1rem 0.4rem;
        min-width: 18px;
    }
    
    .product-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .product-header > div {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .company-form-section {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 0.65rem;
        font-size: 0.9rem;
    }
    
    .selected-unit-select {
        min-width: 90px;
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem;
        padding-right: 1.8rem;
        background-size: 0.8rem;
    }
    
    .view-selected-btn {
        padding: 0.5rem 0.7rem;
        font-size: 0.8rem;
        min-width: 110px;
        border-radius: 18px;
    }
    
    .view-selected-count {
        font-size: 0.7rem;
        padding: 0.08rem 0.35rem;
        min-width: 16px;
    }
    
    .success-popup {
        padding: 2rem 1.5rem;
        max-width: 400px;
    }
    
    .success-popup h2 {
        font-size: 1.5rem;
    }
    
    .success-popup-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }
    
    .success-popup-icon::before {
        font-size: 2rem;
    }
    
    .success-popup-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .success-popup-btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* Company Form Action Buttons */
.company-form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f0f0f0;
    justify-content: center;
    flex-wrap: wrap;
}

/* Fixed Review Button */
.fixed-review-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #28a745, #34ce57);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 200px;
    justify-content: center;
    transform: translateY(100px);
    opacity: 0;
    visibility: hidden;
}

.fixed-review-btn.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.fixed-review-btn:hover {
    background: linear-gradient(135deg, #218838, #28a745);
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(40, 167, 69, 0.4);
}

.fixed-review-btn:active {
    transform: translateY(-1px);
}

.review-btn-count {
    background: rgba(255, 255, 255, 0.9);
    color: #28a745;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.company-action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 180px;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.company-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.company-action-btn:active {
    transform: translateY(0);
}

.company-action-btn.primary {
    background: linear-gradient(135deg, #ff7f00, #ff9500);
    color: white;
    border: 2px solid transparent;
}

.company-action-btn.primary:hover {
    background: linear-gradient(135deg, #e66d00, #e08500);
    box-shadow: 0 4px 15px rgba(255, 127, 0, 0.3);
}

.company-action-btn.secondary {
    background: linear-gradient(135deg, #28a745, #34ce57);
    color: white;
    border: 2px solid transparent;
}

.company-action-btn.secondary:hover {
    background: linear-gradient(135deg, #218838, #28a745);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.company-action-btn:disabled {
    background: #6c757d;
    color: white;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.company-action-btn:disabled:hover {
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive design for company action buttons */
@media (max-width: 768px) {
    .company-form-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .company-action-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .fixed-review-btn {
        bottom: 20px;
        right: 20px;
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
        min-width: 180px;
        border-radius: 40px;
    }
    
    .review-btn-count {
        font-size: 0.8rem;
        padding: 0.2rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .company-action-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
        min-width: 150px;
    }
    
    .fixed-review-btn {
        bottom: 15px;
        right: 15px;
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        min-width: 160px;
        border-radius: 35px;
    }
    
    .fixed-review-btn:hover {
        transform: translateY(-2px);
    }
    
    .review-btn-count {
        font-size: 0.75rem;
        padding: 0.15rem 0.4rem;
        min-width: 20px;
    }
}

/* Enhanced Mobile Layout System */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .filter-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 400px;
        height: 100vh;
        z-index: 2000;
        transition: left 0.3s ease;
        overflow-y: auto;
        padding: 1rem;
        max-height: 100vh;
        background: white;
        box-shadow: 2px 0 10px rgba(0,0,0,0.3);
        -webkit-overflow-scrolling: touch;
    }
    
    .filter-sidebar.mobile-open {
        left: 0;
    }
    
    /* Enhanced filter sidebar header for mobile */
    .filter-sidebar .filter-header {
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        margin-bottom: 1rem;
        padding-bottom: 1rem;
        border-bottom: 2px solid #ff7f00;
    }
    
    .filter-sidebar .close-modal {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        background: #ff7f00;
        color: white;
        border: none;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        font-size: 1.2rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .filter-sidebar .close-modal:hover {
        background: #e66d00;
        transform: translateY(-50%) scale(1.1);
    }
    
    /* Hide category column on tablet and mobile - only for main product table */
    .product-table:not(.selected-products-table) th:nth-child(3),
    .product-table:not(.selected-products-table) td:nth-child(3) {
        display: none;
    }
    
    /* Mobile backdrop with better touch handling */
    .mobile-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1500;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        touch-action: none;
    }
    
    .mobile-backdrop.active {
        opacity: 1;
        visibility: visible;
    }
    
    .mobile-filter-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        order: 1;
        background: linear-gradient(135deg, #ff7f00, #ff9500);
        border: none;
        color: white;
        padding: 0.875rem 1.25rem;
        border-radius: 25px;
        font-weight: 600;
        font-size: 0.95rem;
        cursor: pointer;
        margin-bottom: 1.5rem;
        box-shadow: 0 2px 10px rgba(255, 127, 0, 0.3);
        transition: all 0.3s ease;
        width: 100%;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .mobile-filter-toggle:hover {
        background: linear-gradient(135deg, #e66d00, #e08500);
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(255, 127, 0, 0.4);
    }
    
    .mobile-filter-toggle:active {
        transform: translateY(0);
    }
    
    .product-selection-container .container {
        display: flex;
        flex-direction: column;
        padding: 15px;
    }
    
    .product-selection-header {
        order: 1;
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .mobile-filter-toggle {
        order: 2;
    }
    
    .main-layout {
        order: 3;
        display: flex;
        flex-direction: column;
    }
    
    .filter-sidebar {
        order: 1;
    }
    
    .product-section {
        order: 2;
        padding: 1.5rem;
    }
    
    .company-form-section {
        order: 4;
        margin-top: 1.5rem;
    }
    
    /* Sticky mobile header for better UX */
    .mobile-sticky-header {
        position: sticky;
        top: 0;
        background: white;
        z-index: 100;
        padding: 1rem 0;
        margin-bottom: 1rem;
        border-bottom: 2px solid #f0f0f0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .mobile-quick-actions {
        display: flex;
        gap: 0.75rem;
        align-items: center;
        flex-wrap: wrap;
    }
    
    /* Enhanced mobile search */
    .mobile-search-enhanced {
        position: relative;
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .mobile-search-enhanced .search-input {
        padding-left: 3rem;
        height: 48px;
        font-size: 1rem;
        border-radius: 25px;
        border: 2px solid #e0e0e0;
        background: #fafafa;
    }
    
    .mobile-search-enhanced::before {
        content: "🔍";
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1.2rem;
        color: #666;
        z-index: 1;
    }
    
    .mobile-search-enhanced .search-input:focus {
        background: white;
        border-color: #ff7f00;
        box-shadow: 0 0 0 3px rgba(255, 127, 0, 0.1);
    }
}

/* Mobile Animations and Micro-interactions */
@media (max-width: 768px) {
    /* Mobile selected products table - prevent horizontal scrolling */
    .selected-products-table {
        table-layout: fixed;
        width: 100%;
        max-width: 100%;
        overflow: visible;
    }
    
    /* Mobile table column widths for selected products - equal 25% each */
    .selected-products-table th:first-child,
    .selected-products-table td:first-child {
        width: 25%;
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
    
    .selected-products-table th:nth-child(2),
    .selected-products-table td:nth-child(2) {
        width: 25%;
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
    
    .selected-products-table th:nth-child(3),
    .selected-products-table td:nth-child(3) {
        width: 25%;
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
    
    .selected-products-table th:nth-child(4),
    .selected-products-table td:nth-child(4) {
        width: 25%;
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
    
    /* Compact mobile product details */
    .selected-product-details {
        font-size: 0.8rem;
        line-height: 1.2;
    }
    
    .selected-product-name {
        font-size: 0.8rem;
        font-weight: 600;
        margin-bottom: 0.1rem;
    }
    
    .selected-product-meta {
        font-size: 0.7rem;
        gap: 0.5rem;
    }
    
    .selected-product-unit {
        font-size: 0.65rem;
        padding: 0.1rem 0.3rem;
    }
    
    /* Compact mobile unit select */
    .selected-unit-select {
        min-width: 80px;
        font-size: 0.75rem;
        padding: 0.25rem 0.4rem;
        padding-right: 1.5rem;
        background-size: 0.7rem;
    }
    
    /* Compact mobile quantity controls */
    .quantity-controls-inline {
        gap: 0.25rem;
        justify-content: center;
    }
    
    .quantity-controls-inline .quantity-btn {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
        padding: 0;
    }
    
    .quantity-controls-inline .quantity-input {
        width: 50px;
        height: 28px;
        font-size: 0.8rem;
        padding: 0.2rem;
    }
    
    /* Compact mobile remove button */
    .remove-btn {
        padding: 0.35rem;
        min-width: 36px;
        font-size: 1rem;
    }
    
    /* Smooth mobile transitions */
    .mobile-transition {
        transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    }
    
    /* Mobile button press animations */
    .mobile-btn-press {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* Mobile swipe indicators */
    .mobile-swipe-indicator {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        color: #ff7f00;
        font-size: 1.2rem;
        opacity: 0.7;
        animation: swipeHint 2s ease-in-out infinite;
    }
    
    .mobile-swipe-indicator.left {
        left: 10px;
    }
    
    .mobile-swipe-indicator.right {
        right: 10px;
    }
    
    @keyframes swipeHint {
        0%, 100% { transform: translateY(-50%) translateX(0); opacity: 0.7; }
        50% { transform: translateY(-50%) translateX(5px); opacity: 1; }
    }
    
    /* Mobile progress indicators */
    .mobile-progress-bar {
        width: 100%;
        height: 4px;
        background: #f0f0f0;
        border-radius: 2px;
        overflow: hidden;
        margin: 1rem 0;
    }
    
    .mobile-progress-fill {
        height: 100%;
        background: linear-gradient(90deg, #ff7f00, #ff9500);
        border-radius: 2px;
        transition: width 0.3s ease;
    }
    
    /* Mobile notification badges */
    .mobile-notification-badge {
        position: absolute;
        top: -8px;
        right: -8px;
        background: #dc3545;
        color: white;
        border-radius: 50%;
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        animation: bounceIn 0.5s ease;
    }
    
    @keyframes bounceIn {
        0% { transform: scale(0); }
        50% { transform: scale(1.2); }
        100% { transform: scale(1); }
    }
    
    /* Mobile error states */
    .mobile-error-state {
        text-align: center;
        padding: 2rem 1rem;
        color: #666;
    }
    
    .mobile-error-icon {
        font-size: 3rem;
        color: #dc3545;
        margin-bottom: 1rem;
        animation: shake 0.5s ease-in-out;
    }
    
    @keyframes shake {
        0%, 100% { transform: translateX(0); }
        25% { transform: translateX(-5px); }
        75% { transform: translateX(5px); }
    }
    
    .mobile-error-title {
        font-size: 1.2rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
        color: #333;
    }
    
    .mobile-error-message {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }
    
    .mobile-retry-btn {
        background: #ff7f00;
        color: white;
        border: none;
        padding: 0.75rem 1.5rem;
        border-radius: 8px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .mobile-retry-btn:hover {
        background: #e66d00;
        transform: translateY(-2px);
    }
}

/* Extra Small Mobile Devices (< 480px) */
@media (max-width: 480px) {
    /* Ultra-compact selected products table */
    .selected-products-table th,
    .selected-products-table td {
        padding: 0.4rem 0.15rem;
        font-size: 0.75rem;
    }
    
    .selected-product-name {
        font-size: 0.75rem;
    }
    
    .selected-product-meta {
        font-size: 0.65rem;
    }
    
    .selected-unit-select {
        min-width: 70px;
        font-size: 0.7rem;
        padding: 0.2rem 0.3rem;
        padding-right: 1.3rem;
    }
    
    .quantity-controls-inline .quantity-btn {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
    
    .quantity-controls-inline .quantity-input {
        width: 40px;
        height: 24px;
        font-size: 0.75rem;
    }
    
    .remove-btn {
        padding: 0.25rem;
        min-width: 32px;
        font-size: 0.9rem;
        margin: auto;
    }
    
    /* Ultra-compact add custom button for extra small screens */
    .add-custom-btn {
        padding: 0.5rem 0.5rem;
        min-width: 45px;
        font-size: 0.7rem;
        gap: 0.15rem;
        margin: auto;
    }
    
    /* Ultra-compact mobile layout */
    .product-selection-container .container {
        padding: 8px;
    }
    
    .product-selection-header {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .product-selection-header h1 {
        font-size: 1.5rem;
    }
    
    .product-selection-header p {
        font-size: 0.9rem;
    }
    
    /* Compact mobile filter sidebar */
    .filter-sidebar {
        width: 95%;
        padding: 0.75rem;
    }
    
    .filter-sidebar .close-modal {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    
    .category-tab {
        padding: 0.75rem;
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .search-input {
        height: 44px;
        font-size: 0.95rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* Compact mobile table */
    .product-table {
        font-size: 0.8rem;
    }
    
    .product-table th {
        font-size: 0.75rem;
        padding: 0.5rem 0.25rem;
    }
    
    .product-table td {
        /* padding: 0.9rem 0.25rem; */
    }
    
    /* Compact mobile forms */
    .form-group input,
    .form-group textarea {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    /* Compact mobile buttons */
    .mobile-filter-toggle {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .view-selected-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-width: 120px;
    }
    
    .company-action-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
    
    /* Compact mobile modals */
    .modal-header {
        padding: 1rem;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .modal-content {
        padding: 1rem;
    }
    
    .btn {
        height: 44px;
        font-size: 0.9rem;
    }
    
    /* Compact mobile cards */
    .mobile-product-card {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .mobile-product-card-title {
        font-size: 0.9rem;
    }
    
    .mobile-product-card-tag {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* Compact mobile bottom bar */
    .mobile-sticky-bottom-bar {
        padding: 0.75rem;
    }
    
    .mobile-review-order-btn {
        height: 44px;
        font-size: 0.9rem;
    }
    
    .mobile-selected-count-indicator {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    /* Compact mobile floating button */
    .mobile-fab {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
        bottom: 70px;
        right: 15px;
    }
    
    .fixed-review-btn {
        bottom: 15px;
        right: 15px;
        padding: 0.65rem 0.9rem;
        font-size: 0.8rem;
        min-width: 140px;
    }
}

/* Landscape orientation optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .product-selection-header {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .product-selection-header h1 {
        font-size: 1.6rem;
    }
    
    .filter-sidebar {
        width: 50%;
        max-width: 300px;
    }
    
    .modal {
        max-height: 95vh;
        width: 95%;
        max-width: 600px;
    }
    
    .mobile-sticky-bottom-bar {
        position: static;
        box-shadow: none;
        border-top: none;
        padding: 1rem 0;
    }
}

/* High DPI mobile screens */
@media (max-width: 768px) and (-webkit-min-device-pixel-ratio: 2) {
    .product-table th,
    .product-table td {
        border-bottom-width: 0.5px;
    }
    
    .mobile-product-card {
        box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    }
    
    .filter-sidebar {
        box-shadow: 1px 0 5px rgba(0,0,0,0.3);
    }
}

/* Font Awesome Fallback Styles */
/* In case Font Awesome doesn't load, provide fallback text for icons */
.fa-xmark::before {
    content: "×";
    font-family: Arial, sans-serif;
    font-weight: normal;
}

.fa-solid.fa-xmark:not(.fa):before {
    content: "×";
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 1.2em;
}

/* Ensure Font Awesome icons display properly */
.fa-solid {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    -webkit-font-smoothing: antialiased;
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

/* Box sizing for all elements */
