/* General button styling */
.xise-button {
    color: #fff;
    padding: 10px 16px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1em;
    transition: background 0.3s ease;
}

.xise-button:hover {
    background: #555;
}
.xise-button img{
    width: 20px;
    height: 20px;
}


/* Side Panel Styling */
.xise-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 300px;
    max-width: 90%;
    height: 100%;
    background: #fff;
    box-shadow: -2px 0 6px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

}

.xise-panel.xise-visible {
    right: 0;
}

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

.xise-panel-header h3 {
    margin: 0;
    font-size: 1.3em;
    color: #333;
}

.xise-close-panel {
    background: none;
    border: none;
    font-size: 1.8em;
    cursor: pointer;
    color: #777;
    line-height: 1;
    padding: 0;
    transition: color 0.2s ease;
}

.xise-close-panel:hover {
    color: #333;
}

.xise-upload-container {
    max-width: 100%;
    /* Fill panel width */
    margin: 0 auto;
    padding: 0;
    border: none;
    box-shadow: none;
    background-color: transparent;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Drag & Drop Area */
.xise-drop-area {
    border: 3px dashed #a0d3ff;
    border-radius: 12px;
    padding: 50px 20px;
    margin-bottom: 20px;
    background-color: #f7fcff;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}

.xise-drop-area.xise-drag-over {
    background-color: #e6f7ff;
    border-color: #60a5fa;
}

.xise-drop-text {
    color: #4a4a4a;
    font-size: 1.25em;
    font-weight: bold;
    margin-bottom: 10px;
}

.xise-or-text {
    color: #777;
    font-size: 0.95em;
    margin-bottom: 20px;
}

.xise-file-input {
    display: none;
}

.xise-browse-button {
    display: inline-block;
    background-color: #1B1AFF;
    color: white;
    padding: 12px 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.05em;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.xise-browse-button:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

/* Status message for upload progress/results */
.xise-status-message {
    margin-top: 15px;
    font-size: 0.95em;
    font-weight: bold;
    color: #555;
    min-height: 20px;
}

.xise-status-message.success {
    color: #28a745;
}

.xise-status-message.error {
    color: #dc3545;
}

.xise-status-message.loading {
    color: #007bff;
}


/* Popup Result Display */
.xise-popup {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    /* Optional: subtle blur effect */
}

.xise-popup.xise-visible {
    display: flex;
    /* Displayed when active */
}

.xise-popup-content {
    background: #fff;
    padding: 30px;
    max-width: 95%;
    max-height: 90%;
    overflow-y: auto;
    border-radius: 12px;
    width: 1200px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Close button for popup */
.xise-close-popup {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #666;
    line-height: 1;
    transition: color 0.2s ease;
}

.xise-close-popup:hover {
    color: #000;
}

.xise-popup-content h3 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 1.6em;
    color: #333;
    text-align: center;
}

/* Grid container for uploaded image and products */
.xise-results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 20px;
    width: 100%;
}

@media (min-width: 768px) {

    /* Two columns on larger screens */
    .xise-results-grid {
        grid-template-columns: 220px 1fr;
        /* Fixed width for image, fluid for products */
        gap: 40px;
    }
}

.xise-uploaded-image-section {
    text-align: center;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    background-color: #f9f9f9;
    height: fit-content;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.xise-uploaded-image-section h4 {
    margin-top: 0;
    color: #555;
    font-size: 1.1em;
    margin-bottom: 15px;
}

.xise-uploaded-image-section img {
    max-width: 180px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    object-fit: contain;
}

.xise-products-section {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
}

.xise-products-section h4 {
    margin-top: 0;
    color: #555;
    font-size: 1.1em;
    margin-bottom: 15px;
    text-align: center;
}

/* Product list styling */
.xise-products-section .products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    flex-grow: 1;
}

.xise-products-section .products .product {
    text-align: center;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.xise-products-section .products .product:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.xise-products-section .products .product img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
}

.xise-products-section .products .product h3 {
    font-size: 1.1em;
    margin: 10px 0;
    color: #333;
    text-align: center;
}

.xise-products-section .products .product .price {
    font-size: 1.2em;
    font-weight: bold;
    color: #28a745;
    display: block;
}

/* Product Loading Spinner */
.xise-products-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    color: #555;
    font-size: 1.1em;
    text-align: center;
}

.xise-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

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

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

.xise-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 1rem;
}

.xise-section-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 2rem;
    text-align: center;
}

/* Custom Grid Layout */
.xise-product-grid-container {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

/* Medium screens (sm: equivalent) - 2 columns */
@media (min-width: 640px) {
    .xise-product-grid-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Large screens (lg: equivalent) - 3 columns */
@media (min-width: 1024px) {
    .xise-product-grid-container {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Product Card Styling */
.xise-product-card {
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Ensures button is at the bottom */
}

.xise-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.xise-product-image-wrapper {
    width: 100%;
    padding-top: 100%;
    /* 1:1 Aspect Ratio */
    position: relative;
    background-color: #e5e7eb;
    /* Placeholder background */
}

.xise-product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-bottom: 1px solid #e5e7eb;
}

.xise-product-details {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    /* Allows details to take available space */
}

.xise-product-title {
    font-size: 1.125rem;
    /* text-lg */
    font-weight: 600;
    /* font-semibold */
    color: #1f2937;
    /* text-gray-900 */
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.xise-product-price {
    font-size: 1.25rem;
    /* text-xl */
    font-weight: 700;
    /* font-bold */
    color: #4f46e5;
    /* indigo-600 */
    margin-top: auto;
    /* Pushes price to the bottom of details */
    margin-bottom: 1rem;
}

.xise-add-to-cart-button {
    display: block;
    width: 100%;
    padding: 0.75rem 1.25rem;
    background-color: #4f46e5;
    /* indigo-600 */
    color: #ffffff;
    font-weight: 600;
    text-align: center;
    border-radius: 8px;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
    cursor: pointer;
    border: none;
    text-decoration: none;
    /* For anchor tags */
}

.xise-add-to-cart-button:hover {
    background-color: #4338ca;
    /* indigo-700 */
    transform: translateY(-1px);
}

.xise-add-to-cart-button:active {
    transform: translateY(0);
}
.woocommerce-product-search{
display:flex;
}
.woocommerce-product-search button[type="submit"]{
position: relative !important;    
}
.woocommerce-product-search .xise-button img{
    width: 30px;
}
/* Responsive adjustments for smaller screens if needed, though CSS Grid handles much of it */
@media (max-width: 767px) {
    .xise-product-card {
        margin-bottom: 1rem;
        /* Add some space between cards on small screens */
    }
}