.ehtsearch-widget {
    position: relative;
    width: 100%;
    max-width: var(--eht-bar-width-desktop, 600px);
    /* Use CSS variable */
    margin: 0 auto;
    transition: all 0.3s ease;
    z-index: 1002;
    /* Base z-index */
}

/* --- IMMERSIVE MODE (Active) --- */
.ehtsearch-widget.ehtsearch-active {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    background: #fff;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    height: auto;
    z-index: 2147483642 !important;
    /* Force on top of everything */

    /* Animation: Slide Down from Top Center */
    animation: slideDown 0.3s ease-out forwards;
    transform-origin: top center;
}

@keyframes slideDown {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.ehtsearch-widget.ehtsearch-active .ehtsearch-input-group {
    max-width: 1200px;
    /* Limit width of input in full screen */
    margin: 0 auto;
    border: 1px solid var(--eht-btn-bg, #2fb5d2);
    /* Highlight border */
    box-shadow: 0 0 0 3px rgba(47, 181, 210, 0.1);
    position: relative;
    z-index: 2147483643 !important;
    /* Input above widget background */
    background: #fff;
}

/* ----------------------------- */

.ehtsearch-input-group {
    display: flex;
    align-items: center;
    /* Vertical centering */
    justify-content: space-between;
    background: #fff;
    border-radius: var(--eht-bar-border-radius, 20px);
    /* Use CSS variable */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0;
    /* Remove padding on container */
    border: var(--eht-bar-border-width, 1px) solid #ddd;
    /* Use CSS variable */
    transition: all 0.3s ease;
    height: 45px;
    /* Fixed height for consistency */
    overflow: hidden;
    /* Ensure children don't overflow */
}

.ehtsearch-input {
    flex-grow: 1;
    border: none;
    outline: none;
    padding: 0 15px;
    font-size: 16px;
    background: transparent;
    height: 100%;
    /* Fill height */
    line-height: normal;
    /* Reset line-height */
    margin: 0;
}

.ehtsearch-loader {
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--eht-btn-bg, #2fb5d2);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    display: none;
    margin-right: 10px;
}

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

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

.ehtsearch-mic,
.ehtsearch-vision,
.ehtsearch-button {
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 0 15px;
    color: #333;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    line-height: 1;
}

.ehtsearch-mic,
.ehtsearch-vision {
    color: #777;
    transition: all 0.2s;
    padding-right: 5px;
}

.ehtsearch-mic:hover,
.ehtsearch-vision:hover,
.ehtsearch-button:hover {
    color: var(--eht-btn-bg, #2fb5d2);
}

.ehtsearch-mic.listening,
.ehtsearch-vision.uploading {
    color: var(--eht-discount, #f44336);
    animation: eht-pulse 1.5s infinite;
}

.ehtsearch-mic:hover {
    color: #333;
}

.ehtsearch-mic.listening {
    color: var(--eht-discount, #f44336);
    animation: pulse 1.5s infinite;
}

.ehtsearch-button i,
.ehtsearch-mic i,
.ehtsearch-vision i {
    display: block;
    font-size: 24px;
    line-height: 1;
    height: 20px;
}

@keyframes eht-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

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

.ehtsearch-results {
    position: fixed;
    left: 0;
    right: 0;
    /* Top will be set by JS, but default to something reasonable */
    top: 75px;
    height: calc(100vh - 75px);
    /* Force full height minus header */
    background: #fff;
    overflow-y: auto;
    z-index: 2147483641 !important;
    /* Just below the widget but above overlay */
    padding: 20px 0;
    box-sizing: border-box;
    border-top: 1px solid #eee;
    display: none;
    /* Hidden by default */
}

.ehtsearch-results-content {
    max-width: var(--eht-results-width, 1600px);
    /* Use CSS variable */
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100%;
    /* Ensure content fills the scrollable area */
}

.ehtsearch-close-btn {
    display: none;
    /* Hidden by default, shown in active mode via JS logic or CSS */
}

.ehtsearch-widget.ehtsearch-active .ehtsearch-close-btn {
    display: flex;
    background: none;
    border: none;
    font-size: 24px;
    /* Larger for better visibility */
    cursor: pointer;
    color: #333;
    /* Darker for contrast */
    padding: 0 15px;
    line-height: 1;
    height: 100%;
    margin: 0;
    outline: none;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #eee;
}

.ehtsearch-widget.ehtsearch-active .ehtsearch-close-btn i {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

/* History Styles */
.ehtsearch-history {
    padding: 10px 0;
}

.ehtsearch-section-title {
    font-size: 13px;
    text-transform: uppercase;
    color: #999;
    margin: 0 0 15px 0;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.ehtsearch-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ehtsearch-history-list li {
    padding: 10px 15px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 15px;
    color: #333;
    transition: background 0.2s;
}

.ehtsearch-history-list li:hover {
    background: #f9f9f9;
}

.ehtsearch-history-list li i {
    margin-right: 15px;
    color: #bbb;
    font-size: 20px;
}

/* Suggestions (Categories/Brands) */
.ehtsearch-suggestions-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    /* Centered */
}

.ehtsearch-suggestions-list li a {
    display: inline-block;
    padding: 8px 16px;
    background: #f0f2f5;
    border-radius: 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
}

.ehtsearch-suggestions-list li a:hover {
    background: #e0e0e0;
    color: #000;
}

/* Predictions (Suggestions) */
.ehtsearch-suggestion-item {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #f0f2f5;
    border-radius: 20px;
    color: #333;
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
}

.ehtsearch-suggestion-item:hover {
    background: #e0e0e0;
    color: #000;
}

.ehtsearch-suggestion-item i {
    font-size: 16px;
    margin-right: 5px;
    color: #999;
    display: flex;
    align-items: center;
}

/* Results Grid */
.ehtsearch-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 20px;
}

.ehtsearch-result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    background: #fff;
    height: 100%;
    box-sizing: border-box;
    /* Ensure padding is included in width */
    overflow: hidden;
    /* Prevent overflow */
}

.ehtsearch-result-item:hover,
.ehtsearch-result-item.selected {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: var(--eht-btn-bg, #2fb5d2);
}

/* NEW WRAPPER STRUCTURE */
.ehtsearch-product-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex-grow: 1;
}

.ehtsearch-product-link,
.ehtsearch-product-link-info {
    display: block;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.ehtsearch-product-link-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
}

.ehtsearch-product-image {
    position: relative;
    width: 100%;
    height: var(--eht-img-height, 180px);
    /* Use CSS variable */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    overflow: hidden;
}

.ehtsearch-product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ehtsearch-discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--eht-discount, #f44336);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    z-index: 1;
}

.ehtsearch-stock-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    z-index: 1;
    color: #fff;
}

.ehtsearch-stock-available {
    background-color: var(--eht-stock-in, #4cbb6c);
}

.ehtsearch-stock-unavailable {
    background-color: #e0e0e0;
    color: #888;
}

.ehtsearch-stock-last {
    background-color: var(--eht-stock-last, #ff9800);
}

.ehtsearch-highlight {
    background-color: #fff3cd;
    font-weight: bold;
    color: #333;
    padding: 0 2px;
}

.product-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 42px;
    color: #333;
}

.product-price-and-shipping {
    font-size: 16px;
    color: var(--eht-btn-bg, #2fb5d2);
    margin-top: auto;
    font-weight: bold;
}

.regular-price {
    text-decoration: line-through;
    color: #999;
    font-size: 13px;
    margin-right: 5px;
    font-weight: normal;
}

.ehtsearch-add-to-cart {
    margin-top: 15px;
    width: 100%;
}

.ehtsearch-add-to-cart button,
.ehtsearch-add-to-cart a.btn {
    width: 100%;
    padding: 10px;
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    background-color: var(--eht-btn-bg, #2fb5d2);
    color: var(--eht-btn-text, #ffffff);
    border: none;
    transition: background 0.2s;
    display: block;
    text-align: center;
}

.ehtsearch-add-to-cart button:hover,
.ehtsearch-add-to-cart a.btn:hover {
    opacity: 0.9;
    color: var(--eht-btn-text, #ffffff);
}

.ehtsearch-add-to-cart button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.ehtsearch-view-all {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 20px 0;
    margin-top: 20px;
    border-top: 1px solid #eee;
}

.ehtsearch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-primary, #000);
    /* Use primary color or black */
    opacity: 0.7;
    /* Transparency */
    z-index: 2147483640 !important;
    /* High z-index but below widget */
    backdrop-filter: blur(3px);
}

/* Modal Styles */
.ehtsearch-modal {
    position: fixed;
    top: 200px;
    left: 0px;
    width: 100%;
    height: 100%;
    /* background: rgba(0, 0, 0, 0.5); */
    z-index: 200000;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
}

.ehtsearch-modal.active {
    display: flex !important;
}

.ehtsearch-modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-align: center;
    margin: auto;
    /* Ensure centering */
}

.ehtsearch-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.ehtsearch-modal-content h3 {
    margin-top: 0;
    color: #333;
}

.ehtsearch-modal-content .form-group {
    margin: 15px 0;
}

.ehtsearch-modal-content .form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.ehtsearch-alert-message {
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
}

.ehtsearch-alert-message.success {
    background-color: #d4edda;
    color: #155724;
}

.ehtsearch-alert-message.error {
    background-color: #f8d7da;
    color: #721c24;
}

/* Attributes Styles */
.ehtsearch-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    margin-bottom: 15px;
    /* Increased space below attributes */
    width: 100%;
    /* Force full width */
    z-index: 2;
}

.ehtsearch-attr-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #ddd;
    cursor: pointer;
    display: inline-block;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    /* For icon positioning */
}

.ehtsearch-attr-text {
    font-size: 12px;
    padding: 8px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    color: #333;
    position: relative;
    /* For icon positioning */
    z-index: 0;
    /* Create stacking context */
    text-decoration: none;
    /* Remove underline for links */
}

.ehtsearch-attr-color:hover,
.ehtsearch-attr-text:hover {
    border-color: #999;
    transform: scale(1.1);
}

/* Out of stock attributes style - ENVELOPE ICON */
.ehtsearch-attr-color.ehtsearch-alert-btn,
.ehtsearch-attr-text.ehtsearch-alert-btn {
    /* Common styles if any */
}

.ehtsearch-attr-color.ehtsearch-alert-btn::after,
.ehtsearch-attr-text.ehtsearch-alert-btn::after {
    content: '\e0be';
    /* Material Icon 'email' */
    font-family: 'Material Icons';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    /* Let click pass through to parent */
    width: auto;
    height: auto;
    background: none;
    line-height: 1;
}

/* Color Attribute: Icon on top */
.ehtsearch-attr-color.ehtsearch-alert-btn::after {
    font-size: 12px;
    color: #000;
    /* Black icon */
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
    /* White shadow */
    z-index: 10;
}

.ehtsearch-attr-color.ehtsearch-alert-btn {
    opacity: 0.6;
}

/* Text Attribute: Icon behind text */
.ehtsearch-attr-text.ehtsearch-alert-btn::after {
    font-size: 24px;
    color: var(--eht-discount, #f44336);
    opacity: 0.3;
    z-index: -1;
}

.ehtsearch-attr-text.ehtsearch-alert-btn {
    color: #333;
    /* Text visible */
    /* border-color: #d32f2f; */
    /* Optional */
}

/* --- THEME CROSSED (Envelope under crossed-out attribute) --- */

/* Common styles for both Color and Text in Crossed Theme */
.ehtsearch-theme-crossed .ehtsearch-attr-color.ehtsearch-alert-btn,
.ehtsearch-theme-crossed .ehtsearch-attr-text.ehtsearch-alert-btn {
    position: relative;
    opacity: 1;
    border: 1px solid #ccc;
    /* Visible frame */
    box-shadow: none;
    /* Optional: remove shadow to look flatter or keep it */
    transition: all 0.2s;
    vertical-align: top;
}

.ehtsearch-theme-crossed .ehtsearch-attr-color.ehtsearch-alert-btn:hover,
.ehtsearch-theme-crossed .ehtsearch-attr-text.ehtsearch-alert-btn:hover {
    border-color: #999;
}

/* --- COLOR ATTRIBUTES --- */
.ehtsearch-theme-crossed .ehtsearch-attr-color.ehtsearch-alert-btn {
    width: 26px;
    /* Wider */
    height: 42px;
    /* Taller to fit icon below */
    border-radius: 4px;
    /* Rectangular with soft corners */

    /* Trick to limit background color to top part */
    background-clip: content-box;
    padding: 3px 3px 19px 3px;
    /* Top/Left/Right padding small, Bottom large for icon */

    /* Reset flex from common styles if any */
    display: inline-block;
}

/* Cross for Color */
.ehtsearch-theme-crossed .ehtsearch-attr-color.ehtsearch-alert-btn::before {
    content: '';
    position: absolute;
    top: 13px;
    /* Center of the color area approx */
    left: 2px;
    right: 2px;
    height: 1px;
    background-color: #555;
    z-index: 2;
    transform: none;
    /* Horizontal */
}

/* Icon for Color */
.ehtsearch-theme-crossed .ehtsearch-attr-color.ehtsearch-alert-btn::after {
    content: '\e0be';
    /* Material Icon email */
    font-family: 'Material Icons';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: #666;
    line-height: 1;
}

/* --- TEXT ATTRIBUTES --- */
.ehtsearch-theme-crossed .ehtsearch-attr-text.ehtsearch-alert-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-width: 30px;
    height: auto;
    padding: 5px 12px;

    border-radius: 4px;
    background: #fff;
    /* Ensure white background */
}

/* Cross for Text */
.ehtsearch-theme-crossed .ehtsearch-attr-text.ehtsearch-alert-btn::before {
    content: '';
    position: absolute;
    top: 30%;
    /* Position over the text part */
    left: 5px;
    right: 5px;
    height: 1px;
    background-color: #555;
    z-index: 2;
}

/* Icon for Text */
.ehtsearch-theme-crossed .ehtsearch-attr-text.ehtsearch-alert-btn::after {
    content: '\e0be';
    font-family: 'Material Icons';
    font-size: 14px;
    color: #666;
    margin-top: 2px;
    line-height: 1;
    position: static;
    /* Flow naturally below text */
    transform: none;
}

/* Adjust text styling inside */
.ehtsearch-theme-crossed .ehtsearch-attr-text.ehtsearch-alert-btn {
    font-size: 10px;
    line-height: 1.2;
    color: #999;
    /* Greyed out text */
}

/* --- THEMES --- */

/* Minimal (List) */
.ehtsearch-results-list.ehtsearch-minimal,
.ehtsearch-results-list.ehtsearch-theme-minimal {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ehtsearch-results-list.ehtsearch-minimal .ehtsearch-result-item,
.ehtsearch-results-list.ehtsearch-theme-minimal .ehtsearch-result-item {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    padding: 10px;
    border: none;
    border-bottom: 1px solid #eee;
    border-radius: 0;
}

/* Updated for new structure */
.ehtsearch-results-list.ehtsearch-minimal .ehtsearch-product-wrapper,
.ehtsearch-results-list.ehtsearch-theme-minimal .ehtsearch-product-wrapper {
    flex-direction: row;
    align-items: flex-start;
    width: 100%;
}

.ehtsearch-results-list.ehtsearch-minimal .ehtsearch-product-link,
.ehtsearch-results-list.ehtsearch-theme-minimal .ehtsearch-product-link {
    width: auto;
    /* Image link only */
}

.ehtsearch-results-list.ehtsearch-minimal .ehtsearch-product-image,
.ehtsearch-results-list.ehtsearch-theme-minimal .ehtsearch-product-image {
    width: 80px;
    /* Fixed small width */
    height: 100px;
    /* Fixed small height */
    flex-shrink: 0;
    margin-right: 15px;
    margin-bottom: 0;
}

.ehtsearch-results-list.ehtsearch-minimal .ehtsearch-product-info,
.ehtsearch-results-list.ehtsearch-theme-minimal .ehtsearch-product-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100px;
    /* Match image height */
    align-items: flex-start;
    /* Left align */
}

.ehtsearch-results-list.ehtsearch-minimal .product-name,
.ehtsearch-results-list.ehtsearch-theme-minimal .product-name {
    font-size: 14px;
    margin-bottom: 5px;
    height: auto;
    -webkit-line-clamp: 2;
}

.ehtsearch-results-list.ehtsearch-minimal .product-category,
.ehtsearch-results-list.ehtsearch-theme-minimal .product-category {
    display: none;
    /* Hide category in minimal mode */
}

.ehtsearch-results-list.ehtsearch-minimal .product-price-and-shipping,
.ehtsearch-results-list.ehtsearch-theme-minimal .product-price-and-shipping {
    margin-top: auto;
    font-size: 15px;
    align-items: flex-start;
    /* Left align */
}

.ehtsearch-results-list.ehtsearch-minimal .ehtsearch-add-to-cart,
.ehtsearch-results-list.ehtsearch-theme-minimal .ehtsearch-add-to-cart {
    width: auto;
    margin-top: 0;
    margin-left: 10px;
    align-self: center;
}

.ehtsearch-results-list.ehtsearch-minimal .ehtsearch-add-to-cart button,
.ehtsearch-results-list.ehtsearch-minimal .ehtsearch-add-to-cart a.btn,
.ehtsearch-results-list.ehtsearch-theme-minimal .ehtsearch-add-to-cart button,
.ehtsearch-results-list.ehtsearch-theme-minimal .ehtsearch-add-to-cart a.btn {
    padding: 8px 15px;
    font-size: 12px;
}

/* Modern (Card) */
.ehtsearch-results-list.ehtsearch-theme-modern {
    gap: 30px;
}

.ehtsearch-results-list.ehtsearch-theme-modern .ehtsearch-result-item {
    border: none;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ehtsearch-results-list.ehtsearch-theme-modern .ehtsearch-result-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.ehtsearch-results-list.ehtsearch-theme-modern .ehtsearch-add-to-cart button,
.ehtsearch-results-list.ehtsearch-theme-modern .ehtsearch-add-to-cart a.btn {
    border-radius: 25px;
    /* Rounded buttons */
    font-weight: 700;
    letter-spacing: 1px;
}

/* Compact (Dense) */
.ehtsearch-results-list.ehtsearch-theme-compact {
    gap: 10px;
}

.ehtsearch-results-list.ehtsearch-theme-compact .ehtsearch-result-item {
    padding: 10px;
    border: 1px solid #eee;
}

.ehtsearch-results-list.ehtsearch-theme-compact .product-name {
    font-size: 13px;
    height: 36px;
}

.ehtsearch-results-list.ehtsearch-theme-compact .ehtsearch-add-to-cart {
    margin-top: 5px;
}

.ehtsearch-results-list.ehtsearch-theme-compact .ehtsearch-add-to-cart button,
.ehtsearch-results-list.ehtsearch-theme-compact .ehtsearch-add-to-cart a.btn {
    padding: 5px;
    font-size: 11px;
}

/* Instagram (Visual) */
.ehtsearch-results-list.ehtsearch-theme-instagram .ehtsearch-result-item {
    padding: 0;
    border: none;
    border-radius: 0;
}

.ehtsearch-results-list.ehtsearch-theme-instagram .ehtsearch-product-image {
    height: var(--eht-img-height, 300px);
    /* Use variable with fallback */
    margin-bottom: 0;
    position: relative;
    /* For absolute positioning of button */
}

.ehtsearch-results-list.ehtsearch-theme-instagram .ehtsearch-product-image img {
    object-fit: cover;
}

.ehtsearch-results-list.ehtsearch-theme-instagram .ehtsearch-product-info {
    padding: 10px;
    text-align: left;
}

.ehtsearch-results-list.ehtsearch-theme-instagram .product-name {
    font-weight: normal;
    font-size: 14px;
}

.ehtsearch-results-list.ehtsearch-theme-instagram .product-price-and-shipping {
    font-weight: bold;
    color: #333;
}

/* Instagram Theme: Floating Add to Cart Icon */
.ehtsearch-results-list.ehtsearch-theme-instagram .ehtsearch-add-to-cart {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: auto;
    margin: 0;
    z-index: 3;
    /* Above image */
}

.ehtsearch-results-list.ehtsearch-theme-instagram .ehtsearch-add-to-cart button,
.ehtsearch-results-list.ehtsearch-theme-instagram .ehtsearch-add-to-cart a.btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    display: flex !important;
    /* Force flex */
    align-items: center;
    justify-content: center;
    font-size: 0;
    /* Hide text */
    background: #fff;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    line-height: 1;
    /* Fix vertical centering */
}

.ehtsearch-results-list.ehtsearch-theme-instagram .ehtsearch-add-to-cart button::before,
.ehtsearch-results-list.ehtsearch-theme-instagram .ehtsearch-add-to-cart a.btn::before {
    content: '\e8cc';
    /* Material Icon shopping_cart */
    font-family: 'Material Icons';
    font-size: 20px;
    line-height: 1;
    display: block;
    /* Ensure block for centering */
}

/* Responsive */
@media (max-width: 768px) {
    .ehtsearch-widget {
        max-width: var(--eht-bar-width-tablet, 400px);
    }

    .ehtsearch-widget.ehtsearch-active {
        padding: 10px;
    }

    .ehtsearch-widget.ehtsearch-active .ehtsearch-input-group {
        width: auto;
        margin-right: 0;
        /* Removed margin-right */
        margin-left: 0;
    }

    .ehtsearch-results-list {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    /* Override grid for minimal design on mobile */
    .ehtsearch-results-list.ehtsearch-minimal {
        display: flex !important;
        flex-direction: column !important;
    }

    .ehtsearch-product-image {
        height: var(--eht-img-height-mobile, 120px);
        /* Use mobile variable */
    }

    /* Instagram Theme Mobile Fixes */
    .ehtsearch-results-list.ehtsearch-theme-instagram .ehtsearch-product-image {
        height: 200px;
        /* Fixed height for mobile instagram theme to avoid whitespace */
        margin-bottom: 0;
    }

    .ehtsearch-results-list.ehtsearch-theme-instagram .ehtsearch-product-image img {
        object-fit: cover;
        height: 100%;
        width: 100%;
    }

    .ehtsearch-results-list.ehtsearch-theme-instagram .ehtsearch-attributes {
        margin-top: 5px;
        margin-bottom: 5px;
    }

    /* Mobile Badge Positioning to avoid overlap */
    .ehtsearch-stock-badge {
        top: auto;
        bottom: 5px;
        left: 5px;
        font-size: 10px;
        padding: 2px 6px;
    }

    .ehtsearch-discount-badge {
        font-size: 10px;
        padding: 2px 6px;
        top: 5px;
        right: 5px;
    }
}

@media (max-width: 480px) {
    .ehtsearch-widget {
        max-width: var(--eht-bar-width-mobile, 100%);
    }
}

/* Recommendations Carousel */
.ehtsearch-recommendations {
    margin-bottom: 20px;
}

.ehtsearch-carousel {
    overflow: hidden;
    /* Hide scrollbar */
    width: 100%;
    position: relative;
}

.ehtsearch-carousel-track {
    display: flex;
    gap: 15px;
    width: max-content;
    animation: eht-scroll 30s linear infinite;
}

.ehtsearch-carousel:hover .ehtsearch-carousel-track {
    animation-play-state: paused;
}

@keyframes eht-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.ehtsearch-carousel .ehtsearch-result-item {
    width: 160px;
    /* Fixed width for smooth scroll */
    min-width: 160px;
    flex-shrink: 0;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
}

.ehtsearch-carousel .ehtsearch-product-image {
    height: 120px;
    /* Smaller image for carousel */
}

.ehtsearch-carousel .product-name {
    font-size: 13px;
    height: 36px;
    /* 2 lines */
}

.ehtsearch-carousel .product-price-and-shipping {
    font-size: 14px;
}

/* Correction Message */
.ehtsearch-correction-message {
    padding: 10px 15px;
    background-color: #e3f2fd;
    color: #0d47a1;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
    border-left: 4px solid #2196f3;
}

.ehtsearch-correction-message strong {
    font-weight: bold;
}

/* Main Layout (2 Columns) */
.ehtsearch-main-layout {
    display: flex;
    gap: 20px;
}

.ehtsearch-sidebar {
    width: 250px;
    flex-shrink: 0;
    border-right: 1px solid #eee;
    padding-right: 20px;
    text-align: left;
    /* Force left alignment for filters */
}

.ehtsearch-sidebar-left {
    border-right: 1px solid #eee;
    padding-right: 20px;
    border-left: none;
    padding-left: 0;
}

.ehtsearch-sidebar-right {
    border-left: 1px solid #eee;
    padding-left: 20px;
    border-right: none;
    padding-right: 0;
}

.ehtsearch-content {
    flex-grow: 1;
}

/* Sidebar Position */
.ehtsearch-main-layout.ehtsearch-sidebar-right {
    flex-direction: row-reverse;
}

/* Right Column for Recommendations */
.ehtsearch-sidebar-right-col {
    width: 200px;
    flex-shrink: 0;
    border-left: 1px solid #eee;
    padding-left: 20px;
}

.ehtsearch-sidebar-right-col .ehtsearch-carousel {
    flex-direction: column;
    /* Vertical carousel */
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 80vh;
}

.ehtsearch-sidebar-right-col .ehtsearch-result-item {
    width: 100%;
    max-width: 100%;
    margin-bottom: 15px;
}

/* Vertical Carousel Animation (Left/Right Sidebar) */
.ehtsearch-recommendations-vertical .ehtsearch-carousel {
    height: calc(100vh - 140px);
    /* Fill available height */
    overflow: hidden;
}

.ehtsearch-recommendations-vertical .ehtsearch-carousel-track {
    flex-direction: column;
    width: 100%;
    animation: eht-scroll-vertical 30s linear infinite;
}

@keyframes eht-scroll-vertical {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-50%);
    }
}

.ehtsearch-recommendations-vertical .ehtsearch-result-item {
    width: 100%;
    min-width: 100%;
    margin-bottom: 15px;
}

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
    .ehtsearch-main-layout {
        flex-direction: column;
    }

    .ehtsearch-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding-right: 0;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    .ehtsearch-main-layout.ehtsearch-sidebar-right {
        flex-direction: column;
        /* Stack normally on mobile */
    }

    .ehtsearch-main-layout.ehtsearch-sidebar-right .ehtsearch-sidebar {
        border-left: none;
        border-bottom: 1px solid #eee;
        padding-left: 0;
        padding-bottom: 20px;
    }

    .ehtsearch-sidebar-right-col {
        width: 100%;
        border-left: none;
        border-top: 1px solid #eee;
        padding-left: 0;
        padding-top: 20px;
        margin-top: 20px;
    }

    .ehtsearch-sidebar-right-col .ehtsearch-carousel {
        flex-direction: row;
        /* Horizontal on mobile */
        overflow-x: auto;
        overflow-y: hidden;
        max-height: none;
    }

    .ehtsearch-sidebar-right-col .ehtsearch-result-item {
        min-width: 160px;
        max-width: 160px;
    }

    /* Reset vertical animation on mobile */
    .ehtsearch-recommendations-vertical .ehtsearch-carousel {
        height: auto;
        overflow-x: auto;
    }

    .ehtsearch-recommendations-vertical .ehtsearch-carousel-track {
        flex-direction: row;
        width: max-content;
        animation: eht-scroll 30s linear infinite;
    }

    .ehtsearch-recommendations-vertical .ehtsearch-result-item {
        width: 160px;
        min-width: 160px;
        margin-bottom: 0;
    }
}

/* --- FILTERS (Pills) --- */
.ehtsearch-filter-values {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.ehtsearch-filter-label {
    position: relative;
    cursor: pointer;
    margin: 0;
    user-select: none;
    -webkit-user-select: none;
}

.ehtsearch-filter-label input[type="checkbox"],
.ehtsearch-filter-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
    margin: 0;
}

.ehtsearch-filter-name {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    font-size: 14px;
    color: #555;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ehtsearch-filter-label:hover .ehtsearch-filter-name {
    background-color: #f8f9fa;
    border-color: #ccc;
    color: #333;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ehtsearch-filter-label input:checked+.ehtsearch-filter-name {
    background-color: var(--eht-btn-bg, #2fb5d2);
    color: var(--eht-btn-text, #ffffff);
    border-color: var(--eht-btn-bg, #2fb5d2);
    box-shadow: 0 2px 5px rgba(47, 181, 210, 0.3);
}

.ehtsearch-filter-color {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    display: inline-block;
}

/* --- ICON MODE --- */
.ehtsearch-widget.ehtsearch-icon-mode {
    width: auto;
    max-width: none;
    display: inline-block;
}

.ehtsearch-icon-trigger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    color: #333;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ehtsearch-icon-trigger i {
    font-size: 24px;
}

/* When active in icon mode, it behaves like immersive mode */
.ehtsearch-widget.ehtsearch-icon-mode.ehtsearch-active .ehtsearch-icon-trigger {
    display: none;
}

.ehtsearch-widget.ehtsearch-icon-mode.ehtsearch-active form {
    display: block !important;
}

/* Hide input group background in icon mode when inactive */
.ehtsearch-widget.ehtsearch-icon-mode:not(.ehtsearch-active) .ehtsearch-input-group {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    width: auto;
}

/* Mobile Close Button */
.ehtsearch-mobile-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 15px;
    color: #333;
    height: 100%;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
    margin: 0;
    line-height: 1;
}

.ehtsearch-mobile-close i {
    font-size: 24px;
}

/* Show on mobile/tablet */
@media (max-width: 768px) {
    .ehtsearch-mobile-close {
        display: none;
        /* Hide inline close button */
    }

    /* Show the global close button */
    .ehtsearch-widget.ehtsearch-active .ehtsearch-close-btn {
        display: flex;
    }
}

/* Vision Search Loading View */
.ehtsearch-vision {
    position: relative !important;
    cursor: pointer !important;
    z-index: 99 !important;
}

.ehtsearch-vision-input {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    opacity: 0 !important;
    cursor: pointer !important;
    z-index: 1 !important;
}

.ehtsearch-loading-vision {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    text-align: center;
    color: #666;
}

.ehtsearch-loading-vision i.spin {
    font-size: 48px;
    color: var(--eht-btn-bg, #2fb5d2);
    margin-bottom: 20px;
    animation: eht-spin 1s linear infinite;
}

.ehtsearch-loading-vision p {
    font-size: 18px;
    font-weight: 500;
}

@keyframes eht-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ehtsearch-error {
    text-align: center;
    padding: 30px;
    color: var(--eht-discount, #f44336);
    font-size: 16px;
}