/**
 * Cataseek Frontend Styles - Fullscreen Redesign
 *
 * @author    gofenice
 * @copyright 2026 gofenice
 */
:root {
    --cataseek-color: #4F46E5;
    --cataseek-color-dark: #4338CA;
    --cataseek-orange: var(--cataseek-color); /* Dynamically updated by JS from dashboard settings */
}
/* === Trigger Button / Icon === */
#cataseek-search-container {
    padding: 10px;
}
#cataseek-search-container.cataseek-position-left {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9999;
    padding: 0;
}
#cataseek-search-container.cataseek-position-right {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    padding: 0;
}
/* Floating styles (FAB) only apply to left/right */
.cataseek-position-left .cataseek-search-btn.cataseek-icon-only,
.cataseek-position-right .cataseek-search-btn.cataseek-icon-only {
    border-radius: 50% !important;
    width: 48px;
    height: 48px;
    justify-content: center;
    background: #fff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
}
.cataseek-position-left .cataseek-search-btn.cataseek-icon-only:hover,
.cataseek-position-right .cataseek-search-btn.cataseek-icon-only:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}
/* Header style - simple icon, no background */
.cataseek-position-header .cataseek-search-btn {
    padding: 8px;
    border-radius: 4px;
}
.cataseek-position-header .cataseek-search-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}
.cataseek-search-btn {
    background: none;
    border: none;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}
