/*==================== AI floating button style start============================*/
.ask-me {
    position: fixed;
    top: auto;
    left: auto;
    right: 40px;
    bottom: 40px;
    display: flex;
    gap: 0;
    justify-content: center;
    align-items: center;
    width: fit-content;
    height: 56px;
    z-index: 9999;
    color: var(--color-first);
    background: linear-gradient(var(--color-white), var(--color-light-blue)) padding-box, linear-gradient(to right, var(--color-first), var(--color-first), var(--color-light-blue-2), var(--color-first-dark)) border-box;
    background-size: 100% 100%, 300% 100%;
    background-position: 0 0, 0 0;
    border: 3px solid transparent;
    animation: borderMove 3s linear infinite;
}

.p2px {
    padding: 2px;
}

@keyframes borderMove {
    0% {
        background-position: 0 0, 0% 0;
    }

    100% {
        background-position: 0 0, 100% 0;
    }
}

.ask-me-input {
    text-align: left;
    width: 140px;
    border: none !important;
    background-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

.ask-me-btn {
    text-align: left;
    cursor: pointer;
    border: none !important;
    background-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    position: relative;
    margin-bottom: 1px;
}

.ask-me-img {
    min-width: 68px;
    width: 68px;
    height: 68px;
    margin-left: -3px;
}

.ask-me-img img,
.ask-me-img video {
    min-width: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    padding: 1px;
    border-radius: 7px !important;
}

/* Ask Stocky floating button â€” Bootstrap tooltip (used site-wide from footer) */
.tooltip.ask-me-tooltip .tooltip-inner {
    max-width: 260px;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #7c3aed, #2563eb);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(79, 70, 229, 0.35);
}

.tooltip.ask-me-tooltip.bs-tooltip-left .tooltip-arrow::before,
.tooltip.ask-me-tooltip.bs-tooltip-auto[data-popper-placement^="left"] .tooltip-arrow::before {
    border-left-color: #4f46e5;
}

.tooltip.ask-me-tooltip.bs-tooltip-right .tooltip-arrow::before,
.tooltip.ask-me-tooltip.bs-tooltip-auto[data-popper-placement^="right"] .tooltip-arrow::before {
    border-right-color: #2563eb;
}

/*==================== AI floating style end============================*/
.cursor-pointer {
    cursor: pointer;
}

.iconSize-30 {
    width: 30px;
    height: 30px;
}

.iconSize-40 {
    width: 40px;
    height: 40px;
}

.iconSize-20 {
    width: 20px;
    height: 20px;
}

.iconSize-16 {
    width: 16px;
    height: 16px;
}

.iconSize-12 {
    width: 12px;
    height: 12px;
}

.stroke-white {
    stroke: var(--color-white);
}

.stroke-second {
    stroke: var(--color-second);
}

.fill-second {
    fill: var(--color-second);
}

.fill-primary {
    fill: #2874f0;
}

/*========== CENTER SEARCH STYLE ===================================*/
.center-search-section {
    width: 100%;
    height: calc(100vh - 108px);
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    flex-direction: column;
    flex-wrap: nowrap;
    overflow: hidden;
    position: relative;
    --ai-input-bottom-gap: 1rem;
    padding-bottom: calc(8.5rem + var(--ai-input-bottom-gap));
}

.search-chat-box {
    flex: 1 1 auto;
    width: 100%;
    max-width: 720px;
    min-height: 0;
    height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.search-chat-box > .search-result-section.div-grow-1 {
    flex: 1 1 auto;
    min-height: 0;
}

.ai-search-bottom-anchor {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: var(--ai-input-bottom-gap);
    width: min(720px, calc(100% - 24px));
    max-width: 720px;
    z-index: 100;
    margin-top: 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-sizing: border-box;
}

.search-box-form {
    margin-top: 0;
    margin-bottom: 0;
}

.search-result-section {
    padding: 24px;
}

.div-grow-1 {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.ai-chat-container {
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: padding-bottom 0.2s ease;
}

.ai-chat-container .right-chat {
    display: flex;
    justify-content: flex-end;
}

.ai-chat-container .right-chat .chat-msg {
    padding: 12px 20px;
    border-radius: 16px 16px 0;
}

.ai-chat-container .left-chat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.ai-chat-container .left-chat .chat-msg {
    padding: 24px;
    border-radius: 16px 0 16px 16px;
}

.ai-chat-container .left-chat .response-icon button {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    background-color: var(--color-light-blue);
    border: none;
    box-shadow: none;
    outline: none;
}

.ai-chat-container .left-chat .chat-msg ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-second);
    display: inline-block;
}

/* =========================================================
SEARCH
========================================================= */



.search-bar {
    width: 100%;
    min-height: 56px;
    height: auto;
    border-radius: 28px;
    background: var(--color-white);
    display: flex;
    align-items: flex-end;
    padding: 10px 8px 10px 20px;
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.14);
}

