/* General styles for product extensions */
.nx-product-extensions {
    margin: 20px 0;
    font-family: inherit;
    transition: all .6s cubic-bezier(0.075, 0.82, 0.165, 1);
}

/* full screen css */
.nx-fullscreen.nx-product-extensions {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    left: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;

    margin: 0;
}

.nx-product-extensions-image {
    display: none;
}

.nx-fullscreen.nx-product-extensions .nx-product-extensions-image {
    display: block;
    width: 50%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
}

.nx-fullscreen.nx-product-extensions  .nx-product-extensions-inner {
    width: 50%;
    margin-left: auto;
    background-color: #f9f9f9;
    max-height: 100vh;
    height: 100vh;
    overflow: auto;
}

.nx-fullscreen.nx-product-extensions .nx-extension-group {
    width: 100%;
}

/* .nx-fullscreen.nx-product-extensions  scrollbar thin and delicate */
.nx-fullscreen.nx-product-extensions::-webkit-scrollbar, .nx-fullscreen.nx-product-extensions  .nx-product-extensions-inner::-webkit-scrollbar {
    width: 5px;
}

.nx-fullscreen.nx-product-extensions::-webkit-scrollbar-track, .nx-fullscreen.nx-product-extensions  .nx-product-extensions-inner::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.nx-fullscreen.nx-product-extensions::-webkit-scrollbar-thumb, .nx-fullscreen.nx-product-extensions  .nx-product-extensions-inner::-webkit-scrollbar-thumb {
    background: #888;
}

.nx-fullscreen.nx-product-extensions::-webkit-scrollbar-thumb:hover, .nx-fullscreen.nx-product-extensions  .nx-product-extensions-inner::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.nx-close-fullscreen-button {
    position: absolute;
    left: 0;
    line-height: 1;
    padding: 5px 7px 5px 5px;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

/* Extension title */
.nx-extension-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

/* Group styling */
.nx-extension-group {
    margin-bottom: 25px;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 15px;
    background: #f9f9f9;
}

.nx-fullscreen.nx-product-extensions  .nx-extension-group {
	margin-bottom: 50px;
}

.nx-group-header {
    margin-bottom: 15px;
}

.nx-group-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.nx-group-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.nx-group-fields {
    background: #fff;
    padding: 15px;
    border-radius: 3px;
    border: 1px solid #eee;
}

/* Field styling */
.nx-extension-field {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.nx-extension-field:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.nx-field-title {
    margin-bottom: 8px;
}

.nx-field-title label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    display: block;
}

.nx-field-description {
    font-size: 13px;
    color: #777;
    margin-bottom: 10px;
}

.nx-field-input {
    margin-bottom: 5px;
}
.nx-option-disabled {
    opacity: .4;
}
 

.nx-lightbox-icon, .nx-option-image .nx-lightbox-icon, .nx-lightbox-image .nx-lightbox-icon{
    position: absolute;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    padding: 3px;
    right: 3px;
    top: 3px;
}

/* Text input styles */
.nx-text-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Radio and checkbox option styles */
.nx-radio-option,
.nx-checkbox-option {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}
.nx-radio-option:not(.nx-option-with-image), .nx-checkbox-option:not(.nx-option-with-image) {
	width: 100%;
	border-bottom: dashed 1px #ddd;
}

.nx-radio-option:last-child,
.nx-checkbox-option:last-child {
    margin-bottom: 0;
}

.nx-radio-input,
.nx-checkbox-input {
    margin-right: 8px;
}

.nx-select-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.nx-price-modifier {
    color: #777;
    font-size: 0.9em;
    margin-left: 5px;
}
.nx-option-tooltip .nx-price-modifier {
    font-weight: bold;
    color: #fff;
}

/* Field price modifier */
.nx-field-price-modifier {
    margin-top: 5px;
    font-size: 0.9em;
    color: #777;
}

/* Image display */
.nx-image {
    margin-bottom: 10px;
}

.nx-image img {
    max-width: 100%;
    height: auto;
    border-radius: 3px;
    border: 1px solid #eee;
}

/* Gallery display */
.nx-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.nx-gallery-item {
  /*  width: calc(25% - 8px);*/
    border: 1px solid #eee;
    border-radius: 3px;
    overflow: hidden;
}

.nx-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* Price summary */
.nx-extensions-price-summary {
    margin-top: 15px;
    padding: 10px 15px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}
.nx-extensions-price-summary  > div {
	font-size: .9em;
}

.nx-extensions-price-amount {
    color: #7f54b3;
}

.nx-extensions-price-amount {
    color: #7f54b3;
}

/* Required field indicator */
.required {
    color: #e2401c;
}

/* Styling for admin order view */
.nx-admin-order-extensions {
    background: #f8f8f8;
    padding: 10px;
    margin-top: 10px;
}

.nx-product-extensions:not(.nx-fullscreen)  .fs-add-to-cart {
	display: none;
}

/* Add styles for conditional fields and disabled fields */
.nx-field-disabled {
    opacity: 0.7;
    position: relative;
}

.nx-field-disabled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    z-index: 1;
    pointer-events: none;
}

