/* Payment failed modal */
.msf-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100000;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.msf-modal-content {
    background: #fff;
    max-width: 500px;
    margin: 50px auto;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: msf-modal-fade-in 0.3s ease-out;
}

@keyframes msf-modal-fade-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msf-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    transition: color 0.2s;
}

.msf-modal-close:hover {
    color: #000;
}

.msf-modal-header {
    margin-bottom: 20px;
}

.msf-modal-title {
    margin: 0 0 10px 0;
    color: #dc3545;
    font-size: 1.8em;
}

.msf-modal-body {
    margin-bottom: 25px;
}

.msf-modal-message {
    margin: 0 0 15px 0;
    color: #666;
    line-height: 1.6;
    font-size: 1.1em;
}

.msf-modal-order-info {
    margin: 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.9em;
    color: #666;
}

.msf-modal-footer {
    text-align: center;
}

.msf-modal-close-btn {
    min-width: 150px;
}

/* Credit Tiers Info Modal */
#msf-credit-tiers-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 100000;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    display: none;
}

#msf-credit-tiers-modal > div {
    background: #fff;
    max-width: 600px;
    margin: 50px auto;
    padding: 30px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    position: relative;
}

#msf-credit-tiers-info-icon {
    cursor: pointer;
    color: #2271b1;
    font-size: 16px;
    vertical-align: middle;
    margin-left: 5px;
    transition: color 0.2s ease;
}

#msf-credit-tiers-info-icon:hover {
    color: #135e96;
}

#msf-close-credit-tiers-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 30px;
    transition: color 0.2s ease;
}

#msf-close-credit-tiers-modal:hover {
    color: #000;
}

/* Frontend Styles - UIkit Compatible */
.msf-order-form,
.msf-signup-form {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Accordion sections - Clean implementation */
.msf-accordion-section {
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.msf-accordion-section:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.msf-accordion-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 16px 20px;
    background: #f8f9fa;
    border: none;
    border-radius: 6px 6px 0 0;
    transition: background-color 0.2s ease;
    font-size: 16px;
    margin: 0;
    width: 100%;
    text-align: left;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.msf-accordion-toggle:hover {
    background: #e9ecef;
}

.msf-accordion-toggle input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    margin-right: 12px;
    accent-color: #2271b1;
    flex-shrink: 0;
    pointer-events: auto;
}

.msf-accordion-toggle strong {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    flex: 1;
    pointer-events: none;
}

/* When checkbox is checked, toggle has top border radius (shipping: checked = open) */
.msf-accordion-section.accordion-open .msf-accordion-toggle {
    border-radius: 6px 6px 0 0;
    border-bottom: 1px solid #e0e0e0;
}

/* When checkbox is unchecked, toggle has full border radius (shipping: unchecked = closed) */
.msf-accordion-section.accordion-closed .msf-accordion-toggle {
    border-radius: 6px;
    border-bottom: none;
}

/* Account accordion: checked = open (opposite logic) */
.msf-accordion-section:has(#msf-create-account:checked) .msf-accordion-toggle {
    border-radius: 6px 6px 0 0;
    border-bottom: 1px solid #e0e0e0;
}

.msf-accordion-section:has(#msf-create-account:not(:checked)) .msf-accordion-toggle {
    border-radius: 6px;
    border-bottom: none;
}

.msf-accordion-content {
    padding: 0 20px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.msf-accordion-content.active {
    max-height: 2000px;
    padding: 20px;
    padding-bottom: 30px; /* Extra bottom padding for error message */
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure password error stays within accordion */
#msf-account-fields #msf-password-error {
    margin-top: 10px;
    margin-bottom: 0;
    padding: 10px 15px;
}

/* Shipping address checkbox styling - legacy support */
#shipping_same_as_billing,
#msf-create-account {
    width: 24px;
    height: 24px;
    cursor: pointer;
    margin-right: 12px;
    accent-color: #2271b1;
    flex-shrink: 0;
}

#shipping_same_as_billing-label,
#msf-create-account-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    font-size: 16px;
}

