/**
 * Integral Hockey Product Search Styles
 * Light e-commerce design with grey borders and unified filter styling
 */

/* ===========================================
   DESIGN TOKENS
   =========================================== */
:root {
    /* Colors */
    --search-primary: var(--ihs-primary);
    --search-primary-hover: var(--ihs-primary-hover);
    --search-primary-bg: var(--ihs-primary-bg);
    --search-bg: var(--ihs-white);
    --search-sidebar-bg: var(--ihs-gray-50);
    --search-border: var(--ihs-gray-200);
    --search-text: var(--ihs-gray-900);
    --search-text-light: var(--ihs-gray-500);

    /* Standardized Border Radius */
    --search-radius-sm: 6px;
    --search-radius-md: 10px;
    --search-radius-lg: 12px;
    --search-radius-full: 999px;

    /* Standardized Shadows */
    --search-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --search-shadow-md: 0 4px 12px rgba(0, 140, 210, 0.15);
    --search-shadow-lg: 0 12px 28px rgba(0, 140, 210, 0.25);
}

/* ===========================================
   BASE WRAPPER
   =========================================== */
.ihs-shop-wrapper {
    font-family: var(--ihs-font-family-base);
    color: var(--ihs-gray-900);
    line-height: var(--ihs-line-height-normal);
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    background: transparent;
}

/* Scroll target for "Search Sticks" / "Clear Filters" — offset so it lands
   below any sticky Elementor header instead of right at the viewport edge. */
.ihs-shop-anchor {
    display: block;
    position: relative;
    top: -100px;
    visibility: hidden;
}

.ihs-shop-wrapper * {
    box-sizing: border-box;
}

/* ===========================================
   MAIN LAYOUT
   =========================================== */
.ihs-shop-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    padding-bottom: 60px;
}

/* ===========================================
   FILTERS SIDEBAR
   =========================================== */
.ihs-filters-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 16px;
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.04),
        0 8px 24px rgba(0, 0, 0, 0.06),
        0 24px 56px rgba(0, 0, 0, 0.06);
}

/* Filters section label — sits between store info and filter options */
.ihs-filters-section-label {
    padding: 16px 16px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--search-text);
}

.ihs-filters-section-label::before {
    content: '';
    display: block;
    width: 3px;
    height: 14px;
    background: var(--search-primary);
    border-radius: 2px;
    flex-shrink: 0;
}

/* Filter Sections */
.ihs-filters-body {
    padding: 0;
    background: #ffffff;
    overflow-y: auto;
    flex: 1;
}

.ihs-filter-section {
    padding: 16px;
    border-bottom: 1px solid var(--search-border);
}

.ihs-filter-section:last-child {
    border-bottom: none;
}

.ihs-filter-divider {
    display: none;
}

/* (accordion toggle removed — filters are now always-visible dropdowns) */

/* ─── Dropdown Filters ─────────────────────────────────────────────────── */

.ihs-filter-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--search-primary);
    margin-bottom: 8px;
}

.ihs-filter-select {
    width: 100%;
    padding: 9px 32px 9px 12px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--search-text);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all 0.15s ease;
}

.ihs-filter-select:focus {
    outline: none;
    border-color: var(--search-primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 140, 210, 0.10);
}

.ihs-filter-select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background-color: #f1f5f9;
}

/* Out-of-stock optgroup label */
.ihs-filter-select optgroup[label*="Out of Stock"] {
    color: #9ca3af;
    font-style: italic;
}

.ihs-filter-hint {
    margin: 6px 0 0;
    font-size: 0.75rem;
    color: var(--search-text-light);
    font-style: italic;
}

/* ─── Active Filter Chips ──────────────────────────────────────────────── */

.ihs-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.ihs-active-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: var(--search-primary-bg, #eff8ff);
    border: 1px solid rgba(0, 140, 210, 0.25);
    border-radius: 999px;
    font-size: 0.8125rem;
    color: var(--search-primary);
    line-height: 1;
}

.ihs-active-chip-label {
    font-weight: 700;
}