.search-bar.search-bar-no-upload {
    padding-left: 20px;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    min-height: 1.5rem;
    max-height: 7.5rem;
    resize: none;
    overflow-y: auto;
    line-height: 1.45;
    font-weight: 400;
    font-size: 1rem;
    color: var(--color-text-black, #111);
    word-wrap: break-word;
    white-space: pre-wrap;
    field-sizing: content;
}

.search-input::placeholder {
    color: var(--color-text-content, #828282);
    font-weight: 400;
    font-size: 1rem;
    opacity: 1;
}

/* AI results chat input — override global header .search-input (dark color, fixed height) */
.search-box-form .ai-chat-search-bar.search-bar-transparent {
    background: transparent !important;
    box-shadow: none !important;
    height: auto !important;
    min-height: 2.75rem !important;
    padding: 0.25rem 0.5rem 0.25rem 0.75rem !important;
    align-items: flex-end;
}

.search-box-form #chat-search-input.ai-chat-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    min-height: 1.5rem !important;
    max-height: 10rem !important;
    line-height: 1.5 !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
    color: var(--color-text-black, #111) !important;
    padding: 0 !important;
    margin: 8px 0 !important;
    float: none !important;
    resize: none;
    overflow-y: auto;
    word-wrap: break-word;
    white-space: pre-wrap;
    align-self: center;
}

.search-box-form #chat-search-input.ai-chat-search-input::placeholder {
    color: #828282 !important;
    font-weight: 400 !important;
    font-size: 1rem !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #828282;
}

.search-box-form #chat-search-input.ai-chat-search-input::-webkit-input-placeholder {
    color: #828282;
    font-weight: 400;
}

.search-box-form #chat-search-input.ai-chat-search-input::-moz-placeholder {
    color: #828282;
    font-weight: 400;
    opacity: 1;
}

.search-bar .file-upload-btn.d-none {
    display: none !important;
}

/* =========================================================
AI RESULT PAGE SPECIFIC STYLES
========================================================= */
.search-result-section.div-grow-1 {
    -webkit-mask-image: linear-gradient(to bottom, black 92%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 92%, transparent 100%);
    padding-bottom: var(--ai-bottom-inset, 12rem) !important;
    scroll-padding-bottom: var(--ai-bottom-inset, 12rem) !important;
}

.ai-chat-container .right-chat.ai-latest-prompt {
    scroll-margin-top: 12px;
}

.file-upload-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    flex-shrink: 0;
}

.file-upload-btn:hover {
    color: #000;
}

.chat-refine-popout {
    max-width: 720px;
    margin: 0 auto;
    border-radius: 24px;
    display: none;
}