#shipping_same_as_billing-label:hover,
#msf-create-account-label:hover {
    background: #e9ecef;
}

#shipping_same_as_billing-label strong,
#msf-create-account-label strong {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    user-select: none;
}

/* Product variations */
.msf-variation-option-label {
    transition: all 0.2s ease;
}

.msf-variation-option-label:hover {
    border-color: #2271b1 !important;
    background: #f0f7ff !important;
}

.msf-variation-option-label input:checked + span {
    font-weight: 600;
    color: #2271b1;
}

.msf-variation-option-label input:checked {
    accent-color: #2271b1;
}

.msf-variation-group {
    border: none;
    padding: 0;
}

.msf-product-calculated-price {
    font-size: 0.95em;
}

/* Shopping cart */
.msf-order-item-row {
    display: grid;
    grid-template-columns: 2fr 100px 100px 100px 80px;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.msf-order-item-row:last-child {
    border-bottom: none;
}

.msf-order-item-name {
    font-weight: 500;
}

.msf-order-item-qty input {
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Remove browser spinners from number input */
.msf-cart-quantity {
    -moz-appearance: textfield;
    appearance: textfield;
}

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

.msf-quantity-controls-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
}

.msf-cart-quantity-minus,
.msf-cart-quantity-plus {
    padding: 4px 8px;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid currentColor;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.msf-cart-quantity-minus:hover,
.msf-cart-quantity-plus:hover {
    background: #f0f0f0;
    border-color: #2271b1;
}

.msf-cart-quantity-minus:active,
.msf-cart-quantity-plus:active {
    background: #e0e0e0;
}

.msf-cart-quantity-minus svg,
.msf-cart-quantity-plus svg {
    pointer-events: none;
}

.msf-order-item-actions {
    text-align: center;
}

.msf-add-to-cart-btn {
    transition: all 0.2s ease;
}

.msf-add-to-cart-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.msf-order-form #msf-order-message,
.msf-signup-form #msf-signup-message {
    margin-top: 20px;
}

/* Loading state */
.msf-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Membership alert - light gray */
.msf-membership-alert {
    background-color: #f5f5f5;
    border-left: 4px solid #999;
    color: #666;
}

.msf-membership-alert p {
    color: #666;
    margin: 0;
}

.msf-membership-alert strong {
    color: #333;
    font-weight: 600;
}

/* Button states */
.msf-order-form button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.msf-button-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
    cursor: wait !important;
}

.msf-button-loading .uk-spinner,
.msf-button-loading .msf-spinner {
    display: inline-block;
    vertical-align: middle;
}

/* Spinner animation */
@keyframes msf-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.msf-button-loading .uk-spinner-small,
.msf-button-loading .msf-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: msf-spin 0.6s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

/* Products Grid */
.msf-products-grid {
    display: grid;
    grid-template-columns: repeat(var(--msf-grid-columns, 3), 1fr);
    gap: 20px;
    margin: 20px 0;
}

.msf-product-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
}

.msf-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.msf-product-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.msf-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.msf-product-image.msf-image-clickable {
    cursor: pointer;
}

.msf-product-image.msf-image-clickable a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.msf-product-image.msf-image-clickable a img {
    transition: transform 0.3s ease;
}

.msf-product-image.msf-image-clickable:hover a img {
    transform: scale(1.05);
}

.msf-zoom-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 10;
}

.msf-zoom-icon svg {
    width: 20px;
    height: 20px;
    color: #333;
}

.msf-product-image:hover .msf-zoom-icon {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

/* Lightbox Styles */
.msf-lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.msf-lightbox-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.msf-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    margin: auto;
}

.msf-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.msf-lightbox-title {
    color: #fff;
    text-align: center;
    margin-top: 15px;
    font-size: 1.2em;
}

.msf-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    color: #333;
    transition: all 0.3s ease;
    z-index: 10000;
}

.msf-lightbox-close:hover {
    background: #fff;
    transform: rotate(90deg);
}

.msf-lightbox-close::before {
    content: '×';
    font-size: 32px;
    line-height: 1;
}