.nx-field-disabled label {
    cursor: not-allowed !important;
}

.nx-field-disabled input,
.nx-field-disabled select {
    cursor: not-allowed !important;
}

.nx-conditional-field {
    transition: opacity 0.3s, max-height 0.5s, margin 0.5s, padding 0.5s;
    
}

/* Fade in animation for conditional fields */
.nx-conditional-field.fade-in {
    animation: fade-in 0.4s ease-in-out;
}

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

/* Responsive adjustments */
@media (min-width: 1024px) {
    .nx-fullscreen.nx-product-extensions .nx-extensions-price-summary {
        position: fixed;
        bottom: 0;
        width: 50%;
    }
}

@media (max-width: 768px) {
    .nx-gallery-item {
        width: calc(33.33% - 7px);
    }
    .nx-extensions-price-summary {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .nx-extensions-price-summary > div {
        font-size: 0.9em;
        width: 50%;
    }
    .nx-fullscreen.nx-product-extensions .nx-product-extensions-image {
        display: none;
    }
    .nx-fullscreen.nx-product-extensions .nx-product-extensions-inner {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .nx-gallery-item {
        width: calc(50% - 5px);
    }
}

/* Cart display */
.woocommerce-cart-form .nx-extension-details {
    font-size: 0.85em;
    color: #555;
    margin-top: 5px;
}

/* Order display */
.nx-order-extensions {
    margin-top: 10px;
    font-size: 0.9em;
}

.nx-extension-order-group {
    margin-bottom: 10px;
}

.nx-extension-order-group ul {
    margin: 5px 0 0 20px;
    padding: 0;
    list-style: disc;
}

.nx-extension-order-field {
    font-weight: 600;
}

.nx-extension-order-total {
    margin-top: 10px;
    font-weight: 600;
    color: #7f54b3;
}


/* Image option styling */
.nx-option-with-image {
    display: inline-block;
    margin: 0;
    text-align: center;
    position: relative;
}

.nx-option-with-image input[type="radio"],
.nx-option-with-image input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.nx-image-label {
    cursor: pointer;
    display: block;
    padding: 1px;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.nx-option-image {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 3px;
}

.nx-option-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Option tooltip */
.nx-option-tooltip {
    position: absolute;
    display: inline-block;
    margin-top: 5px;
}

.nx-option-tooltip-text {
    font-size: 12px;
    color: #777;
}

/* Selected state */
.nx-option-with-image input:checked + .nx-image-label {
    border-color: #7f54b3;
    background-color: rgba(127, 84, 179, 0.05);
}

/* Hover tooltip for image options */
.nx-option-with-image .nx-image-label:hover .nx-option-tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Checkbox/Radio container styles */
.nx-checkbox-options-container,
.nx-radio-options-container {
    display: flex;
    flex-wrap: wrap;
    margin: -5px;
}

/* Layout options for different displays */
.nx-checkbox-options-container.nx-layout-grid,
.nx-radio-options-container.nx-layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .nx-checkbox-options-container.nx-layout-grid,
    .nx-radio-options-container.nx-layout-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
}
@media (max-width: 786px) {
    .nx-extension-group {
        padding: 10px 5px;
    }
}

.nx-fullscreen-button {
    position: absolute;
    right: 0;
    padding: 5px;
    line-height: 0;
}

/* Enhanced tooltip display on hover */
.nx-option-with-image .nx-option-tooltip .nx-option-tooltip-text {
    visibility: hidden;
    max-width: 180px;
	min-width: 120px;
	line-height: 1.3;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.nx-option-with-image .nx-option-tooltip .nx-option-tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}



/* Image field with checkbox */
.nx-image-field-container,
.nx-gallery-field-container {
    margin-bottom: 15px;
}

.nx-image-field-checkbox,
.nx-gallery-field-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.nx-image-field-checkbox input[type="checkbox"],
.nx-gallery-field-checkbox input[type="checkbox"] {
    margin-right: 8px;
}

.nx-image-field-checkbox label,
.nx-gallery-field-checkbox label {
    font-weight: 600;
}

/* Gallery grid layout */
.nx-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.nx-gallery-item, .nx-lightbox-image {
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    width: 80px;
    height: 80px;
}

.nx-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* Selected options list styling */
.nx-list-selected {
    margin-top: 12px;
    font-size: 13px;
}

.nx-selected-options-list {
    background: #f7f7f7;
    border-left: 3px solid #7f54b3;
    padding: 8px 12px;
    border-radius: 3px;
}

.nx-selected-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.nx-selected-option:last-child {
    margin-bottom: 0;
}

.nx-selected-option-name {
    font-weight: 500;
}

.nx-selected-option-price {
    color: #7f54b3;
    font-weight: 600;
}


/* Lightbox image styling */
.nx-lightbox-image {
    cursor: pointer;
    position: relative;
}


.nx-lightbox-image:after {
    content: "+";
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.nx-lightbox-image:hover:after {
    opacity: 1;
}

/* Override Magnific Popup styles if needed */
.mfp-bg {
    z-index: 99999;
}

.mfp-wrap {
    z-index: 100000;
}


/* Error styling */
.nx-field-error .nx-field-title label {
    color: #e2401c;
}

.nx-error-message {
    display: block;
    color: #e2401c;
    font-size: 0.875em;
    margin-top: 0.5em;
    font-style: italic;
}

.nx-extensions-general-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid #f5c6cb;
    border-radius: 0.25rem;
    font-weight: 500;
}

.nx-field-error .nx-selected-options-list {
    border-left-color: #e2401c;
}

/* Highlight the field container */
.nx-field-error {
    padding: 10px;
    background-color: rgba(226, 64, 28, 0.05);
    border-radius: 3px;
    margin-bottom: 10px;
}

/* Product Addons Styles */
.nx-product-addons-container {
    display: flex;
    flex-wrap: wrap;
    margin: -5px;
}

.nx-product-addon-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 5px;
}

.nx-product-addon-option .nx-product-addon-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.nx-product-addon-option .nx-image-label {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: all 0.2s ease;
}

/* Selected state for product addons */
.nx-product-addon-option .nx-product-addon-input:checked + .nx-image-label {
    border-color: #7f54b3;
    background-color: rgba(127, 84, 179, 0.05);
}

/* Ensure tooltip doesn't block clicks */
.nx-product-addon-option .nx-option-tooltip {
    pointer-events: none;
}

.nx-product-addon-option .nx-option-tooltip .nx-option-tooltip-text {
    pointer-events: none;
}

/* Hover effect for product addon tooltips */
.nx-product-addon-option .nx-image-label:hover .nx-option-tooltip-text {
    visibility: visible;
    opacity: 1;
}