.cataseek-search-btn:hover {
    opacity: 0.8;
}
.cataseek-search-text {
    color: inherit;
}
/* === Modal Structure === */
.cataseek-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
}
.cataseek-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    transition: opacity 0.3s;
}
/* Base content is fullscreen for 'large'/full */
.cataseek-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    background: white;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(0.98) translateY(10px);
    display: flex;
    flex-direction: column;
}
.cataseek-modal-active .cataseek-modal-content {
    opacity: 1;
    transform: scale(1) translateY(0);
}
/* Medium Modal size */
.cataseek-modal-medium .cataseek-modal-content {
    width: 90%;
    max-width: 900px;
    height: 85%;
    max-height: 800px;
    margin: auto;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
/* Small Modal size */
.cataseek-modal-small .cataseek-modal-content {
    width: 80%;
    max-width: 600px;
    height: 70%;
    max-height: 600px;
    margin: auto;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
/* For non-fullscreen modals, center them */
.cataseek-modal:not(.cataseek-modal-large) {
    display: flex;
    align-items: center;
    justify-content: center;
}
.cataseek-modal:not(.cataseek-modal-large) .cataseek-modal-overlay {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}
/* === Modal Header === */
.cataseek-modal-header {
    display: flex;
    align-items: center;
    padding: 20px 40px;
    gap: 30px;
    background: #fff;
    z-index: 10;
}
.cataseek-logo-wrapper {
    flex-shrink: 0;
}
.cataseek-logo {
    max-height: 40px;
    width: auto;
}
.cataseek-search-input-wrapper {
    flex: 1;
    max-width: 900px;
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0 15px;
    height: 46px;
}

.cataseek-search-icon {
    color: #999;
    margin-right: 12px;
    flex-shrink: 0;
}
.cataseek-search-input {
    border: none !important;
    background: transparent !important;
    font-size: 16px;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    flex: 1;
    color: #333;
    caret-color: var(--cataseek-color);
}

/* ─── Suggestions Bar — sits between the modal header and the modal body ─── */
.cataseek-suggestions-bar {
    padding: 8px 40px;
    border-bottom: 1px solid #eee;
    background: #fff;
    /* flex row so the pills container stretches to full width */
    display: flex;
    align-items: center;
}
/* ─── Pill Scroll Container ─── */
.cataseek-suggestions-pills {
    flex: 1;              /* fill the full width of the suggestions bar */
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    /* Hide scrollbars cross-browser */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.cataseek-suggestions-pills::-webkit-scrollbar {
    display: none;
}
/* ─── Individual Pill ─── */
.cataseek-suggestion-pill {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    border: 1px solid #d0d0d0;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;
    background: #fafafa;
    color: #222;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-user-select: none;
    user-select: none;
}
.cataseek-suggestion-pill:hover {
    background: #f0f0f0;
    border-color: #aaa;
}
/* Bold prefix = matched characters */
.cataseek-pill-bold {
    font-weight: 700;
}
/* Light suffix = predicted continuation */
.cataseek-pill-light {
    font-weight: 400;
    color: #555;
}
/* Delete button (recent searches only) */
.cataseek-pill-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ddd;
    color: #555;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
    border: none;
    padding: 0;
}
.cataseek-pill-delete:hover {
    background: #bbb;
    color: #111;
}
/* ─── Responsive: reduce visible pill count as screen shrinks ─── */
/* Technique: set a --cataseek-pill-max-w CSS var, pills with index > threshold
   get display:none via nth-child hiding. We use a JS helper to add a class
   to the pills container instead (cleaner than nth-child limits). */
.cataseek-suggestions-pills.cataseek-pills-4 .cataseek-suggestion-pill:nth-child(n+5),
.cataseek-suggestions-pills.cataseek-pills-3 .cataseek-suggestion-pill:nth-child(n+4),
.cataseek-suggestions-pills.cataseek-pills-2 .cataseek-suggestion-pill:nth-child(n+3) {
    display: none;
}
.cataseek-close-btn {
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    color: #666;
    margin-left: 20px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}
.cataseek-close-btn:hover {
    color: #000;
}
/* === Voice Search Button === */
.cataseek-voice-btn {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #999;
    margin-left: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    transition: color 0.2s, background 0.2s;
}
.cataseek-voice-btn:hover {
    color: var(--cataseek-color);
    background: rgba(79, 70, 229, 0.08);
}
.cataseek-voice-btn.cataseek-voice-active {
    color: #ef4444;
    animation: cataseek-voice-pulse 1.2s ease-in-out infinite;
}
@keyframes cataseek-voice-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.08); }
    70%  { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); background: rgba(239, 68, 68, 0.12); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); background: rgba(239, 68, 68, 0.08); }
}
/* === Body Layout === */
.cataseek-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.cataseek-modal-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}
.cataseek-filters {
    width: 280px;
    border-right: 1px solid #eee;
    padding: 30px 40px;
    overflow-y: auto;
    background: #fff;
    flex-shrink: 0;
}
.cataseek-content-area {
    flex: 1;
    padding: 30px 40px;
    overflow-y: auto;
    background: #fff;
}
/* === Filter Styles === */
.cataseek-filter-group {
    margin-bottom: 30px;
}
.cataseek-filters-header-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}
.cataseek-clear-filters-btn {
    background: none;
    border: none;
    color: var(--cataseek-orange, #4F46E5);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}
.cataseek-clear-filters-btn:hover {
    opacity: 0.8;
}
.cataseek-filter-title {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
}
.cataseek-filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.cataseek-filter-item {
    margin-bottom: 12px;
}
.cataseek-filter-label {
    display: flex;
    align-items: center;
    text-align: left;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    transition: color 0.2s;
}
.cataseek-filter-label:hover {
    color: var(--cataseek-color);
}
.cataseek-filter-checkbox {
    width: 18px;
    height: 18px;
    border: 1px solid #ddd;
    border-radius: 4px;
    appearance: none;
    cursor: pointer;
    background: #fff;
}
.cataseek-filter-checkbox:checked {
    background: #fff;
    border-color: #333;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 70% 70%;
    background-position: center;
    background-repeat: no-repeat;
}
.cataseek-filter-count {
    margin-left: auto;
    font-size: 13px;
    color: #999;
}
/* === Price Slider === */
.cataseek-price-slider-container {
    margin-top: 15px;
}
.cataseek-price-range-inputs {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}
.cataseek-price-input-box {
    background: var(--cataseek-orange);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
}
.cataseek-slider-track {
    position: relative;
    width: 100%;
    height: 5px;
    background: #eee;
    border-radius: 3px;
    margin: 25px 0;
}
.cataseek-slider-range {
    position: absolute;
    height: 100%;
    background: var(--cataseek-orange);
    border-radius: 3px;
}
.cataseek-slider-handle {
    position: absolute;
    top: 50%;
    width: 24px;
    height: 24px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.cataseek-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
}
.cataseek-discovery-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}
/* === Results Header === */
.cataseek-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}
.cataseek-results-count {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}
.cataseek-sorting {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cataseek-sorting label {
    font-size: 14px;
    color: #666;
}
.cataseek-sorting select {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    background: #fff;
}
/* === Products Grid === */
.cataseek-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 30px;
}
.cataseek-product-item {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 15px;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}
.cataseek-product-image {
    aspect-ratio: 1;
    margin-bottom: 20px;
    overflow: hidden;
}
.cataseek-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.cataseek-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.cataseek-product-name {
    font-size: 14px;
    color: #333;
    margin: 0 0 15px 0;
    line-height: 1.4;
    height: 40px;
    overflow: hidden;
    text-transform: uppercase;
}
.cataseek-product-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}
.cataseek-price-current {
    font-size: 18px;
    font-weight: 700;
    color: #000;
}
.cataseek-add-to-cart {
    background: var(--cataseek-orange);
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 40px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.cataseek-add-to-cart:hover {
    background: var(--cataseek-color-dark);
}
.cataseek-add-to-cart--done {
    background: #22c55e;
    opacity: 0.85;
    cursor: default;
}
/* === Quantity Stepper (replaces cart button on click) === */
.cataseek-qty-wrapper {
    display: flex;
    align-items: center;
    gap: 3px;
    animation: cataseek-fade-in 0.15s ease;
}
.cataseek-qty-step {
    background: #f0f0f0;
    border: none;
    border-radius: 4px;
    width: 26px;
    height: 30px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: background 0.15s;
    flex-shrink: 0;
    padding: 0;
}
.cataseek-qty-step:hover {
    background: #e0e0e0;
}
.cataseek-qty-input {
    width: 36px;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 13px;
    -moz-appearance: textfield;
    appearance: textfield;
    padding: 0;
}
.cataseek-qty-input::-webkit-inner-spin-button,
.cataseek-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}
.cataseek-qty-confirm {
    background: var(--cataseek-orange);
    color: #fff;
    border: none;
    border-radius: 5px;
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    white-space: nowrap;
}
.cataseek-qty-confirm:hover {
    background: var(--cataseek-color-dark);
}
.cataseek-qty-confirm:disabled {
    opacity: 0.6;
    cursor: wait;
}
/* === Cart Toast === */
.cataseek-cart-toast {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    z-index: 999999;
    pointer-events: none;
    animation: cataseek-toast-in 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.cataseek-cart-toast--success {
    background: #22c55e;
    color: #fff;
}
.cataseek-cart-toast--error {
    background: #ef4444;
    color: #fff;
}
@keyframes cataseek-toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0);   }
}
/* === Skeleton Loaders === */
.cataseek-skeleton {
    background: #f8f8f8;
    background: linear-gradient(90deg, #f8f8f8 25%, #f0f0f0 50%, #f8f8f8 75%);
    background-size: 200% 100%;
    animation: cataseek-shimmer 1.5s infinite;
    border-radius: 4px;
}
@keyframes cataseek-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
.cataseek-skeleton-image {
    width: 100%;
    padding-top: 100%;
    margin-bottom: 20px;
}
.cataseek-skeleton-text {
    height: 16px;
    margin-bottom: 10px;
    width: 90%;
}
.cataseek-skeleton-price {
    height: 24px;
    width: 40%;
}
/* === Scrollbar === */
.cataseek-filters::-webkit-scrollbar,
.cataseek-content-area::-webkit-scrollbar {
    width: 6px;
}
.cataseek-filters::-webkit-scrollbar-thumb,
.cataseek-content-area::-webkit-scrollbar-thumb {
    background: #eee;
    border-radius: 3px;
}
/* === Mobile-only controls (hidden by default, shown only on mobile) === */
#cataseek-mobile-filter-btn {
    display: none;
}
#cataseek-filter-close-btn {
    display: none;
}
/* === Responsive === */
@media (max-width: 768px) {
    .cataseek-modal-main {
        flex-direction: column;
    }
    .cataseek-filters {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 85%;
        max-width: 320px;
        background: #fff;
        z-index: 100000;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 60px 20px 20px;
        border-right: none;
        border-left: 1px solid #eee;
        display: block !important;
        overflow-y: auto;
    }
    .cataseek-filters.cataseek-filters-open {
        transform: translateX(0);
        box-shadow: -5px 0 25px rgba(0,0,0,0.1);
    }
    .cataseek-filter-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99999;
        display: none !important;
    }
    .cataseek-filter-overlay.cataseek-filters-open {
        display: block !important;
    }
    .cataseek-mobile-filter-btn {
        display: none; /* JS will toggle to flex when filters available */
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--cataseek-orange, #4F46E5);
        color: #fff;
        border: none;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
        z-index: 99998;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
    .cataseek-mobile-filter-close {
        display: block; /* Visible inside mobile filter panel */
        position: absolute;
        top: 15px;
        left: 15px; /* Put close on the left side of the right-sliding panel */
        background: none;
        border: none;
        color: #333;
        padding: 5px;
        cursor: pointer;
    }
    .cataseek-logo-wrapper {
        display: none;
    }
    .cataseek-modal-header {
        padding: 15px 20px;
        gap: 10px;
    }
}