/*****************************************************************
 * Alert Styles
 *****************************************************************/
#cfw-alert-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    max-width: 300px;
}

.cfw-alert {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 3px;
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

.cfw-alert-warning {
    background-color: #ff9800;
}

.cfw-alert-error {
    background-color: #f44336;
}

.cfw-alert-success {
    background-color: #4caf50;
}

.cfw-alert-content {
    flex-grow: 1;
}

.cfw-alert-content p {
    margin: 0;
}

.cfw-alert-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    margin-left: 12px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.cfw-alert-close:hover {
    opacity: 1;
}

/*****************************************************************
 * Custom Login Styles
 *****************************************************************/
body.login {
    background: linear-gradient(120deg, #fdfbfb 0%, #d2d2e6 100%);
    color: #3c4755;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    backdrop-filter: blur(100px);
}

#login h1 a,
.login h1 a {
    height: 50px;
    width: 250px;
    background-size: contain;
    background-repeat: no-repeat;
    padding-bottom: 10px;
}

.login form {
    border-radius: 10px;
    margin-top: 20px;
    padding: 26px 24px 34px;
    font-weight: 400;
    overflow: hidden;
    color: #3c4755;
    border: none;
    background: #fbfbff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.login form label,
.login #nav,
.login #backtoblog {
    font-size: 1.1rem;
}

.login form .forgetmenot {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
}

#user_login,
#user_pass,
.login form > p > input {
    background: white;
    border: 1px solid #ddd;
    color: #333;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
}

.wp-core-ui .button-primary {
    background: #47c0a5;
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.wp-core-ui .button-primary:hover {
    background: #602da5;
}

.wp-login-lost-password,
#backtoblog > a {
    color: #202531 !important;
    text-decoration: underline;
}

#login-message {
    color: #202531;
}

/* Responsive Adjustments for Login */
@media screen and (max-width: 480px) {
    #login h1 a,
    .login h1 a {
        background-size: contain;
        height: 40px;
        width: 200px;
    }

    .login form {
        padding: 20px;
    }

    #user_login,
    #user_pass,
    .login form > p > input {
        padding: 8px;
    }

    .login button.button-primary {
        padding: 8px 16px;
    }
}

/*****************************************************************
 * Common Styles
 *****************************************************************/
.woocommerce input.input-text,
.woocommerce-page input.input-text {
    width: 100%; /* Full width */
    padding: 10px; /* Comfortable padding around the text */
    font-size: 14px; /* Adequate font size */
    box-sizing: border-box; /* Include padding and border in the element's size */
    min-width: 50px; /* Minimum width */
    max-width: 100%; /* Maximum width, it can be a specific value as well */
}

/*****************************************************************
 * Custom Address Book Styles
 *****************************************************************/
.cfw-address-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    border-bottom: 1px solid #eee;
}

.cfw-address-title {
    margin: 0;
    background-color: #f1f1f1;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 5px;
}

.cfw-address-actions {
    display: flex;
    gap: 10px;
    margin: 5px 0;
}

.cfw-icon-button {
    background: none;
    border: none;
    padding: 2px 8px;
    cursor: pointer;
    border-radius: 4px;
}

.cfw-icon-button:hover {
    background-color: #f0f0f0;
}

.cfw-icon-button i {
    font-size: 16px;
}

#cfw-cab-add-address-billing i,
#cfw-cab-add-address-shipping i {
    color: #28a745;
}

button[name="save_addresses_billing"] i,
button[name="save_addresses_shipping"] i {
    color: #007bff;
}

button[name="remove_address_billing"] i,
button[name="remove_address_shipping"] i {
    color: #dc3545;
}

.cfw-address-management {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 0 auto;
    padding: 5px;
}

.cfw-cab-address {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 10px;
    flex: 1 1 calc(50% - 20px); /* Default to 50% width minus gap */
    min-width: 280px; /* Prevent too narrow containers */
}

@media (min-width: 768px) {
    .cfw-cab-address {
        flex: 1 1 calc(50% - 20px);
    }
}

/* Only stack on very small screens */
@media (max-width: 767px) {
    .cfw-cab-address {
        flex: 1 1 100%;
    }
}

.cfw-cab-address .row {
    display: flex;
    flex-wrap: wrap;
    margin: -15px;
}

.cfw-cab-address .form-row {
    margin-bottom: 10px;
}

.cfw-cab-address .col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 15px;
}

