/* Modal base styles */
.wallpaper-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 999999;
    padding: 20px;
    box-sizing: border-box;
    /* overflow-y: none; */
}

.wallpaper-modal .wallpaper-modal-content {
    position: relative;
    background-color: #fff;
    margin: 0 auto;
    max-width: 1200px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    height: 100%;
    overflow: auto;
    top: 50%;
    transform: translateY(-50%);
}
.wallpaper-modal.show .wallpaper-modal-content {
    transform: translateY(-50%);
}

.wallpaper-modal-close span.dashicons{
    display: inline-block;
    position: relative;
    top: -3%;
    left: -1px;
}
.wallpaper-modal-close span.dashicons:before, 
.wallpaper-modal-close span.dashicons:after {
    position: absolute;
    content: ' ';
    height: 22px;
    width: 2px;
    background-color: #606060;
    transition: all 0.2s ease-in-out;
}
.wallpaper-modal-close:hover span.dashicons:before, 
.wallpaper-modal-close:hover span.dashicons:after {
    background-color: #606060;
    background-color: #cf1717;
}
.wallpaper-modal-close span.dashicons:before {
    transform: rotate(45deg);
}
.wallpaper-modal-close span.dashicons:after {
    transform: rotate(-45deg);
}
  
.wallpaper-modal .wallpaper-modal-content::-webkit-scrollbar {
    width: 8px;
}
.wallpaper-modal .wallpaper-modal-content::-webkit-scrollbar-track {
    box-shadow: inset 0 0 5px grey; 
    border-radius: 5px;
}
.wallpaper-modal .wallpaper-modal-content::-webkit-scrollbar-thumb {
    background: #333; 
    border-radius: 5px;
}
.wallpaper-modal .wallpaper-modal-content::-webkit-scrollbar-thumb:hover {
    background: #b30000; 
}

.wallpaper-modal button.wallpaper-modal-close {
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 28px;
    font-weight: 500;
    cursor: pointer;
    color: #666;
    z-index: 1;
    width: 40px;
    height: 40px;
    line-height: 1;
    text-align: center;
    border-radius: 50%;
    transition: all 0.2s;
    padding: 0 !important;
    min-height: 0;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    color: #FFF;
}

.wallpaper-modal button.wallpaper-modal-close:hover {
    /*background-color: #ccc;*/
    color: #606060;
    color: #cf1717;
}

.wallpaper-modal-body {
    padding: 10px;
    /* max-height: calc(100vh - 100px);
    overflow-y: auto; */
}

.wallpaper-preview-container h2 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2em;
}

.wallpaper-modal-body .wallpaper-preview-container {
    padding: 1.5rem;
}

/* Preview content */
.preview-header {
    margin-bottom: 20px;
    padding-right: 40px;
}

.preview-header h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.5;
    color: #333;
}

.preview-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
}

@media (max-width: 768px) {
    .preview-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.preview-image-container {
    background: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.preview-image {
    display: block;
    max-width: 100%;
    height: auto;
}

.preview-image.mirror {
    transform: scaleX(-1);
}

/* Details section */
.preview-details {
    font-size: 14px;
}

.details-section h3 {
    margin: 0 0 15px;
    font-size: 18px;
    color: #333;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 5px;
}

.details-table th,
.details-table td {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.details-table th {
    color: #666;
    font-weight: normal;
    width: 40%;
}

.details-table td {
    color: #333;
    font-weight: 500;
}

/* Loading state */
.wallpaper-preview-loading {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error state */
.wallpaper-preview-error {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.error-icon {
    margin-bottom: 15px;
    color: #e74c3c;
}

.error-icon svg {
    width: 40px;
    height: 40px;
}

/* Preview button */
button.wallpaper-preview-button {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 5px 10px;
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
    text-decoration: none;
    margin-top: 6px;
}

button.wallpaper-preview-button:hover {
    background: #eeeeee !important; 
    border-color: #ccc !important;
    color: #333;
}

.preview-icon {
    width: 16px;
    height: 16px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4M10 17l5-5-5-5M13.8 12H3"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
}

/* Body class when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Mini cart specific styles */
.widget_shopping_cart .wallpaper-preview-button {
    font-size: 12px;
    padding: 6px 12px;
    margin-top: 5px;
}


.wallpaper-modal .owl-carousel .owl-nav button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    margin: 0;
}
.wallpaper-modal .owl-carousel .owl-nav button.owl-prev {
    left: -12%;
}
.wallpaper-modal .owl-carousel .owl-nav button.owl-next {
    right: -12%;
}
.wallpaper-modal .owl-carousel .owl-nav button i {
    background: #242424;
    font-size: 16px;
    border-radius: 50% !important;
    padding: 5px 12px;
    margin: 0;
}
.wallpaper-modal .owl-theme .owl-nav [class*=owl-]:hover{
    background: transparent;
}
.wallpaper-modal .owl-carousel.owl-theme .owl-nav button i:hover {
    background: #242424 ;
}



/* Responsive adjustments */
@media (max-width: 1024px) {
    .wallpaper-modal .wallpaper-modal-content {
        /* margin: 20px auto; */
        height: 75vh;
        /*top: auto;*/
    }
    .wallpaper-modal-close span.dashicons {
        top: -20%;
    }
    .wallpaper-modal-content .owl-theme .owl-nav.disabled+.owl-dots {
	    margin-top: 0;
	}
}


/* Responsive adjustments */
@media (max-width: 1024px) {
    .wallpaper-modal.show .wallpaper-modal-content {
        transform: translateY(-70%);
    }
}


/* Responsive adjustments */
@media (max-width: 760px) {
    .wallpaper-modal.show .wallpaper-modal-content {
        transform: translateY(-55%);
    }
    .wallpaper-modal-body {
        padding: 0;
    }
    .wallpaper-modal-body .wallpaper-preview-container {
        padding: 1rem;
        padding-top: 2.5rem;
    }
    /*.wallpaper-modal-close span.dashicons{
        top: -30%;
    }*/
    .preview-header h2 {
        font-size: 20px;
    }
    .wallpaper-modal button.wallpaper-modal-close {
        width: 35px;
        height: 35px;
    }
}


.variation-Preview .item-variation-name {
    display: none !important;
}
button.wallpaper-preview-button {
    /* padding: 0px 7px !important; */
    background: transparent !important;
    /* margin: 0px !important; */
    min-height: 35px !important;
    border: 1px solid #848484 !important;
    border-radius: 5px !important;
    line-height: 0px !important;
    margin-bottom: 10px;
}

/* temp fix for the 'Fix Filter on Mobile' script (adding #applied-filters-box element to upsell products) */
.bde-upsell-products #applied-filters-box {
    display: none;
}

/* set 'Preview Cropping' button at the bottom of the item data on the cart page */
.woocommerce-cart-form .cart_item td.product-name {
    display: flex;
    flex-direction: column;
}
.woocommerce-cart-form .cart_item td.product-name .wallpaper-preview-button-wrap {
    order: 3;
}

/* Change shipping methods display on cart */
@media (max-width:480px) {
    .cart_totals tr.woocommerce-shipping-totals.shipping {
        display: flex;
        flex-direction: column;
        width: max-content;
    }
    .cart_totals tr.woocommerce-shipping-totals.shipping td {
        padding-left: 0;
        padding-top: 0;
        width: 100%;
    }
}
/* Change shipping methods display on checkout  */
@media (max-width:480px) {
    .woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals.shipping {
        display: flex;
        flex-direction: column;
        width: max-content;
    }
    .woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals.shipping td {
        width: 100%;
        padding-top: 0;
    }
}