.ihs-active-chip-remove {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    color: var(--search-primary);
    opacity: 0.7;
    transition: opacity 0.15s;
}

.ihs-active-chip-remove:hover {
    opacity: 1;
}

/* Apply Filter Button */
.ihs-filters-footer {
    padding: 16px;
    border-top: 1px solid var(--search-border);
}

.ihs-apply-filters-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: var(--search-primary);
    border: none;
    border-radius: var(--search-radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--search-bg);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 140, 210, 0.20);
}

.ihs-apply-filters-btn:hover {
    background: var(--search-primary-hover);
    box-shadow: 0 4px 12px rgba(0, 140, 210, 0.30);
    transform: translateY(-1px);
}

.ihs-clear-filters-btn {
    display: block;
    width: 100%;
    padding: 8px 16px;
    margin-top: 8px;
    background: none;
    border: none;
    border-radius: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--search-text-light);
    cursor: pointer;
    transition: color var(--ihs-transition);
    text-decoration: underline;
}

.ihs-clear-filters-btn:hover {
    color: var(--search-text);
}

/* ===========================================
   MAIN CONTENT
   =========================================== */
.ihs-shop-main {
    flex: 1;
    min-width: 0;
}

/* ─── Header Bar (store info + contact / results + sort) ──────────────────
   Replaces the old sidebar store block + separate controls row: a single
   full-width blue bar that shows the selected store and search meta together. */
.ihs-shop-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    padding: 14px 20px;
    background: var(--search-primary);
    border-radius: var(--search-radius-md);
    color: #ffffff;
}

.ihs-shop-header-store {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.ihs-shop-header-store-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ihs-shop-header-store-info svg {
    flex-shrink: 0;
    color: #ffffff;
}

.ihs-shop-header-store-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.2;
}

.ihs-shop-header-store-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.8);
}

.ihs-shop-header-store-name {
    font-size: 1.0625rem;
    font-weight: 800;
}

.ihs-shop-header-contact-btn {
    padding: 10px 18px;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ihs-shop-header-contact-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #ffffff;
    color: #ffffff;
    text-decoration: none;
}

.ihs-shop-header-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: auto;
}

.ihs-shop-stats,
.ihs-shop-stats .ais-Stats {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Sort Dropdown */
.ihs-sort-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
}

.ihs-sort-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.ihs-sort-wrapper .ais-SortBy-select {
    padding: 8px 32px 8px 14px;
    background: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--search-text);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all 0.15s ease;
}

.ihs-sort-wrapper .ais-SortBy-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
}

@media (max-width: 640px) {
    .ihs-shop-header-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .ihs-shop-header-store {
        justify-content: space-between;
    }
    .ihs-shop-header-meta {
        justify-content: space-between;
        margin-left: 0;
    }
}

/* Search Box */
.ihs-shop-search {
    background: var(--search-bg);
}

.ihs-shop-search .ais-SearchBox-form {
    display: flex;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.15s ease;
}

.ihs-shop-search .ais-SearchBox-form:focus-within {
    border-color: var(--search-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 140, 210, 0.10);
}

.ihs-shop-search .ais-SearchBox-input {
    flex: 1;
    padding: 10px 14px 10px 40px;
    border: none;
    background: transparent;
    font-size: 0.9375rem;
    color: var(--search-text);
    box-sizing: border-box;
}

.ihs-shop-search .ais-SearchBox-input:focus {
    outline: none;
}

.ihs-shop-search .ais-SearchBox-input::placeholder {
    color: var(--search-text-light);
}

.ihs-shop-search .ais-SearchBox-submit,
.ihs-shop-search .ais-SearchBox-reset {
    padding: 12px 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--search-text-light);
    flex-shrink: 0;
}

.ihs-shop-search .ais-SearchBox-submit:hover,
.ihs-shop-search .ais-SearchBox-reset:hover {
    color: var(--search-primary);
}

/* View Toggle */
.ihs-view-controls {
    display: none;
}

.ihs-view-btn {
    padding: 8px;
    background: var(--ihs-gray-100);
    border: 1px solid var(--ihs-gray-200);
    border-radius: var(--search-radius-sm);
    cursor: pointer;
    color: var(--search-text-light);
    transition: all var(--ihs-transition);
}