@media (min-width: 600px) {
    .cfw-cab-address .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

.cfw-cab-address .form-group {
    margin-bottom: 15px;
}

.cfw-cab-address label, .cfw-cab-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.cfw-account-info-container {
    background-color: #f7f7f7;
    border-radius: 4px;
    padding: 0 5px;
    margin-top: 1.8rem;
    margin-bottom: 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.cfw-account-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    width: 100%;
}

.cfw-cab-label {
    width: 40%;
    text-align: left;
    font-weight: 600;
}

.cfw-label-wrapper {
    width: 60%;
    text-align: left;
}

.cfw-label-style-code {
    display: block;
    font-family: monospace;
    font-weight: 500;
}

.cfw-cab-address .form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    background-color: #fff;
    border-radius: 4px;
}

.cfw-cab-address .form-group input {
    font-family: monospace;
}

.cfw-cab-address .form-control:focus {
    border-color: var(--common-input-active, #66afe9);
    outline: none;
    box-shadow: 0 0 5px rgba(102, 175, 233, 0.6);
}

.cfw-cab-button {
    padding: 10px 20px;
    border: none;
    background-color: #f0f0f0;
    color: #333;
    cursor: pointer;
    margin-right: 10px;
    border-radius: 4px;
}

.cfw-cab-button-add {
    background-color: #4caf50;
    color: #fff;
}

.cfw-cab-button-remove {
    background-color: #f44336;
    color: #fff;
}

.cfw-cab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

#cfw_b2b_billing_address_modify_email_contact_text {
    font-size: 0.9rem;
    font-style: italic;
}

/* Hide address codes and select field */
#shipping_address_code_field,
#billing_address_code_field,
#billing_address_select_field {
    display: none !important;
}

/* Disabled inputs styling */
input[readonly],
select[disabled] {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

/* Responsive adjustments for smaller devices */
@media (max-width: 600px) {
    .cfw-cab-address {
        padding: 15px;
    }

    .cfw-cab-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .cfw-cab-button {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/*****************************************************************
 * User Switching Styles
 *****************************************************************/
/* Modal container */
.cfw-user-switch-modal {
    display: none;
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6); /* Darker overlay */
    backdrop-filter: blur(5px); /* Add a blur effect */
    color: #333333;
}

/* Modal content */
.cfw-user-switch-modal-content {
    background-color: rgba(255, 255, 255, 1.0);
    margin: 10% auto;
    padding: 32px;
    border-radius: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.08);
    width: 90%;
    max-width: 600px;
    animation: fadeIn 0.3s ease-out;
}

.cfw-user-switch-modal-content > div > h2 {;
    color: #333;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header container for title, icon, and close button */
.cfw-user-switch-modal-header {
    display: flex;
    justify-content: flex-start; /* Align items to the start (left) */
    align-items: center;
    margin-bottom: 20px;
    gap: 10px; /* Add some space between the icon and the text */
}

/* User switch title */
.cfw-user-switch-modal-header h2 {
    font-size: 24px;
    color: #333;
    margin: 0;
    text-align: left;
    flex: 1; /* Allow the text to take up available space */
}

/* Close button */
.cfw-user-switch-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    margin-left: auto; /* Push the close button to the right */
}

.cfw-user-switch-close:hover,
.cfw-user-switch-close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* SVG container */
.cfw-user-switch_modal {
    display: block;
    width: 32px;
    height: 32px;
    margin: 0;
    content: url("../images/cfw-user-switching_modal.svg");
}

#user-switching-modal > div > p:nth-child(2) > span.select2.select2-container.select2-container--default {
    box-sizing: border-box;
    display: block;
    margin: 0;
    position: relative;
}

/* User search select */
#user-search-select {
    padding: 10px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-bottom: 20px;
    width: 100%;
    height: auto;
}

/* User search results */
#user-search-results {
    margin-top: 20px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .cfw-user-switch-modal-content {
        width: 95%;
        margin: 20% auto;
    }
}

.cfw-user-switch-user-link,
.cfw-user-switch-user-link:hover {
    cursor: pointer;
}

.cfw-user-switch-back-button {
    text-decoration: none;
    padding: 10px;
    background-color: lightyellow;
    border-radius: 5px;
}

.cfw-user-switching-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #ffba00;
    color: #101010;
    text-align: left;
    padding: 5px 10px;
    z-index: 9999;
}

