/* Product Bundle Plugin - Frontend Styles */

/* Bundle Container */
.product-bundle-container,
.product-bundle-shortcode {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    transition: all 0.3s ease;
}

.product-bundle-container.has-selection,
.product-bundle-shortcode.has-selection {
    border-color: #007cba;
    box-shadow: 0 0 0 1px rgba(0, 124, 186, 0.1);
}

/* Bundle Header */
.bundle-header {
    margin-bottom: 15px;
    text-align: center;
}

.bundle-title {
    margin: 0 0 8px 0;
    font-size: 1.3em;
    color: #333;
    font-weight: 600;
    line-height: 1.3;
}

.bundle-description {
    margin: 0;
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

/* Products Carousel */
.bundle-products-carousel {
    margin-bottom: 15px;
    position: relative;
}

/* Hide owl dots completely but show navigation */
.bundle-products-carousel .owl-dots,
.product-bundle-container .owl-dots,
.product-bundle-shortcode .owl-dots,
.owl-carousel .owl-dots {
    display: none !important;
}

@media (max-width: 768px) {
    .bundle-products-carousel .owl-dots,
    .product-bundle-container .owl-dots,
    .product-bundle-shortcode .owl-dots,
    .owl-carousel .owl-dots {
        display: block !important;
        text-align: center;
        margin-top: 15px;
        position: relative;
        z-index: 10;
    }

    .bundle-products-carousel .owl-dot,
    .product-bundle-container .owl-dot,
    .product-bundle-shortcode .owl-dot,
    .owl-carousel .owl-dot {
        display: inline-block;
        width: 10px;
        height: 10px;
        margin: 0 5px;
        background: #d6d6d6;
        border-radius: 50%;
        transition: all 0.3s ease;
        cursor: pointer;
    }

    .bundle-products-carousel .owl-dot.active,
    .product-bundle-container .owl-dot.active,
    .product-bundle-shortcode .owl-dot.active,
    .owl-carousel .owl-dot.active {
        background: #007cba;
        transform: scale(1.2);
    }

    /* Hide nav arrows on mobile since we have dots */
    .bundle-products-carousel .owl-nav {
        display: none;
    }

    /* Ensure dots show in modal on mobile */
    .bundle-modal .bundle-products-carousel .owl-dots {
        display: block !important;
        margin-top: 20px;
    }

    /* Mobile view styling */
    .mobile-view .owl-stage {
        display: flex;
        align-items: center;
    }

    .mobile-view .owl-item {
        transition: opacity 0.3s ease;
        padding: 0 10px;
        width: 100% !important; /* Force full width */
    }

    /* Make carousel items wider */
    .mobile-view .owl-stage-outer {
        padding: 0 15px;
        overflow: visible;
    }

    /* Ensure product squares have consistent width and proper size */
    .bundle-product-square {
        width: 100%;
        margin: 0 auto;
        box-sizing: border-box;
        min-width: 260px;
        padding: 15px;
    }

    /* Add spacing between items */
    .owl-item + .owl-item {
        margin-left: 15px;
    }

    /* Debug styles */
    .owl-carousel-debug {
        border: 2px solid red;
        padding: 10px;
        margin-bottom: 10px;
    }

    /* Ensure modal carousel has proper width */
    .bundle-modal .mobile-view .owl-item {
        width: 100% !important;
    }

    .bundle-modal .bundle-product-square {
        min-width: 280px;
    }
}

/* Style the navigation arrows - Made more outstanding */
.bundle-products-carousel .owl-nav,
.product-bundle-container .owl-nav,
.product-bundle-shortcode .owl-nav,
.bundle-modal .owl-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    pointer-events: none;
}

.bundle-products-carousel .owl-prev,
.bundle-products-carousel .owl-next,
.product-bundle-container .owl-prev,
.product-bundle-container .owl-next,
.product-bundle-shortcode .owl-prev,
.product-bundle-shortcode .owl-next,
.bundle-modal .owl-prev,
.bundle-modal .owl-next {
    position: absolute;
    top: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #007cba, #005a87);
    border: 2px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
    font-size: 22px;
    color: white;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3), 0 2px 6px rgba(0, 0, 0, 0.1);
    font-weight: bold;
}