.chat-refine-popout:has(.filters-row),
.chat-refine-popout:has(.uploaded-file-preview.active),
.chat-refine-popout.is-active,
.chat-refine-popout:has(#preference-card:not(.d-none)),
.chat-refine-popout:has(#ai-loading-indicator:not(.d-none)) {
    display: block;
}

/* =========================================================
   PREFERENCE CARD (dupe-style)
   ========================================================= */
.preference-card {
    background: #fff;
    border-radius: 20px;
    padding: 4px 4px 12px;
    margin-bottom: 8px;
}

.preference-card.d-none {
    display: none !important;
}

.preference-card-title {
    line-height: 1.35;
    padding-right: 8px;
}

.preference-options-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preference-option-btn {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    transition: background-color 0.15s ease;
    cursor: pointer;
}

.preference-option-btn:hover,
.preference-option-btn:focus {
    background-color: #f3f4f6;
    outline: none;
}

.preference-option-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #6b7280;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.preference-option-body {
    flex: 1;
    min-width: 0;
}

.preference-option-desc {
    margin-top: 2px;
    line-height: 1.35;
}

.preference-skip-btn {
    color: #374151;
    background: #fff;
    font-weight: 500;
}

.preference-skip-btn:hover {
    background: #f9fafb;
}

.ai-chat-container .right-chat .chat-msg.bg-color-first {
    background-color: #f3f4f6 !important;
    color: #111 !important;
    border-radius: 20px !important;
    border-bottom-right-radius: 4px !important;
}

.ai-chat-container .right-chat .chat-msg .color-white-same {
    color: #111 !important;
}

/* Selected preferences — single horizontal row (dupe-style) */
.ai-chat-container .ai-preferences-row-wrap {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin: 4px 0 12px;
}

.ai-chat-container .ai-preferences-row-wrap .preference-pills-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    overflow: visible;
    padding: 2px 0;
    scrollbar-width: none;
}

.ai-chat-container .ai-preferences-row-wrap .preference-pills-row::-webkit-scrollbar {
    display: none;
}

.ai-chat-container .preference-pill {
    display: inline-flex;
    flex-shrink: 0;
    max-width: 100%;
    padding: 8px 14px;
    background: #f3f4f6;
    color: #111;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.2;
    border-radius: 999px;
    white-space: normal;
    word-break: break-word;
}

.ai-chat-container .left-chat .chat-msg p {
    max-width: 100%;
}

.ai-chat-container .ai-chat-html p {
    margin-bottom: 0.5rem;
}

.ai-chat-container .ai-chat-html p:last-child {
    margin-bottom: 0;
}

.ai-chat-container .ai-chat-html ul,
.ai-chat-container .ai-chat-html ol {
    margin: 0.35rem 0 0.5rem;
    padding-left: 1.25rem;
}

.ai-chat-container .ai-chat-html li {
    margin-bottom: 0.25rem;
}

.ai-chat-container .ai-products-block {
    width: 100%;
}

.ai-chat-container .ai-products-block .result-section-group {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

.ai-loading-indicator .spinner-border {
    width: 1rem;
    height: 1rem;
}

.filter-chips-container::-webkit-scrollbar {
    display: none;
}

.uploaded-file-preview {
    margin-bottom: 10px;
    padding: 0;
    display: none;
    align-items: center;
    gap: 10px;
    position: relative;
    width: max-content;
}

.uploaded-file-preview.active {
    display: flex;
}

.uploaded-file-preview .img-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
}

.uploaded-file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.uploaded-file-preview .remove-file {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #fff;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    z-index: 11;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.uploaded-file-preview .remove-file:hover {
    background: #f8f9fa;
}

.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.uploading .loader-overlay {
    display: flex;
}