.cfw-user-switching-bar a {
    color: #101010;
    font-weight: 600;
    text-decoration: underline;
}

.cfw-user-switching-bar p {
    padding: 0;
    display: inline;
    margin: 0 10px 0 0;
}

/* Make sure AR Customer switcher styling matches user switcher */
#arcust-switching-modal {
    display: none;
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    color: #333333;
}

/* Ensure AR customer styling matches user switching */
.user-result {
    padding: 8px 0;
}

.arcust-code {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 3px;
}

.arcust-name {
    color: #666;
    font-size: 0.9em;
    margin: 2px 0;
}

/* Current customer display styling */
.cfw-user-switch-modal-content p {
    margin: 15px 0;
    font-size: 14px;
    color: #555;
}

.cfw-user-switch-modal-content p strong {
    color: #333;
    font-weight: 600;
}

/*****************************************************************
 * Transactions and DataTables
 *****************************************************************/
/* Container for the transaction table */
.cfw-transaction-table-container {
    margin: 20px 0;
    font-family: 'Montserrat', sans-serif;
}

.dt-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.dt-buttons {
    margin-right: 10px;
}

.dataTables_filter {
    margin-left: 10px;
}

/* Transaction Table Styles */
.cfw-table td {
    border: none;
    border-bottom: 1px solid #dddddd;
}

#cfw-transaction-table,
#cfw-transaction-details-table,
.responsive-table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.875rem;
    white-space: nowrap;
}

/* Table header and cell styles */
#cfw-transaction-table th,
#cfw-transaction-table td,
#cfw-transaction-details-table th,
#cfw-transaction-details-table td,
.responsive-table th,
.responsive-table td {
    padding: 12px;
    text-align: left;
}

#cfw-transaction-table th,
#cfw-transaction-details-table th,
.responsive-table th {
    font-size: 0.9rem;
    background-color: #f8f8f8;
    font-weight: 600;
    color: #333;
}

/* Table row hover effect */
#cfw-transaction-table tbody tr:hover,
#cfw-transaction-details-table tbody tr:hover,
.responsive-table tbody tr:hover {
    background-color: #fcfcfc;
    cursor: pointer;
}

/* Responsive table wrapper */
.table-responsive {
    overflow-x: auto;
}

/* Dropdown menu */
.dropdown-menu {
    position: absolute;
    z-index: 1000;
    display: none;
    float: left;
    min-width: 160px;
    padding: 5px;
    margin: 5px;
    font-size: 14px;
    text-align: left;
    list-style: none;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
}

.dropdown-menu li {
    margin: 5px 0;
}

/* DataTables button styles */
div.dt-buttons > button {
    background: #fff !important;
    border: #fff;
}

/* Modal overlay */
.cfw-transaction-modal,
.cfw-transaction-modal .ui-widget {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 90%;
    height: auto;
    max-height: 90%;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    overflow: auto;
    padding: 30px;
}

/* Modal Dialog Overlay */
div.ui-dialog::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.ui-dialog,
.ui-dialog .ui-dialog-titlebar,
.ui-dialog .ui-dialog-content,
.ui-dialog .ui-dialog-buttonpane {
    background-color: rgba(255, 255, 255, 1) !important;
}

.cfw-transaction-modal .ui-dialog-content {
    padding: 20px;
}

.cfw-transaction-modal .ui-dialog-titlebar {
    background-color: #f8f8f8;
    border-bottom: 1px solid #ddd;
    padding: 10px;
    font-weight: bold;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.cfw-transaction-modal .ui-dialog-titlebar-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
}

.cfw-transaction-modal .ui-dialog-titlebar-close:hover {
    color: #333;
}

.cfw-transaction-table-currency {
    font-weight: 600;
    color: #1c5550;
    white-space: nowrap;
}

.cfw-transaction-table-button-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.cfw-transaction-table-button-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top: 2px solid #999;
    border-radius: 50%;
    animation: cfw-spin 1s linear infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cfw-transaction-modal-content {
        width: 95%;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .cfw-transaction-modal-content {
        padding: 10px;
    }
}

/*****************************************************************
 * Invoice Styles
 *****************************************************************/
.cfw-invoice-container {
    font-family: 'Montserrat', sans-serif;
    width: 100%;
    max-width: 95%;
    margin: 0 auto;
    box-sizing: border-box;
    background-color: #fff;
}

.cfw-invoice-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.cfw-logo-placeholder {
    width: 200px;
    background-color: transparent;
}