.bundle-products-carousel .owl-prev,
.product-bundle-container .owl-prev,
.product-bundle-shortcode .owl-prev,
.bundle-modal .owl-prev {
    left: -25px;
}

.bundle-products-carousel .owl-next,
.product-bundle-container .owl-next,
.product-bundle-shortcode .owl-next,
.bundle-modal .owl-next {
    right: -25px;
}

.bundle-products-carousel .owl-prev:hover,
.bundle-products-carousel .owl-next:hover,
.product-bundle-container .owl-prev:hover,
.product-bundle-container .owl-next:hover,
.product-bundle-shortcode .owl-prev:hover,
.product-bundle-shortcode .owl-next:hover,
.bundle-modal .owl-prev:hover,
.bundle-modal .owl-next:hover {
    background: linear-gradient(135deg, #005a87, #003d5c);
    color: white;
    border-color: #ffffff;
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.bundle-products-carousel .owl-prev:active,
.bundle-products-carousel .owl-next:active,
.product-bundle-container .owl-prev:active,
.product-bundle-container .owl-next:active,
.product-bundle-shortcode .owl-prev:active,
.product-bundle-shortcode .owl-next:active,
.bundle-modal .owl-prev:active,
.bundle-modal .owl-next:active {
    transform: scale(1.05);
}

.bundle-products-carousel .owl-prev.disabled,
.bundle-products-carousel .owl-next.disabled,
.product-bundle-container .owl-prev.disabled,
.product-bundle-container .owl-next.disabled,
.product-bundle-shortcode .owl-prev.disabled,
.product-bundle-shortcode .owl-next.disabled,
.bundle-modal .owl-prev.disabled,
.bundle-modal .owl-next.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #cccccc;
    border-color: #e0e0e0;
    color: #999;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bundle-products-carousel .owl-prev.disabled:hover,
.bundle-products-carousel .owl-next.disabled:hover,
.product-bundle-container .owl-prev.disabled:hover,
.product-bundle-container .owl-next.disabled:hover,
.product-bundle-shortcode .owl-prev.disabled:hover,
.product-bundle-shortcode .owl-next.disabled:hover,
.bundle-modal .owl-prev.disabled:hover,
.bundle-modal .owl-next.disabled:hover {
    background: #cccccc;
    color: #999;
    border-color: #e0e0e0;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Add subtle pulse animation to make arrows more noticeable */
@keyframes arrowPulse {
    0% {
        box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3),
            0 2px 6px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 6px 16px rgba(0, 124, 186, 0.5),
            0 3px 8px rgba(0, 0, 0, 0.15);
    }
    100% {
        box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3),
            0 2px 6px rgba(0, 0, 0, 0.1);
    }
}

.bundle-products-carousel .owl-prev:not(.disabled),
.bundle-products-carousel .owl-next:not(.disabled),
.product-bundle-container .owl-prev:not(.disabled),
.product-bundle-container .owl-next:not(.disabled),
.product-bundle-shortcode .owl-prev:not(.disabled),
.product-bundle-shortcode .owl-next:not(.disabled),
.bundle-modal .owl-prev:not(.disabled),
.bundle-modal .owl-next:not(.disabled) {
    animation: arrowPulse 3s ease-in-out infinite;
}

/* Stop animation on hover for better UX */
.bundle-products-carousel .owl-prev:hover,
.bundle-products-carousel .owl-next:hover,
.product-bundle-container .owl-prev:hover,
.product-bundle-container .owl-next:hover,
.product-bundle-shortcode .owl-prev:hover,
.product-bundle-shortcode .owl-next:hover,
.bundle-modal .owl-prev:hover,
.bundle-modal .owl-next:hover {
    animation: none;
}

/* Product Square - Made Smaller */
.bundle-product-square {
    position: relative;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 140px;
    max-height: 160px;
}

.bundle-product-square:hover {
    border-color: #007cba;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.1);
    transform: translateY(-1px);
}

.bundle-product-square.selected {
    border-color: #007cba;
    border-width: 3px;
    box-shadow: 0 2px 12px rgba(0, 124, 186, 0.3);
    background-color: #f0f8ff;
}

.bundle-product-square.bundle-selecting {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Product Image - Made Smaller */
.bundle-product-image {
    width: 60px;
    height: 60px;
    margin: 0 auto 10px;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bundle-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.bundle-product-square:hover .bundle-product-image img {
    transform: scale(1.05);
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 20px;
    background: #f0f0f0;
    border-radius: 3px;
}

.bundle-no-image-icon {
    font-size: 22px;
    opacity: 0.6;
}

/* Product Info - Adjusted for smaller size */
.bundle-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.bundle-product-name {
    margin: 0 0 6px 0;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
    height: 2.4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.bundle-product-price {
    font-size: 11px;
    color: #007cba;
    font-weight: 600;
    margin-top: auto;
}

.bundle-product-price .woocommerce-Price-amount {
    font-weight: 600;
}

.bundle-product-price del {
    opacity: 0.7;
    margin-right: 3px;
}

/* NEW: Checkbox Indicator (replaces full overlay) */
.bundle-product-checkbox {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 20px;
    height: 20px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.bundle-product-square:hover .bundle-product-checkbox {
    border-color: #007cba;
    background: #f0f8ff;
}

.bundle-product-square.selected .bundle-product-checkbox {
    background: #007cba;
    border-color: #007cba;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(0, 124, 186, 0.5);
}

.bundle-product-checkbox .bundle-checkmark {
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.bundle-product-square.selected .bundle-product-checkbox .bundle-checkmark {
    opacity: 1;
    animation: checkmarkPulse 0.3s ease-out;
}

@keyframes checkmarkPulse {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* REMOVE: Old Selection Overlay (not needed anymore) */
.bundle-product-overlay {
    display: none !important;
}

.bundle-selected-indicator {
    display: none !important;
}

.bundle-selected-text {
    display: none !important;
}

/* Bundle Actions - Adjusted for smaller design */
.bundle-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.product-bundle-container.has-selection .bundle-actions,
.product-bundle-shortcode.has-selection .bundle-actions {
    background: #f0f8ff;
    border-color: #007cba;
    margin: 12px -15px -15px;
    padding: 12px 15px;
    border-radius: 0 0 8px 8px;
}

.bundle-selected-count {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    transition: color 0.3s ease;
}

.product-bundle-container.has-selection .bundle-selected-count,
.product-bundle-shortcode.has-selection .bundle-selected-count {
    color: #007cba;
    font-weight: 600;
}

/* Bundle Loading States */
.bundle-loading {
    opacity: 0.7;
    pointer-events: none;
}

.bundle-loading .bundle-product-square {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

/* Bundle Error States */
.bundle-error {
    border-color: #dc3232;
    background: #fff0f0;
}

.bundle-error .bundle-title {
    color: #dc3232;
}

/* Bundle Empty State */
.bundle-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.bundle-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.3;
}

/* Bundle Modal Styles */
.bundle-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.bundle-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.bundle-modal-content {
    position: relative;
    background: white;
    margin: 50px auto;
    max-width: 600px;
    border-radius: 8px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

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

.bundle-modal-header h3 {
    margin: 0;
    font-size: 1.5em;
    color: #333;
}

.bundle-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.bundle-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.bundle-modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.bundle-modal-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.bundle-modal-cancel,
.bundle-modal-confirm {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.bundle-modal-cancel {
    background: #f0f0f0;
    color: #333;
}

.bundle-modal-cancel:hover {
    background: #e0e0e0;
}

.bundle-modal-confirm {
    background: #007cba;
    color: white;
}

.bundle-modal-confirm:hover {
    background: #005a87;
}

.bundle-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.bundle-btn-primary {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.bundle-btn-primary:hover {
    background: #005a87;
    border-color: #005a87;
}

.bundle-btn-secondary {
    background: white;
    color: #333;
}

.bundle-btn-secondary:hover {
    background: #f0f0f0;
}

/* Admin Styles */
.bundle-admin-section {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #f9f9f9;
}

.bundle-admin-title {
    margin: 0 0 15px 0;
    font-size: 1.2em;
    color: #333;
}

.bundle-search {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
}

.bundle-product-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.bundle-product-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.3s ease;
}

.bundle-product-item:hover {
    background: #f0f8ff;
}

.bundle-product-item:last-child {
    border-bottom: none;
}

.bundle-selected-products {
    margin-top: 15px;
}

.bundle-selected-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 5px;
}

.bundle-remove-item {
    background: #dc3232;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
}

.bundle-remove-item:hover {
    background: #a02020;
}

/* Animations */
@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

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

@keyframes checkmarkPulse {
    0% {
        transform: scale(0.8);
    }

    50% {
        transform: scale(1.2);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

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

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .product-bundle-container,
    .product-bundle-shortcode {
        padding: 15px;
        margin: 15px 0;
    }

    .bundle-modal-content {
        margin: 20px;
        max-width: none;
        max-height: 90vh;
    }

    .bundle-product-square {
        min-height: 120px;
        max-height: 140px;
        padding: 8px;
    }

    .bundle-product-image {
        width: 50px;
        height: 50px;
        margin-bottom: 8px;
    }

    .bundle-product-name {
        font-size: 11px;
        height: 2.2em;
    }

    .bundle-product-price {
        font-size: 10px;
    }

    .bundle-product-checkbox {
        width: 18px;
        height: 18px;
        top: 5px;
        left: 5px;
    }

    .bundle-product-checkbox .bundle-checkmark {
        font-size: 10px;
    }

    .bundle-title {
        font-size: 1.3em;
    }

    .bundle-modal-content {
        margin: 20px;
        max-width: none;
        max-height: 90vh;
    }

    .bundle-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100%);
    }

    .bundle-notification.show {
        transform: translateY(0);
    }

    .product-bundle-container.has-selection .bundle-actions,
    .product-bundle-shortcode.has-selection .bundle-actions {
        margin: 15px -15px -15px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .bundle-product-square {
        min-height: 110px;
        max-height: 130px;
        padding: 6px;
    }

    .bundle-product-image {
        width: 45px;
        height: 45px;
    }

    .bundle-title {
        font-size: 1.2em;
    }

    .bundle-description {
        font-size: 13px;
    }

    .bundle-modal-header,
    .bundle-modal-body,
    .bundle-modal-footer {
        padding: 15px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .bundle-product-square {
        border-width: 3px;
    }

    .bundle-product-square:hover,
    .bundle-product-square.selected {
        border-width: 3px;
    }

    .bundle-product-overlay {
        background: rgba(0, 0, 0, 0.9);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .bundle-product-square,
    .bundle-product-image img,
    .bundle-product-overlay,
    .bundle-notification,
    .bundle-modal-overlay,
    .bundle-modal-content {
        transition: none;
    }

    .bundle-selected-indicator {
        animation: none;
    }

    .bundle-checkmark {
        animation: none;
    }

    .single_add_to_cart_button.loading::after {
        animation: none;
    }

    /* Disable arrow pulse animation for reduced motion */
    .bundle-products-carousel .owl-prev:not(.disabled),
    .bundle-products-carousel .owl-next:not(.disabled),
    .product-bundle-container .owl-prev:not(.disabled),
    .product-bundle-container .owl-next:not(.disabled),
    .product-bundle-shortcode .owl-prev:not(.disabled),
    .product-bundle-shortcode .owl-next:not(.disabled),
    .bundle-modal .owl-prev:not(.disabled),
    .bundle-modal .owl-next:not(.disabled) {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .product-bundle-container,
    .product-bundle-shortcode,
    .bundle-modal,
    .bundle-notification {
        display: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .product-bundle-container,
    .product-bundle-shortcode {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }

    .bundle-product-square {
        background: #333;
        border-color: #555;
        color: #e0e0e0;
    }

    .bundle-product-square:hover {
        border-color: #007cba;
        background: #3a3a3a;
    }

    .bundle-product-square.selected {
        background: #1a2a3a;
    }

    .bundle-title {
        color: #e0e0e0;
    }

    .bundle-description {
        color: #ccc;
    }

    .bundle-product-name {
        color: #e0e0e0;
    }

    .no-image-placeholder {
        background: #444;
        color: #999;
    }

    .bundle-modal-content {
        background: #2a2a2a;
        color: #e0e0e0;
    }

    .bundle-modal-header,
    .bundle-modal-footer {
        background: #333;
        border-color: #555;
    }

    .bundle-modal-cancel {
        background: #444;
        color: #e0e0e0;
    }

    .bundle-modal-cancel:hover {
        background: #555;
    }
}

.owl-stage-outer {
    padding: 5px 0px 10px 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.owl-stage-outer::-webkit-scrollbar {
    display: none;
}

/* Ensure proper touch scrolling on mobile */
@media (max-width: 768px) {
    .owl-stage-outer {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        padding: 10px 0;
        touch-action: pan-x;
    }

    .owl-stage {
        display: flex;
        touch-action: pan-x;
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Improve scrolling experience */
    .mobile-view .owl-stage-outer {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Ensure items are properly spaced for scrolling */
    .mobile-view .owl-item {
        transition: opacity 0.3s ease;
        padding: 0 10px;
        width: 100% !important; /* Force full width */
        min-width: 260px;
        box-sizing: border-box;
    }

    /* Prevent owl carousel from interfering with native scrolling */
    .mobile-view .owl-stage {
        touch-action: pan-x;
        -ms-touch-action: pan-x;
        will-change: transform;
    }

    /* Make bundle product squares more touch-friendly */
    .bundle-product-square {
        touch-action: pan-y;
        -ms-touch-action: pan-y;
    }

    /* Ensure the stage takes up enough width for smooth scrolling */
    .mobile-view .owl-stage {
        min-width: 100%;
    }
}

/* Extra improvements for very small screens */
@media (max-width: 480px) {
    /* Additional mobile optimizations for very small screens */
    .mobile-optimized .owl-item {
        margin-right: 15px !important;
    }

    /* Modal specific for small screens */
    .bundle-modal .owl-stage-outer {
        padding: 10px 5px 15px 5px;
    }

    .bundle-modal .bundle-products-carousel {
        padding: 0 35px;
    }

    .bundle-modal .owl-prev,
    .bundle-modal .owl-next {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .bundle-modal .owl-prev {
        left: -20px;
    }

    .bundle-modal .owl-next {
        right: -20px;
    }
}

/* Product Information Button */
.bundle-product-info-btn {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    color: #666;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
    /* Push button to bottom */
    width: 100%;
    text-align: center;
    flex-shrink: 0;
    /* Prevent button from shrinking */
}

.bundle-product-info-btn:hover {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

/* Fix bundle product info layout to ensure consistent button positioning */
.bundle-product-info {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
    padding: 0 10px 10px 10px;
}

.bundle-product-name {
    flex: 0 0 auto;
    margin-bottom: 8px !important;
}

.bundle-product-price {
    flex: 0 0 auto;
    margin-bottom: 8px;
}

/* Ensure consistent height for all bundle product squares */
.bundle-product-square {
    display: flex;
    min-height: 220px;
    flex-direction: column;
    /* Set minimum height */
}

.bundle-product-square .bundle-product-image {
    flex: 0 0 auto;
}

.bundle-product-square .bundle-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Product Information Modal */
.product-info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
}

.product-info-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.product-info-modal-content {
    position: relative;
    background: white;
    margin: 20px auto;
    max-width: 800px;
    border-radius: 12px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.product-info-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.product-info-modal-header h3 {
    margin: 0;
    font-size: 1.4em;
    color: #333;
    font-weight: 600;
}

.product-info-modal-close {
    background: none;
    min-height: 0;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.product-info-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.product-info-modal-body {
    padding: 25px;
    flex: 1;
    overflow-y: auto;
}

.product-info-loading {
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

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

.product-info-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.product-info-images {
    position: sticky;
    top: 0;
}

.product-info-image-gallery {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.product-info-main-image {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
}

.main-product-image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 400px;
    object-fit: contain;
}

.product-info-thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.product-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.product-thumb:hover,
.product-thumb.active {
    border-color: #007cba;
    transform: scale(1.05);
}

.product-info-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-info-name {
    margin: 0;
    font-size: 1.5em;
    color: #333;
    font-weight: 600;
    line-height: 1.3;
}

.product-info-price {
    font-size: 1.3em;
    color: #007cba;
    font-weight: 600;
}

.product-info-description {
    color: #666;
    line-height: 1.6;
    font-size: 14px;
}

.product-info-description h1,
.product-info-description h2,
.product-info-description h3,
.product-info-description h4,
.product-info-description h5,
.product-info-description h6 {
    color: #333;
    margin-top: 20px;
    margin-bottom: 10px;
}

.product-info-description p {
    margin-bottom: 15px;
}

.product-info-description ul,
.product-info-description ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.product-meta-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-meta-item {
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 13px;
    border-left: 3px solid #007cba;
}

.product-meta-item strong {
    color: #333;
}

.no-product-images {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.product-info-error {
    text-align: center;
    padding: 40px 20px;
    color: #dc3232;
}

.product-info-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    background: #f8f9fa;
}

.product-info-modal-close-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.product-info-modal-close-btn:hover {
    background: #5a6268;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .product-info-modal-content {
        margin: 0;
        max-width: none;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .product-info-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-info-images {
        position: static;
    }

    .product-info-main-image {
        max-height: 300px;
    }

    .main-product-image {
        max-height: 300px;
    }

    .product-info-modal-header,
    .product-info-modal-body,
    .product-info-modal-footer {
        padding: 15px 20px;
    }

    .product-info-name {
        font-size: 1.3em;
    }

    .product-info-price {
        font-size: 1.2em;
    }

    .product-thumb {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .product-info-modal-header h3 {
        font-size: 1.2em;
    }

    .product-info-name {
        font-size: 1.2em;
    }

    .product-info-price {
        font-size: 1.1em;
    }

    .product-info-description {
        font-size: 13px;
    }

    .product-meta-item {
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* Modal open body class */
.product-info-modal-open {
    overflow: hidden;
}

/* Ensure modal appears above everything */
.product-info-modal {
    z-index: 99999;
}

/* Bundle Modal Carousel Specific Styles */
.bundle-modal .bundle-products-carousel {
    margin: 0 30px; /* Add margin to give space for arrows */
    padding: 0 10px;
}

.bundle-modal .owl-stage-outer {
    padding: 5px 10px 10px 10px;
}

/* Ensure modal carousel arrows are visible */
.bundle-modal .owl-nav {
    opacity: 1;
    visibility: visible;
}

/* Modal carousel arrows positioning adjustment */
@media (max-width: 600px) {
    .bundle-modal .bundle-products-carousel {
        margin: 0 25px;
    }

    .bundle-modal .owl-prev,
    .bundle-modal .owl-next {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .bundle-modal .owl-prev {
        left: -20px;
    }

    .bundle-modal .owl-next {
        right: -20px;
    }
}

/* Mobile specific enhancements */
@media (max-width: 768px) {
    .bundle-product-square.selected {
        border-color: #007cba;
        border-width: 3px;
        background-color: #f0f8ff;
        box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.3);
    }

    .bundle-product-square.selected::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 4px;
        box-shadow: 0 0 0 3px #007cba;
        pointer-events: none;
    }

    .bundle-product-checkbox {
        width: 22px;
        height: 22px;
    }

    .bundle-product-square.selected .bundle-product-checkbox {
        transform: scale(1.2);
    }

    .bundle-product-checkbox .bundle-checkmark {
        font-size: 14px;
        font-weight: bold;
    }
}