.uploading .remove-file {
    display: none;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

.send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media(max-width:1024px) {
    .search-bar:not(.ai-chat-search-bar) {
        height: 70px;
        padding: 0 12px 0 20px;
    }
}

/* Utility Classes Extracted from Inline Styles */
.img-ratio-3-4 {
    aspect-ratio: 3/4;
}

.img-ratio-1-1 {
    aspect-ratio: 1/1;
    object-fit: cover;
}

.store-avatar {
    width: 20px;
    height: 20px;
    font-size: 10px;
}

.lh-1-3 {
    line-height: 1.3;
}

.max-w-max {
    max-width: max-content;
}

.icon-btn-30 {
    width: 30px;
    height: 30px;
}

.icon-btn-36 {
    width: 36px;
    height: 36px;
}

.chat-refine-box-wrapper {
    max-width: 720px;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.rounded-top-30 {
    border-radius: 30px 30px 0 0;
}

.no-scrollbar {
    scrollbar-width: none;
}

.search-bar-transparent:not(.ai-chat-search-bar) {
    background: transparent !important;
    box-shadow: none !important;
    height: 56px;
    padding: 0;
}

.outline-none {
    outline: none !important;
}

.transition-up {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.transition-up:hover {
    transform: translateY(-6px);
}

.result-section-group {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

.product-item .product_img {
    transition: border-color 0.3s ease;
}

.product-item:hover .product_img {
    border-color: var(--color-first) !important;
}

.custom-modal-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scrollbar-width: none;
}

.custom-modal-tabs::-webkit-scrollbar {
    display: none;
}

/* Modal and Chat UI Components */
.modal-product-img {
    width: 160px;
    height: 160px;
    flex-shrink: 0;
}

.iconSize-16-bg {
    width: 16px;
    height: 16px;
}

.btn-icon-30 {
    width: 30px;
    height: 30px;
}

@media (max-width: 575px) {
    .modal-product-img {
        width: 100px;
        height: 100px;
    }

    .product-item-horizontal {
        gap: 12px !important;
    }

    .product-item-horizontal h4 {
        font-size: 0.9rem !important;
    }

    .product-item-horizontal h3 {
        font-size: 1.25rem !important;
    }
}

@media (max-width: 991px) {
    .center-search-section {
        height: calc(100vh - 70px);
    }

    .search-result-section.div-grow-1 {
        padding-top: 24px !important;
        scroll-padding-top: 24px !important;
        padding-left: 0;
        padding-right: 0;
    }
}

@media(max-width:768px) {
    .search-bar:not(.ai-chat-search-bar) {
        height: 60px;
        padding: 0 12px 0 18px;
    }

    .center-search-section {
        height: calc(100vh - 110px);
        padding: 0;
    }
}

@media(max-width:640px) {
    .search-bar:not(.ai-chat-search-bar) {
        height: 60px;
        padding: 0 10px 0 16px;
        gap: 4px;
    }
}

@media(max-width:480px) {
    .search-bar:not(.ai-chat-search-bar) {
        height: 60px;
        padding: 0 10px 0 14px;
    }
}

@media(max-width:360px) {
    .search-bar:not(.ai-chat-search-bar) {
        height: 60px;
        padding: 0 8px 0 12px;
    }

    .ask-me {
        left: 0;
        right: 0;
        margin: auto;
    }
}

/* AI product results pagination */
.ai-products-grid.is-loading {
    opacity: 0.45;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.ai-products-pagination {
    padding-top: 0.25rem;
}

.ai-products-pagination .pagination {
    gap: 0.35rem;
}

.ai-products-pagination .page-item .page-link {
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-black, #333);
    background: var(--color-white, #fff);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: none;
}

.ai-products-pagination .page-item .page-link:hover:not(:disabled) {
    background: var(--color-light-blue, #f0f4ff);
    border-color: var(--color-first, #0066cc);
    color: var(--color-first, #0066cc);
}

.ai-products-pagination .page-item.active .page-link {
    background: var(--color-first, #0066cc);
    border-color: var(--color-first, #0066cc);
    color: var(--color-white, #fff);
    pointer-events: none;
}

.ai-products-pagination button.page-link {
    cursor: pointer;
}

/* Product card domain + brand (stacked lines) */
.ai-product-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    max-width: 100%;
    line-height: 1.25;
}

.ai-product-meta .ai-product-domain,
.ai-product-meta .ai-product-brand {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-product-meta .ai-product-domain {
    color: var(--color-text-content, #6b7280);
}

.ai-product-meta .ai-product-brand {
    color: var(--color-text-black, #111);
}

.ai-products-block .ai-product-link {
    display: block;
    position: relative;
    z-index: 1;
    pointer-events: auto;
    color: inherit;
}