.cfw-invoice-info h1 {
    font-size: 28px;
    color: #333;
    margin: 0 0 10px 0;
}

.cfw-invoice-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.cfw-meta-group {
    width: 48%;
}

.cfw-meta-item {
    margin-bottom: 10px;
}

.cfw-meta-item div {
    line-height: 1.2;
}

.cfw-meta-label {
    font-weight: 900;
    color: #555;
}

h5.cfw-meta-label {
    margin: 2px;
}

.cfw-invoice-items {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

table.cfw-invoice-items {
    border: unset;
}

.cfw-invoice-items thead tr {
    background-color: #e0e0e0;
    padding: 10px;
    text-align: left;
    border-radius: 8px;
    border: 1px solid transparent;
    color: #333;
    font-weight: bold;
}

.cfw-invoice-items thead tr th {
    padding: 10px;
    border: none;
}

.cfw-invoice-items tbody tr {
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.cfw-invoice-items tbody tr td {
    padding: 10px;
    border: none;
}

.cfw-invoice-summary {
    margin-left: auto;
    width: 300px;
}

.cfw-summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.cfw-summary-item.cfw-total {
    font-weight: bold;
    font-size: 18px;
    border-top: 2px solid #e0e0e0;
    padding-top: 5px;
    margin-top: 5px;
}

.cfw-invoice-footer {
    margin-top: 20px;
    text-align: center;
    color: #666;
}

@media print {
    body * {
        visibility: hidden;
    }

    #cfw-invoice-content,
    #cfw-invoice-content * {
        visibility: visible;
    }

    #cfw-invoice-content {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: none;
    }

    .cfw-modal-header,
    .cfw-modal-actions {
        display: none;
    }

    .cfw-invoice-container {
        border: none;
    }
}

/*****************************************************************
 * Jagged Little Pills Styles
 *****************************************************************/