.ihs-view-btn:hover {
    border-color: var(--ihs-gray-400);
    color: var(--search-text);
}

.ihs-view-btn.active {
    background: var(--search-text);
    border-color: var(--search-text);
    color: var(--search-bg);
}

/* Map Container */
.ihs-map-container {
    display: none;
}

.ihs-map {
    display: none;
}

/* ===========================================
   PRODUCT GRID
   =========================================== */
.ihs-product-grid {
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    box-sizing: border-box;
}

.ihs-product-grid .ais-Hits-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.ihs-product-grid .ais-Hits-item {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
}

/* Product Card — bento tile (rendered as <a>, whole card is clickable) */
.ihs-product-card {
    background: var(--search-bg) !important;
    border: 1px solid var(--search-border);
    border-radius: var(--search-radius-lg);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.ihs-product-card,
.ihs-product-card * {
    background-color: inherit;
}

.ihs-product-card:nth-child(even) {
    background: var(--search-bg) !important;
}

.ihs-product-card:nth-child(odd) {
    background: var(--search-bg) !important;
}

.ihs-product-card:hover {
    transform: translateY(-2px);
    box-shadow:
        inset 3px 0 0 var(--search-primary),
        0 2px 6px rgba(0, 0, 0, 0.08),
        0 8px 24px rgba(0, 140, 210, 0.12);
    border-color: var(--search-primary);
    background: var(--search-bg) !important;
}

/* Nearby-search card: not a link — hover reveals an Inquire overlay instead,
   since this stock is at a different store than the shopper's selected one. */
.ihs-product-card-nearby {
    position: relative;
    cursor: default;
}

.ihs-product-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.72);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.ihs-product-card-nearby:hover .ihs-product-card-overlay {
    opacity: 1;
    pointer-events: auto;
}

.ihs-product-card-inquire-btn {
    padding: 12px 20px;
    background: var(--search-primary);
    border-radius: var(--search-radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: background 0.15s ease;
}

.ihs-product-card-inquire-btn:hover {
    background: var(--search-primary-hover);
    color: #ffffff;
    text-decoration: none;
}

/* Touch devices have no hover — always show the overlay for nearby cards */
@media (hover: none) {
    .ihs-product-card-overlay {
        opacity: 1;
        pointer-events: auto;
        background: rgba(15, 23, 42, 0.55);
    }
}

.ihs-product-image {
    aspect-ratio: 4 / 3;
    background: #f8fafc;
    border-radius: var(--search-radius-lg) var(--search-radius-lg) 0 0;
    overflow: hidden;
    flex-shrink: 0;
}

.ihs-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ihs-product-image-placeholder {
    color: var(--ihs-gray-300);
}

.ihs-product-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.ihs-product-name {
    margin: 0 0 4px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--search-text);
    line-height: 1.4;
}

.ihs-product-attrs {
    margin: 0 0 10px;
    font-size: 0.78rem;
    color: var(--search-text-light);
    line-height: 1.4;
}

.ihs-product-name a {
    color: inherit;
    text-decoration: none;
}

.ihs-product-name a:hover {
    color: var(--search-primary);
}


.ihs-product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--ihs-gray-100);
}

.ihs-product-current-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--search-text);
}

.ihs-product-original-price {
    font-size: 1rem;
    color: var(--search-text-light);
    text-decoration: line-through;
}

.ihs-product-discount {
    padding: 2px 8px;
    background: #fee2e2;
    border-radius: var(--search-radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
    color: #dc2626;
}

.ihs-product-location {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--ihs-gray-100);
    font-size: 0.75rem;
    color: var(--search-text);
}

.ihs-product-location svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.ihs-product-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.ihs-stock-badge,
.ihs-condition-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--search-radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.ihs-stock-badge {
    border: 1px solid transparent;
}

.ihs-stock-badge.ihs-in-stock {
    background: #dcfce7;
    color: #15803d;
}

