/**
 * Vertex AI Search Results Handler — Stylesheet
 *
 * These styles supplement the theme's existing product grid CSS.
 * The product cards (.col-item, .product-box, .product-details, etc.)
 * inherit all styling from the onetwotaste theme automatically because
 * we use the same HTML class names.
 *
 * Only additional / override styles are defined here.
 */

/* ─── Spell Correction Banner ──────────────────────────────── */
.vtx-spell-correction {
    background: #fef9e7;
    border: 1px solid #f0d56c;
    border-radius: 4px;
    padding: 10px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #5a4e1c;
}

.vtx-spell-correction a {
    color: #0066cc;
    text-decoration: underline;
}

/* ─── Error Message (admin-only detail) ────────────────────── */
.vtx-admin-error {
    margin-top: 8px;
    color: #999;
}

/* ─── Result Count ─────────────────────────────────────────── */
.vtx-result-count {
    font-size: 14px;
    color: #666;
}

/* ─── Product Grid — ensure cards match FiboSearch layout ──── */

/* v1.19.12: Removed "View Product" button override — theme hides it by default
   and FiboSearch results also don't show it, producing cleaner card alignment.
   The button HTML is still in the markup as a clickable fallback via the theme. */

/* ─── Vendor Name Styling ──────────────────────────────────── */
.product-vendor .vendor-name {
    margin-bottom: 4px;
}

.product-vendor .vendor-link-archive {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
}

.product-vendor .vendor-link-archive:hover {
    color: #333;
}

/* ─── Description Excerpt ──────────────────────────────────── */
.desc .sort-desc {
    font-size: 13px;
    color: #777;
    line-height: 1.5;
    margin-top: 6px;
}

/* ─── Pagination ───────────────────────────────────────────── */
.pagination {
    text-align: center;
    margin: 30px 0;
}

.pagination-list {
    display: inline-flex;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination-list .page-item {
    display: inline-block;
}

.pagination-list .page-link {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.pagination-list .page-item.active .page-link {
    background-color: #e6007e;
    color: #fff;
    border-color: #e6007e;
}

.pagination-list .page-link:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
}

/* ─── Loading State (for AJAX pagination) ──────────────────── */
.vtx-loading {
    text-align: center;
    padding: 40px;
}

.vtx-loading::after {
    content: '';
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #ddd;
    border-top-color: #e6007e;
    border-radius: 50%;
    animation: vtx-spin 0.8s linear infinite;
}

@keyframes vtx-spin {
    to { transform: rotate(360deg); }
}

/* ─── Toolbar — match theme structure ──────────────────────── */
.toolbar-wrapper {
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.toolbar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.toolbar-view {
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-view label {
    font-size: 13px;
    color: #666;
    margin: 0;
}

.toolbar-sort select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
}

/* ─── Sidebar Filter: Common ──────────────────────────────── */
.sidebar-widget .widget-title h2 {
    cursor: pointer;
}

/* ─── Sidebar Filter: Dropdown ────────────────────────────── */
.vtx-filter-dropdown-wrap {
    position: relative;
}

.vtx-filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    color: #333;
    cursor: pointer;
    appearance: auto;
}

.vtx-filter-select:focus {
    border-color: #999;
    outline: none;
}

.vtx-active-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 4px 10px;
    font-size: 13px;
    color: #333;
}

.vtx-filter-remove {
    color: #999;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
}

.vtx-filter-remove:hover {
    color: #c00;
}

.vtx-no-filters {
    font-size: 13px;
    color: #999;
    font-style: italic;
    margin: 0;
}

/* ─── Sidebar Filter: Checkbox Multi-Select ───────────────── */
.vtx-checkbox-filter {
    position: relative;
}

.vtx-filter-checklist {
    list-style: none;
    padding: 0;
    margin: 0 0 10px 0;
    max-height: 220px;
    overflow-y: auto;
}

.vtx-filter-checklist li {
    margin: 0;
    padding: 0;
}

.vtx-filter-checklist label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    font-size: 13px;
    color: #333;
    cursor: pointer;
}

.vtx-filter-checklist label:hover {
    color: #000;
}

.vtx-filter-checklist input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
    accent-color: #e6007e;
}

.vtx-filter-name {
    flex: 1;
}

.vtx-filter-count {
    color: #999;
    font-size: 12px;
}

.vtx-apply-filters {
    display: inline-block;
    padding: 6px 16px;
    background: #e6007e;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.vtx-apply-filters:hover {
    background: #c4006a;
}

.vtx-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

/* ─── v1.19.17: Product grid + image sizing for AJAX cards ── */
/* The theme sets .grid-products to display:grid, which constrains
   the Bootstrap .row wrapper. Override to block so the .col-row
   fills the full container width and row-cols-* classes work. */
.vtx-hash-results .grid-products {
    display: block !important;
}

/* Ensure product images fill their column width in the hash
   results grid, matching the EN template's native WC cards. */
.vtx-hash-results .product-image {
    overflow: hidden;
}

.vtx-hash-results .product-image .product-img {
    width: 100%;
    height: auto;
    display: block;
}

/* ─── v1.19.12: Hash Results Full-Page Layout ────────────── */

/* v1.19.20: Page header now uses theme's native .page-header styling
   (same structure as EN template). Custom overrides removed. */

/* v1.19.20: Separator moved inside .main-col (matching EN structure).
   Theme's native .color-separator CSS now applies automatically.
   Only keep the SVG background-image as fallback in case the theme
   scopes it to its own page-header structure. */
.vtx-hash-results .color-separator {
    background-repeat: repeat-x;
    background-image: url('https://www.12taste.com/wp-content/themes/onetwotaste/assets/images/seperator-new.svg');
}

/* View As grid switching — grid column overrides */
.vtx-hash-results .grid-products.grid-1 .col-item {
    flex: 0 0 100%;
    max-width: 100%;
}
.vtx-hash-results .grid-products.grid-1 .product-box {
    display: flex;
    align-items: center;
    gap: 20px;
}
.vtx-hash-results .grid-products.grid-1 .product-image {
    flex: 0 0 120px;
    max-width: 120px;
}
.vtx-hash-results .grid-products.grid-1 .product-details {
    text-align: left !important;
    flex: 1;
}

.vtx-hash-results .grid-products.grid-2 .col-item {
    flex: 0 0 50%;
    max-width: 50%;
}

.vtx-hash-results .grid-products.grid-3 .col-item {
    flex: 0 0 33.333%;
    max-width: 33.333%;
}

.vtx-hash-results .grid-products.grid-4 .col-item {
    flex: 0 0 25%;
    max-width: 25%;
}

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 991px) {
    .toolbar-inner {
        justify-content: center;
    }

    .toolbar-view {
        display: none;
    }
}

@media (max-width: 767px) {
    .grid-products .col-item {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* v1.19.13: Removed single-column 480px rule.
   Theme uses 2 columns on mobile everywhere (row-cols-2),
   so the 767px rule (50% = 2 cols) now covers all mobile sizes. */