.pill {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8em;
    font-weight: 600;
    background-color: #e7eaf0;
    border: none;
    color: #32335d;
    padding: 1px 10px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    border-radius: 32px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pill-large {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8em;
    font-weight: 600;
    background-color: #e7eaf0;
    border: none;
    color: #32335d;
    padding: 1px 10px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Pill color variations */
.pill-gray {
    background-color: #e7eaf0;
    color: #32335d;
}

.pill-blue {
    background-color: #c4effe;
    color: #32335d;
}

.pill-aqua {
    background-color: #b8feff;
    color: #20437a;
}

.pill-green {
    background-color: #d5fbcf;
    color: #1c5550;
}

.pill-mint {
    background-color: var(--mint-light);
    color: var(--wc-text);
}

.pill-teal {
    background-color: var(--teal-medium);
    color: var(--wc-text);
}

.pill-yellow {
    background-color: #fbf4b2;
    color: #9e341f;
}

.pill-red {
    background-color: var(--wc-red);
    color: white;
}

.pill-orange {
    background-color: #fbefc0;
    color: #8d202e;
}

.pill-pink {
    background-color: #fce1f5;
    color: #4c2478;
}

.pill-purple {
    background-color: var(--purple-medium);
    color: white;
}

/*****************************************************************
 * UOM Selector Styles
 *****************************************************************/
body .uom-selector {
    margin-bottom: 1em !important;
}

body .uom-selector label {
    margin-right: 1em !important;
}

/* Ensure Tom Select container fits the design */
.ts-wrapper {
    width: 100%;
    max-width: 100%;
    font-size: 1rem;
    color: #333;
    background: #fff;
    border-radius: 6px;
    box-shadow: none;
    margin: 0;
    padding: 0;
    border: none;
}

.ts-control {
    border: 1px solid #d1d5db; /* Tailwind gray-300 */
    border-radius: 6px;
    background: #fff;
    padding: 0.75em 1em;
    min-height: 44px;
    font-size: 1rem;
    color: #333;
    box-shadow: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
}

.ts-control input::placeholder {
    color: #9ca3af; /* Tailwind gray-400 */
    opacity: 1;
}

/*****************************************************************
 * Warehouse/Stock Additional Data Shortcode
 *****************************************************************/
/* General styling */
.custom-warehouse-data {
    margin: 20px auto; /* Center align by default */
    font-size: 14px;
    text-align: center; /* Ensures internal text is centered */
}

/* Left alignment */
.custom-warehouse-data.alignleft {
    margin: 20px auto 20px 0; /* Align left */
    text-align: left; /* Align content to the left */
}

/* Center alignment */
.custom-warehouse-data.aligncenter {
    margin: 20px auto; /* Align center */
    text-align: center; /* Center content */
}

/* Right alignment */
.custom-warehouse-data.alignright {
    margin: 20px 0 20px auto; /* Align right */
    text-align: right; /* Align content to the right */
}

.warehouse-data-container {
    display: table;
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.warehouse-data-row {
    display: table-row;
}

.warehouse-data-header {
    background-color: #f1f1f1;
    font-weight: bold;
}

.warehouse-data-cell,
.warehouse-data-header .warehouse-data-cell {
    display: table-cell;
    padding: 10px;
    text-align: center;
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.warehouse-data-cell:last-child {
    border-right: none;
}

.warehouse-data-row:last-child .warehouse-data-cell {
    border-bottom: none;
}

/* Alternate row background */
.warehouse-data-row:nth-child(even):not(.warehouse-data-header) {
    background-color: #f9f9f9;
}

/* Responsive adjustments for Warehouse Data */
@media (max-width: 768px) {
    .custom-warehouse-data {
        font-size: 12px;
    }

    .warehouse-data-cell {
        padding: 8px 5px;
    }
}

/* For very small screens, allow horizontal scrolling */
@media (max-width: 480px) {
    .custom-warehouse-data {
        overflow-x: auto;
    }

    .warehouse-data-container {
        min-width: 480px;
    }
}

/* General modal styles */
.cfw-modal {
    display: none;
    position: fixed;
    z-index: 9995;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.cfw-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    border-radius: 5px;
    width: 90%;
    max-width: 900px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

.cfw-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.cfw-modal-body {
    flex-grow: 1;
    overflow: auto;
}

.cfw-modal-close {
    float: right;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    background-color: var(--common-light-gray);
    color: var(--common-dark-gray) !important;
    border: 1px solid var(--common-dark-gray) !important;
}

.cfw-modal-close:hover,
.cfw-modal-close:focus {
    background-color: var(--common-dark-gray) !important;
    color: var(--common-off-white) !important;
    text-decoration: none;
}

.cfw-modal-loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 3px solid var(--common-off-white);
    border-top: 3px solid var(--common-purple);
    border-radius: 50%;
    animation: cfw-spin 1s linear infinite;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease-out;
}

.cfw-modal:not(.loading) .cfw-modal-loader {
    opacity: 0;
    pointer-events: none;
}

.cfw-modal:not(.loading) .cfw-modal-content {
    opacity: 1;
}

/* Transaction details modal specific styles */
#cfw-transaction-details .cfw-modal-content {
    max-width: 1000px;
}

/* PDF modal specific styles */
#cfw-pdf-modal {
    z-index: 9999;
}

#cfw-pdf-modal .cfw-modal-content {
    max-width: 95%;
    width: auto;
    height: 90vh;
    padding: 20px;
}

#cfw-pdf-modal .cfw-modal-body {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10px;
}