/* Lightbox Navigation */
.msf-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    line-height: 1;
    color: #333;
    transition: all 0.3s ease;
    z-index: 10000;
    font-weight: bold;
}

.msf-lightbox-nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}

.msf-lightbox-prev {
    left: 20px;
}

.msf-lightbox-next {
    right: 20px;
}

.msf-lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Product Images Grid */
.msf-product-images-grid {
    display: grid;
    gap: 8px;
}

.msf-product-thumbnail {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.msf-product-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.msf-product-image-container {
    margin-bottom: 15px;
}

/* Order Items List */
.msf-order-items-list {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.msf-order-items-table {
    width: 100%;
}

.msf-order-items-header {
    display: grid;
    grid-template-columns: 2fr 100px 100px 100px 100px;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 2px solid #ddd;
    font-weight: 600;
    font-size: 0.9em;
    color: #666;
}

.msf-order-items-body {
    margin-top: 10px;
}

.msf-order-item-row {
    display: grid;
    grid-template-columns: 2fr 100px 100px 100px 100px;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
    align-items: center;
}

.msf-order-item-row:last-child {
    border-bottom: none;
}

.msf-order-item-name {
    font-weight: 500;
    word-break: break-word;
}

.msf-order-item-qty {
    text-align: center;
}

.msf-order-item-price {
    text-align: right;
}

.msf-order-item-total {
    text-align: right;
    font-weight: 600;
    color: #2271b1;
}

.msf-order-item-actions {
    text-align: center;
}

.msf-remove-from-cart {
    white-space: nowrap;
}

/* Responsive Order Items */
@media (max-width: 768px) {
    .msf-order-items-header,
    .msf-order-item-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .msf-order-items-header {
        display: none;
    }
    
    .msf-order-item-row {
        padding: 15px;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 4px;
        margin-bottom: 10px;
    }
    
    .msf-order-item-name {
        font-weight: 600;
        margin-bottom: 8px;
        font-size: 1.05em;
    }
    
    .msf-order-item-qty,
    .msf-order-item-price,
    .msf-order-item-total {
        display: flex;
        justify-content: space-between;
        padding: 5px 0;
        border-top: 1px solid #f0f0f0;
    }
    
    .msf-order-item-qty::before {
        content: 'Aantal: ';
        font-weight: 500;
        color: #666;
    }
    
    .msf-order-item-price::before {
        content: 'Prijs per stuk: ';
        font-weight: 500;
        color: #666;
    }
    
    .msf-order-item-total::before {
        content: 'Totaal: ';
        font-weight: 600;
        color: #333;
    }
    
    .msf-order-item-qty,
    .msf-order-item-price {
        text-align: left;
    }
    
    .msf-order-item-total {
        text-align: left;
        font-size: 1.1em;
        padding-top: 8px;
        margin-top: 5px;
        border-top: 2px solid #ddd;
    }
}

.msf-product-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.msf-product-title {
    margin: 0 0 10px 0;
    font-size: 1.25em;
    font-weight: 600;
    color: #333;
}

.msf-product-description {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 0.9em;
    line-height: 1.5;
    flex-grow: 1;
}

.msf-product-price {
    margin: 10px 0;
    font-size: 1.5em;
    color: #2271b1;
}

.msf-product-quantity-wrapper {
    margin: 15px 0;
}

.msf-quantity-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9em;
}

.msf-quantity-controls {
    display: flex;
    align-items: center;
    gap: 0;
    max-width: 150px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.msf-quantity-btn {
    background: #f5f5f5;
    border: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    color: #333;
    flex-shrink: 0;
}

.msf-quantity-btn:hover {
    background: #e0e0e0;
    color: #2271b1;
}

.msf-quantity-btn:active {
    background: #d0d0d0;
    transform: scale(0.95);
}

.msf-quantity-btn svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.msf-product-quantity {
    flex: 1;
    min-width: 0;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    padding: 8px 12px;
    text-align: center;
    font-size: 1em;
    font-weight: 500;
    background: #fff;
    -moz-appearance: textfield;
    appearance: textfield;
}

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

.msf-product-quantity:focus {
    outline: none;
    background: #f9f9f9;
}

.msf-product-quantity:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.msf-product-subtotal {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1em;
}

.msf-item-subtotal {
    color: #2271b1;
    font-weight: 600;
}

/* Grid columns based on data attribute */
.msf-products-grid[data-columns="1"] {
    grid-template-columns: 1fr;
}

.msf-products-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.msf-products-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.msf-products-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .msf-products-grid[data-columns="4"] {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 960px) {
    .msf-products-grid[data-columns="3"],
    .msf-products-grid[data-columns="4"] {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .msf-products-grid {
        grid-template-columns: 1fr !important;
    }
    
    .msf-product-image {
        height: 180px;
    }
    
    .msf-product-content {
        padding: 15px;
    }
    
    .msf-product-title {
        font-size: 1.1em;
    }
    
    .msf-product-price {
        font-size: 1.3em;
    }
    
    .msf-quantity-controls {
        max-width: 100%;
    }
    
    .msf-quantity-btn {
        width: 40px;
        height: 40px;
    }
    
    .msf-product-quantity {
        font-size: 1.1em;
        padding: 10px;
    }
}

/* Customer type option styling */
.msf-customer-type-option.msf-active {
    border: 2px solid #2271b1 !important;
    background: #f0f7ff !important;
}

.msf-customer-type-option.msf-inactive {
    border: 2px solid #ddd !important;
    background: #fff !important;
}

/* Shipping method select dropdown */
.msf-shipping-select {
    width: 100% !important;
    height: auto !important;
    min-height: 50px !important;
    padding: 12px 45px 12px 15px !important;
    border: 2px solid #ddd !important;
    border-radius: 6px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    background: #fff !important;
    background-color: #fff !important;
    color: #333 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2724%27 height=%2724%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%23666%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3e%3cpolyline points=%276 9 12 15 18 9%27%3e%3c/polyline%3e%3c/svg%3e') !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 20px !important;
    box-sizing: border-box !important;
    display: block !important;
}

.msf-shipping-select:hover {
    border-color: #2271b1 !important;
    background-color: #fafafa !important;
}

.msf-shipping-select:focus {
    border-color: #2271b1 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1) !important;
    background-color: #fff !important;
}

.msf-shipping-select option {
    padding: 10px !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    background: #fff !important;
    background-color: #fff !important;
    color: #333 !important;
}

/* Floating Groups Sidebar */
.msf-order-form-wrapper {
    position: relative;
}

/* Sidebar Toggle Button */
.msf-sidebar-toggle {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 1001;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-direction: row;
}

.msf-sidebar-toggle:hover {
    background: #135e96;
    transform: scale(1.05);
}

.msf-sidebar-toggle-icon {
    display: inline-block;
    line-height: 1;
    font-size: 20px;
    order: 1;
}

.msf-sidebar-toggle-text {
    display: inline-block;
    font-weight: 500;
    order: 2;
}

/* Sidebar Close Button */
.msf-sidebar-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fff;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    padding: 0;
    z-index: 10;
    transition: color 0.2s ease;
}

.msf-sidebar-close:hover {
    color: #000;
}

/* Sidebar Base Styles */
.msf-groups-sidebar {
    display: none;
    position: fixed;
    left: 0;
    top: 50%;
    width: 280px;
    max-width: 90vw;
    max-height: 90vh;
    background: #fff;
    border-right: 1px solid #ddd;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
    transform: translate(-100%, -50%);
    transition: transform 0.3s ease;
}

/* Sidebar visible state */
.msf-groups-sidebar.sidebar-open {
    display: block;
    transform: translate(0, -50%);
}

/* Overlay for mobile */
.msf-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.msf-sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Large screens (>= 1830px) - Sidebar as floating panel */
@media (min-width: 1830px) {
    .msf-sidebar-toggle {
        display: block; /* Always show toggle button on large screens */
    }
    
    .msf-groups-sidebar {
        display: block;
        position: fixed;
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
        width: 250px;
        max-width: none;
        height: auto;
        max-height: 80vh;
        border-right: 1px solid #ddd;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        transition: transform 0.3s ease, left 0.3s ease, opacity 0.3s ease;
        opacity: 1;
    }
    
    /* Hidden state on large screens */
    .msf-groups-sidebar.sidebar-hidden {
        left: -250px; /* Hide sidebar completely */
        opacity: 0;
        pointer-events: none;
    }
    
    .msf-sidebar-close {
        display: none; /* Hide close button on large screens */
    }
    
    .msf-sidebar-overlay {
        display: none !important; /* Never show overlay on large screens */
    }
}

/* Small screens (< 1830px) - Sidebar as slide-in menu */
@media (max-width: 1829px) {
    .msf-sidebar-toggle {
        display: block; /* Always show toggle on small screens */
    }
    
    .msf-groups-sidebar {
        display: block;
        transform: translate(-100%, -50%);
    }
    
    .msf-groups-sidebar.sidebar-open {
        transform: translate(0, -50%);
    }
    
    .msf-sidebar-close {
        display: block; /* Show close button on small screens */
    }
}
    
    .msf-sidebar-content {
        position: relative;
    }
    
    .msf-sidebar-title {
        margin: 0 0 15px 0;
        font-size: 18px;
        font-weight: 600;
        color: #333;
        padding-bottom: 10px;
        border-bottom: 2px solid #2271b1;
    }
    
    .msf-sidebar-actions {
        margin-bottom: 15px;
        font-size: 14px;
    }
    
    .msf-sidebar-actions a {
        color: #2271b1;
        text-decoration: none;
        cursor: pointer;
        transition: color 0.2s ease;
    }
    
    .msf-sidebar-actions a:hover {
        color: #135e96;
        text-decoration: underline;
    }
    
    .msf-groups-list {
        /* Removed max-height and overflow to allow entire sidebar to scroll */
    }
    
    .msf-group-checkbox-label {
        display: flex;
        align-items: center;
        margin-bottom: 8px;
        cursor: pointer;
        padding: 5px;
        border-radius: 4px;
        transition: background-color 0.2s ease;
    }
    
    .msf-group-checkbox-label:hover {
        background-color: #f5f5f5;
    }
    
    .msf-group-checkbox-label input[type="checkbox"] {
        margin-right: 8px;
        width: 18px;
        height: 18px;
        cursor: pointer;
        accent-color: #2271b1;
        flex-shrink: 0;
    }
    
    .msf-group-checkbox-label span {
        font-size: 14px;
        color: #333;
        user-select: none;
    }
    
    .msf-group-link {
        font-size: 14px;
        color: #2271b1;
        text-decoration: none;
        cursor: pointer;
        transition: color 0.2s ease;
        user-select: none;
    }
    
    .msf-group-link:hover {
        color: #135e96;
        text-decoration: underline;
    }
    
    /* Adjust main content when sidebar is visible */
    .msf-order-form {
        margin-left: 0;
    }
}

/* Hide product groups when filtered out */
.msf-product-group.hidden {
    display: none !important;
}

/* Product Description Modal */
.msf-description-modal {
    animation: msf-modal-fade-in 0.2s ease;
}

@keyframes msf-modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.msf-description-modal-content {
    animation: msf-modal-slide-in 0.3s ease;
}

@keyframes msf-modal-slide-in {
    from { 
        opacity: 0;
        transform: translateY(-20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.msf-description-modal-close:hover {
    color: #333 !important;
    background: #f0f0f0;
    border-radius: 50%;
}

.msf-read-more-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.msf-read-more-link:hover {
    color: #135e96 !important;
    transform: translateX(3px);
}

/* Responsive modal for mobile */
@media (max-width: 768px) {
    .msf-description-modal-content {
        margin: 20px auto !important;
        padding: 20px !important;
        max-width: 95% !important;
    }
    
    .msf-description-modal-close {
        top: 10px !important;
        right: 10px !important;
    }
}