.ihs-stock-badge.ihs-out-of-stock {
    background: #f3f4f6;
    color: #6b7280;
}

.ihs-condition-badge {
    background: #f3f4f6;
    color: #6b7280;
}

/* ===========================================
   PAGINATION
   =========================================== */
.ihs-pagination {
    margin-top: 40px;
}

.ihs-pagination .ais-Pagination-list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.ihs-pagination .ais-Pagination-item {
    display: inline-block;
}

.ihs-pagination .ais-Pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    background: var(--search-bg);
    border: 1px solid var(--search-border);
    border-radius: var(--search-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--search-text);
    text-decoration: none;
    transition: all var(--ihs-transition);
}

.ihs-pagination .ais-Pagination-link:hover {
    border-color: var(--ihs-gray-400);
}

.ihs-pagination .ais-Pagination-item--selected .ais-Pagination-link {
    background: var(--search-text);
    border-color: var(--search-text);
    color: var(--search-bg);
}

.ihs-pagination .ais-Pagination-item--disabled .ais-Pagination-link {
    opacity: 0.4;
    cursor: not-allowed;
}

.ihs-pagination .ais-Pagination-item--previousPage .ais-Pagination-link,
.ihs-pagination .ais-Pagination-item--nextPage .ais-Pagination-link {
    padding: 8px 16px;
}

/* ===========================================
   STORE SELECTION PROMPT
   =========================================== */
/* Store prompt overlay — styles live in public-forms.css (.ihs-form-gate-*) */
#ihs-store-prompt-overlay {
    padding: var(--ihs-space-xl, 32px) var(--ihs-space-md, 16px);
}

/* ===========================================
   NEARBY (COUNTRY-WIDE) SEARCH BANNER
   =========================================== */
.ihs-nearby-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: var(--search-bg, #f9fafb);
    border: 1px solid var(--search-border, #e5e7eb);
    border-radius: var(--search-radius-sm, 6px);
    font-size: 0.875rem;
    color: var(--search-text, #374151);
}

.ihs-nearby-banner .ihs-no-results-btn {
    padding: 8px 16px;
    margin: 0;
}

/* ===========================================
   NO RESULTS ACTIONS
   =========================================== */
.ihs-no-results-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.ihs-no-results-btn {
    padding: 12px 24px;
    background: var(--search-bg);
    border: 1px solid var(--search-border);
    border-radius: var(--search-radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--search-text);
    cursor: pointer;
    transition: all var(--ihs-transition);
}

.ihs-no-results-btn:hover {
    border-color: var(--ihs-gray-400);
    background: var(--ihs-gray-50);
}

.ihs-no-results-btn.ihs-nearby-btn {
    background: var(--search-primary);
    border-color: var(--search-primary);
    color: var(--search-bg);
}

.ihs-no-results-btn.ihs-nearby-btn:hover {
    background: var(--search-primary-hover);
    border-color: var(--search-primary-hover);
}

.ihs-no-results-btn.ihs-contact-btn {
    color: var(--search-text);
}


/* ===========================================
   NO RESULTS
   =========================================== */
.ihs-no-results {
    text-align: center;
    padding: 60px 24px;
    background: var(--ihs-gray-50);
    border-radius: var(--search-radius-lg);
}

.ihs-no-results-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    color: var(--ihs-gray-300);
}

.ihs-no-results h3 {
    margin: 0 0 8px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--search-text);
}

.ihs-no-results p {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--search-text-light);
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 1024px) {
    .ihs-product-grid .ais-Hits-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ihs-shop-layout {
        flex-direction: column;
    }

    .ihs-filters-sidebar {
        width: 100%;
        position: static;
    }

    .ihs-product-grid .ais-Hits-list {
        grid-template-columns: 1fr;
    }
}

/* ===========================================
   ALGOLIA OVERRIDES
   =========================================== */
.ihs-shop-wrapper .ais-Hits-list {
    display: grid !important;
}

.ihs-shop-wrapper .ais-Hits-item {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ais-SearchBox-loadingIndicator {
    display: none;
}

/* Hide current refinements (we handle this differently) */
#current-refinements {
    display: none !important;
}