#pdf-canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Button styles */
.pdf-button,
.cfw-pdf-button,
.cfw-transaction-modal-button {
    padding: 5px 10px;
    margin-right: 10px;
    background-color: transparent;
    color: var(--common-input-active);
    border: 1px solid var(--common-input-active);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.pdf-button:hover,
.cfw-pdf-button:hover,
.cfw-transaction-modal-button:hover {
    background-color: var(--common-input-active);
    color: white;
}

/* Responsive adjustments */
@media screen and (max-width: 600px) {
    .cfw-modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .pdf-button,
    .cfw-pdf-button {
        padding: 8px 16px;
        font-size: 14px;
    }
}

/* Table styles within modals */
.cfw-modal table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.cfw-modal th,
.cfw-modal td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.cfw-modal th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.cfw-modal tr:nth-child(even) {
    background-color: #f9f9f9;
}

.cfw-modal tr:hover {
    background-color: #f5f5f5;
}

/* Tom Select */
.ts-wrapper {
    position: relative;
    width: 100%;
}

.ts-control {
    position: relative;
    z-index: 1006;
    background-color: #f0f0f0;
    border: 1px solid transparent;
    padding: 10px 15px;
    margin: 5px 0;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease,
    border-color 0.3s ease;
    height: 40px;
    line-height: 20px;
    font-size: 1rem;
    display: flex !important;
    align-items: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.ts-wrapper .ts-control {
    border-color: transparent;
}

.ts-dropdown {
    position: absolute;
    z-index: 1007;
    background-color: white;
    border: 1px solid #ccc;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
}

.ts-dropdown .optgroup-header {
    background: #e7eaf0 !important;
    font-weight: 600;
}

.ts-dropdown-content {
    background-color: white;
    max-height: none;
    overflow: visible;
}

.ts-dropdown .option {
    padding: 8px 10px;
    white-space: normal;
}

.ts-dropdown .option:hover {
    background-color: var(--common-off-white);
}

.ts-dropdown .active {
    background-color: #f0f0f0;
}

.ts-wrapper.single .ts-control {
    background: var(--common-off-white);
    padding-right: 30px !important; /* Make room for the dropdown arrow */
    flex-direction: row;
    align-content: center;
}

.ts-wrapper.single .ts-control:after {
    border-color: #602da5 transparent transparent transparent;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

.ts-control,
.ts-wrapper.single.input-active .ts-control {
    background: unset;
    cursor: text;
}

/* New styles for single-line fix */
.ts-control > input {
    flex: 1 !important;
    min-width: 5px !important;
    width: auto !important;
    text-overflow: ellipsis !important;
}

.ts-control .item {
    max-width: calc(100% - 20px) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Tom Select accessibility: hide original select but keep accessible */
.ts-hidden-accessible {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
    white-space: nowrap !important;
}

/********************************************************/
/* Styles for the password reset form */
/********************************************************/

.cfw-password-reset-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.cfw-password-reset-form h2 {
    text-align: center;
    margin-bottom: 20px;
}

.cfw-password-reset-form form p {
    margin-bottom: 15px;
}

.cfw-password-reset-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.cfw-password-reset-form input[type="password"] {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
}

.cfw-password-reset-form .button {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: #007cba;
    color: #fff;
    border: none;
    cursor: pointer;
}

.cfw-password-reset-form .button:hover {
    background-color: #005a94;
}

.cfw-password-reset-form .error {
    color: #d9534f;
    margin-bottom: 15px;
}

.cfw-password-reset-form .success {
    color: #5cb85c;
    margin-bottom: 15px;
}

/* Customer/User Switching Styles */
.cfw-modal-hidden {
    display: none;
}

.cfw-modal-visible {
    display: block;
}

.cfw-switch-notification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    padding: 16px 20px;
    z-index: 999999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: cfw-slideDown 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.cfw-switch-notification:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(2px);
}

.cfw-switch-notification.cfw-error {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.cfw-switch-notification.cfw-error:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
}

.cfw-notification-message {
    flex: 1;
    text-align: center;
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.3px;
}

.cfw-notification-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
}

.cfw-notification-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.cfw-notification-dismissing {
    animation: cfw-slideUp 0.3s ease-out forwards;
}

@keyframes cfw-slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes cfw-slideUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

@keyframes cfw-fadeOut {
    0% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Responsive adjustments for notification */
@media (max-width: 600px) {
    .cfw-switch-notification {
        padding: 12px 15px;
    }

    .cfw-notification-message {
        font-size: 14px;
    }

    .cfw-notification-close {
        width: 28px;
        height: 28px;
        font-size: 20px;
    }
}

.cfw-loading-progress-bar {
    --uib-size: 80px;
    --uib-speed: 1.55s;
    --uib-color: var(--common-dark-gray);
    --uib-line-weight: 5px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--uib-line-weight);
    width: var(--uib-size);
    border-radius: calc(var(--uib-line-weight) / 2);
    overflow: hidden;
    transform: translate3d(0, 0, 0);
}

.cfw-loading-progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-color: var(--common-light-gray);
    opacity: 0.1;
}

.cfw-loading-progress-bar::after {
    content: '';
    height: 100%;
    width: 100%;
    border-radius: calc(var(--uib-line-weight) / 2);
    animation: cfw-loading-progress-bar-animation var(--uib-speed) ease-in-out infinite;
    transform: translateX(-90%);
    background-color: var(--common-dark-gray);
}

@keyframes cfw-loading-progress-bar-animation {
    0%,
    100% {
        transform: translateX(-90%);
    }

    50% {
        transform: translateX(90%);
    }
}

.cfw-loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.cfw-loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--common-light-gray);
    border-top-color: var(--common-purple);
    border-radius: 50%;
    animation: cfw-spin 1s linear infinite;
}

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

.cfw-switch-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: oklch(20.5% 0 0);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999998;
}

.cfw-switch-status-text {
    margin-top: 40px;
    font-weight: 800;
    color: oklch(20.5% 0 0);
    font-size: 18px;
    text-align: center;
    z-index: 999999;
}

.woocommerce-checkout .select2-container,
.select2-container {
    width: auto;
}

.cfw-page-loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: oklch(20.5% 0 0);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cfw-page-loading-container.active {
    opacity: 1;
    visibility: visible;
}

.cfw-page-loading-spinner {
    width: 200px;
    height: 4px;
    background-color: oklch(55.6% 0 0);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.cfw-page-loading-spinner::before {
    content: "";
    position: absolute;
    left: -50%;
    width: 50%;
    height: 100%;
    background-color: #ffffff;
    border-radius: 2px;
    animation: cfw-loading-bar 1.5s ease-in-out infinite;
}

@keyframes cfw-loading-bar {
    0% {
        left: -50%;
    }
    50% {
        left: 100%;
    }
    100% {
        left: -50%;
    }
}

/* Mini Cart Dynamic Pricing Styles */
.mini-cart__detail-product .price-item.item-price {
    transition: opacity 0.3s ease;
}

.mini-cart__detail-product .price-item.item-price.updating {
    opacity: 0.6;
}

.cart-detail .cfw-loading-progress-bar {
    width: 50px;
    height: 2px;
}

.widget_shopping_cart_content .cfw-loading-progress-bar {
    width: 50px;
    height: 2px;
}

.cfw-zero-price-disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
}

.cfw-zero-price-disabled:hover {
    opacity: 0.6 !important;
}

.cfw-zero-price-notice {
    font-style: italic;
}

/* PDF Modal Styles */
.cb-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cb-modal.show {
    display: block;
    opacity: 1;
    visibility: visible;
}

.cb-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cb-modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.cb-modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    max-width: 90%;
    transform: translateY(-50px);
    transition: transform 0.3s ease;
}

.cb-modal.show .cb-modal-dialog {
    transform: translateY(0);
}

.cb-modal-content {
    position: relative;
    background-color: #fff;
    margin: 0;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cb-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cb-modal-title {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.cb-btn-close {
    padding: 0;
    background: transparent;
    border: 0;
    font-size: 24px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: color 0.2s ease;
}

.cb-btn-close:hover {
    color: #333;
}

.cb-modal-body {
    padding: 20px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.cb-modal-xl {
    max-width: 95%;
    width: auto;
    height: 90vh;
}

.cb-modal-open {
    overflow: hidden;
}

.cb-pdf-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 600px;
}

.cb-pdf-icon {
    color: #dc3545;
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.2s ease;
}

.cb-pdf-icon:hover {
    color: #c82333;
}

/* Spinner styles */
.cb-spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: cb-spinner-border 0.75s linear infinite;
    margin-bottom: 1rem;
}

/* Small spinner for buttons */
.cb-spinner-border-sm {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 0.125em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: cb-spinner-border 0.75s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

@keyframes cb-spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* Button loading states */
.cfw-cab-button.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.cfw-cab-button.loading .cb-spinner-border-sm {
    display: inline-block;
}

.cfw-cab-button:not(.loading) .cb-spinner-border-sm {
    display: none;
}

.cfw-cab-button.success {
    background-color: #28a745 !important;
    color: #fff !important;
}

.cfw-cab-button.success i {
    color: #fff !important;
}

/* Alert styles */
.cb-alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.cb-alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/*****************************************************************
 * Warehouse Dropdown Styles
 *****************************************************************/
.cfw-warehouse-select {
    width: 100% !important;
    min-height: 40px;
}

/* Select2 customization for warehouse dropdown */
.cfw-warehouse-select + .select2-container--default .select2-selection--single {
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.cfw-warehouse-select + .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px;
    padding-left: 12px;
    color: #333;
}

.cfw-warehouse-select + .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px;
    right: 8px;
}

.cfw-warehouse-select + .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--common-teal);
    box-shadow: 0 0 0 2px rgba(71, 192, 165, 0.2);
}

/* Dropdown results styling */
.cfw-warehouse-select + .select2-container .select2-results__option {
    padding: 8px 12px;
}

.cfw-warehouse-select + .select2-container .select2-results__option span {
    display: block;
    width: 100%;
}
