/**
 * Truckac_LayeredNavigation — reactive layered navigation styles
 *
 * These styles complement the existing theme CSS (css/category.css) rather
 * than replace it.  They target the new Vue-specific class names introduced
 * by this module.  Existing Magento class names (filter-options, filter-current,
 * pages, toolbar-products, etc.) are intentionally reused so the site theme's
 * styling continues to apply.
 */

/* ── Filter panel outer container ───────────────────────────────────────── */

.truckac-filter-panel {
    position: relative;
}

/* ── Loading overlay ─────────────────────────────────────────────────────── */

.truckac-filter-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.75);
    z-index: 10;
}

.truckac-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.7);
    z-index: 20;
    min-height: 200px;
}

/* ── Spinner ─────────────────────────────────────────────────────────────── */

.truckac-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #d1d5db;
    border-top-color: #374151;
    border-radius: 50%;
    animation: truckac-spin 0.7s linear infinite;
}

.truckac-spinner--large {
    width: 44px;
    height: 44px;
    border-width: 4px;
}

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

/* ── Skeleton loader ─────────────────────────────────────────────────────── */

.truckac-filter-skeleton {
    padding: 8px 0;
}

.truckac-skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: truckac-shimmer 1.4s infinite;
    border-radius: 4px;
    margin-bottom: 12px;
}

.truckac-skeleton-line--short {
    width: 70%;
}

@keyframes truckac-shimmer {
    to { background-position: -200% 0; }
}

/* ── Filter group ────────────────────────────────────────────────────────── */

.truckac-filter-group {
    border-bottom: 1px solid #e5e7eb;
}

.truckac-filter-group--active > .filter-options-title,
.truckac-filter-group--active > .truckac-filter-title {
    font-weight: 700;
}

.truckac-filter-title {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
}

.truckac-filter-active-count {
    font-size: 10px;
    color: #fff;
    background: #374151;
    border-radius: 50%;
    display: inline-block;
    width: 14px;
    height: 14px;
    text-align: center;
    margin-left: 5px;
    vertical-align: middle;
}
.filter .filter-current {
    margin-bottom: 10px;
}
.filter .filter-current-subtitle:before {
    top: 16px;
}
/* ── Collapsed filter groups ─────────────────────────────────────────────── */

.truckac-filter-options--collapsed {
    display: none;
}

/* ── Filter option label (checkbox row) ──────────────────────────────────── */

.truckac-filter-option-label {
    display: flex;
    align-items: baseline;
    gap: 6px;
    cursor: pointer;
    line-height: 1.4;
    padding: 2px 0;
}

.truckac-filter-checkbox {
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
    accent-color: #374151;
}

/* ── Selected filter option ──────────────────────────────────────────────── */

.truckac-option--selected .filter-label-text {
    font-weight: 700;
}

/* ── Filter search box ───────────────────────────────────────────────────── */

.truckac-filter-search {
    position: relative;
    margin: 6px 0 8px;
}

.truckac-filter-search-input {
    width: 100%;
    padding: 5px 28px 5px 8px;
    font-size: 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-sizing: border-box;
    line-height: 1.4;
}

.truckac-filter-search-input:focus {
    outline: none;
    border-color: #888;
}

.truckac-filter-search-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    color: #888;
}

.truckac-filter-search-clear:hover {
    color: #333;
}

/* ── Show More / Show Less toggle ────────────────────────────────────────── */

.truckac-show-more {
    display: inline-block;
    margin: 10px 0 0;
    padding: 0;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    font-weight: 400;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Disabled filter option (zero matching products) ─────────────────────── */

.truckac-option--disabled .truckac-filter-option-label {
    cursor: default;
    opacity: 0.4;
}

.truckac-option--disabled .truckac-filter-checkbox {
    cursor: default;
}
.hide-disabled-options .truckac-option--disabled {
    display: none;
}
.truckac-no-filters {
    padding: 15px 20px;
}
/* ── Infinite scroll ─────────────────────────────────────────────────────── */

.truckac-scroll-sentinel {
    height: 1px;
}

.truckac-showing-count {
    font-size: 13px;
    color: #666;
    text-align: center;
}

.truckac-load-more-wrap {
    margin: 20px 0 30px;
    text-align: center;
}

.truckac-load-more {
    display: inline-block;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid #25364b;
    border-radius: 3px;
    background: #fff;
    color: #25364b;
    transition: background 0.15s, color 0.15s;
}

.truckac-load-more:hover {
    background: #25364b;
    border: 2px solid #25364b;
    color: #fff;
}

.truckac-end-of-results {
    margin: 20px 0;
    font-size: 13px;
    color: #666;
    text-align: center;
}

/* ── Product grid wrapper (relative so loading overlay positions correctly) ─ */

.truckac-product-grid-wrapper {
    position: relative;
    min-height: 200px;
}

/* ── Toolbar loading state ───────────────────────────────────────────────── */

.truckac-toolbar--loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ── No results ──────────────────────────────────────────────────────────── */

.truckac-no-results {
    padding: 24px;
}

.truckac-no-results ul {
    margin-top: 12px;
    list-style: disc;
    padding-left: 20px;
}

/* ── Error message ───────────────────────────────────────────────────────── */

.truckac-error {
    padding: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    margin: 16px 0;
}

/* ── Product image (Vue-rendered cards) ──────────────────────────────────── */

/* Reuse theme's .product-image-container styles; no new overrides needed.   */
/* Discount badge reuses existing .discount-label class from theme.          */

/* ── Price display ───────────────────────────────────────────────────────── */

/* Vue product cards reuse .price-box, .special-price, .old-price, etc.     */
/* from the theme.  No additional overrides needed here.                     */

/* ── Toolbar bottom ──────────────────────────────────────────────────────── */

.truckac-toolbar--bottom {
    margin-top: 16px;
}

/* ── You Save / Original Price (Vue cards) ───────────────────────────────── */

.truckac-you-save {
    margin: 4px 0 6px;
    font-size: 1.2rem;
    line-height: 1.4;
}

.truckac-you-save .list-price {
    display: block;
    color: #63656A;
}

.truckac-you-save .list-price strong {
    font-weight: 500;
}

.truckac-you-save .list-save {
    display: block;
    color: #F26522;
    font-weight: 500;
}

/* ── Same Day Shipping badge (Vue cards) ─────────────────────────────────── */

.truckac-same-day {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 6px 0 15px;
    color: #001F44;
    font-size: 1.2rem;
    font-weight: 500;
}

.truckac-same-day img {
    flex: 0 0 auto;
    width: 24px !important;
    object-fit: contain;
}

/* ── Card actions: Add to Cart (left) + See Details (right) ──────────────── */

.truckac-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: auto 0 0 !important;
    padding-top: 8px;
}

.truckac-add-to-cart {
    box-sizing: border-box;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 7px 14px;
    border: 1px solid #F26522;
    border-radius: 3px;
    background: #F26522;
    color: #fff !important;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.truckac-add-to-cart:hover,
.truckac-add-to-cart:focus {
    background: #d9531a;
    border-color: #d9531a;
    color: #fff !important;
    text-decoration: none;
}

.truckac-add-to-cart:disabled,
.truckac-add-to-cart[disabled],
.truckac-add-to-cart.disabled {
    opacity: .65;
    cursor: default;
}

/* The native catalogAddToCart widget (carousels) toggles a `disabled` CLASS
   rather than the attribute the Vue cards use, so block clicks while adding. */
.truckac-add-to-cart.disabled {
    pointer-events: none;
}

.truckac-see-details,
.truckac-see-details:visited {
    flex: 0 0 auto;
    color: #001F44;
    font-weight: 500;
    text-decoration: underline;
    white-space: nowrap;
}

.truckac-see-details:hover,
.truckac-see-details:focus {
    color: #F26522;
}

/* Make the card a column so the actions row can pin to the bottom. */
.truckac-product-grid-wrapper .product-item-details {
    display: flex;
    flex-direction: column;
    height: 100%;
}
@media (max-width: 767px) {
    .truckac-card-actions {
        flex-direction: column;
        align-items: flex-start;
        padding-top: 0;
    }
    .truckac-same-day {
        font-size: 1.1rem;
        font-weight: 400;
        margin-bottom: 10px;
    }
    .products-swiper .truckac-same-day {
        font-size: 1rem;
    }
    .truckac-same-day img {
        display: none !important;
    }
    .truckac-add-to-cart {
        min-width: 140px;
    }
    .truckac-see-details {
        font-size: 1.3rem;
    }
}
@media (min-width: 768px) {
    .truckac-card-actions > form {
        flex: 0 1 140px;
    }
    .truckac-add-to-cart {
        width: 100%;
        flex: 0 1 140px;
    }
}

/* ── Compare checkbox on product cards ───────────────────────────────────── */

.truckac-compare-check-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    user-select: none;
}

.truckac-compare-checkbox {
    margin: 0 !important;
    cursor: pointer;
    top: 0 !important;
}

.truckac-compare-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.truckac-compare-checkbox:disabled + .truckac-compare-check-text {
    opacity: 0.45;
}

/* ── Compare tray (sticky bottom bar) ───────────────────────────────────── */

.truckac-compare-tray {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20000;
    background: #25364b;
    color: #fff;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.25);
}

.truckac-compare-tray-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 20px;
}

.truckac-compare-tray-slots {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.truckac-compare-tray-slot {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    border: 1px dashed rgba(255,255,255,0.3);
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 11px;
}

.truckac-compare-tray-slot--filled {
    border-style: solid;
    border-color: rgba(255,255,255,0.5);
}

.truckac-tray-thumb {
    width: 36px;
    height: 36px;
    object-fit: contain;
    background: #fff;
    border-radius: 2px;
    flex-shrink: 0;
}

.truckac-tray-slot-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 11px;
    line-height: 1.3;
}

.truckac-tray-slot-empty {
    color: rgba(255,255,255,0.4);
    font-size: 11px;
}

.truckac-tray-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    color: #25364b;
    border: none;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.truckac-compare-tray-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.truckac-tray-hint {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    margin: 0;
    white-space: nowrap;
}

.truckac-tray-go-btn {
    display: inline-block;
    padding: 8px 18px;
    background: #fff;
    color: #25364b;
    font-size: 13px;
    font-weight: 700;
    border-radius: 3px;
    white-space: nowrap;
    text-decoration: none;
}

.truckac-tray-go-btn:hover {
    background: #e8edf2;
    color: #25364b;
}

.truckac-tray-clear {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.truckac-tray-clear:hover {
    color: #fff;
    border: none;
    background: none;
}

/* Item count line — shown only in the mobile stacked tray layout */
.truckac-tray-count {
    display: none;
}

/* Slide-up transition for the tray */
.truckac-tray-enter-active,
.truckac-tray-leave-active {
    transition: transform 0.25s ease;
}

.truckac-tray-enter-from,
.truckac-tray-leave-to {
    transform: translateY(100%);
}
body:has(.truckac-compare-tray) #google-merchantwidget-iframe-wrapper {
    display: none !important;
}
@media (max-width: 767px) {
    /* Compare is enabled on mobile. Reflow the tray to a Best Buy-style stacked
       layout: a header row (item count + Compare button) on top, then a
       horizontally scrollable strip of the selected thumbnails below.
       (Previously this block hid the tray + card checkboxes on mobile — and, by
       accident of grouping, also applied display:none to <body>.) */
    .truckac-compare-tray-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 8px 12px;
    }

    /* Header row sits above the thumbnails: count on the left, Compare on the right */
    .truckac-compare-tray-actions {
        order: -1;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        gap: 6px;
    }
    .truckac-tray-count {
        display: block;
        font-size: 13px;
        font-weight: 600;
    }
    .truckac-tray-hint {
        white-space: normal;
        flex: 1;
    }
    .truckac-tray-go-btn {
        padding: 10px 22px;
        font-size: 14px;
    }
    .truckac-tray-go-btn-suffix {
        display: none;               /* button reads just "Compare" on mobile */
    }

    /* Thumbnail strip — horizontal scroll, only filled slots */
    .truckac-compare-tray-slots {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 14px;
        padding: 7px 0 2px;
        justify-content: center;
    }
    .truckac-compare-tray-slot {
        flex: 0 0 auto;
        width: 72px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        border: 1px dashed rgba(255, 255, 255, 0.3);
        border-radius: 0;
        padding: 0;
    }
    .truckac-compare-tray-slot--filled {
        border-style: solid;
        border-color: transparent;
    }
    .truckac-tray-thumb {
        width: 56px;
        height: 56px;
    }
    .truckac-tray-slot-name {
        font-size: 10px;
        -webkit-line-clamp: 2;
        text-align: center;
    }
    .truckac-tray-remove {
        top: -6px;
        left: 6px;
        right: auto;                 /* × sits top-left of the thumb, Best Buy-style */
    }

    /* Larger tap target for the card compare toggle now that it's visible */
    .truckac-compare-check-label {
        padding: 4px 0;
        font-size: 14px;
    }
}

/* ── Compare page ────────────────────────────────────────────────────────── */

.truckac-compare-page-wrap {
    padding: 0 0 40px;
}

.truckac-compare-page-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 0 16px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 24px;
}

.truckac-compare-page-title {
    font-size: 30px;
    font-weight: 700;
    font-family: Roboto Condensed, sans-serif;
    text-transform: uppercase;
    margin: 0;
}

.truckac-compare-page-top-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.truckac-compare-back {
    font-size: 13px;
    color: #25364b;
    text-decoration: none;
}

.truckac-compare-back:hover {
    text-decoration: underline;
}

.truckac-compare-clear-all {
    font-size: 13px;
    color: #666;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.truckac-compare-empty-state {
    padding: 40px 0;
    text-align: center;
    color: #555;
}

.truckac-compare-empty-hint {
    margin-top: 8px;
    font-size: 14px;
}

.truckac-compare-browse-link {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 24px;
    background: #25364b;
    color: #fff;
    border-radius: 3px;
    text-decoration: none;
    font-weight: 600;
}

.truckac-compare-table-outer {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.truckac-compare-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}

.truckac-compare-label-col {
    width: 160px;
    min-width: 140px;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    background: #f8f9fa;
    vertical-align: middle;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    left: 0;
    z-index: 1;
}

.truckac-compare-product-col {
    min-width: 200px;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
    font-size: 13px;
    text-align: center;
}

.truckac-compare-product-col--empty {
    background: #fafafa;
    color: #ccc;
}

.truckac-compare-row--header .truckac-compare-label-col,
.truckac-compare-row--header .truckac-compare-product-col {
    vertical-align: top;
    border-bottom: 2px solid #25364b;
}

.truckac-compare-row:nth-child(even) .truckac-compare-product-col,
.truckac-compare-row:nth-child(even) .truckac-compare-label-col {
    background: #f8f9fa;
}

.truckac-compare-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
}

.truckac-compare-remove-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #374151;
    border: none;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.truckac-compare-remove-btn:hover {
    background: #d1d5db;
}

.truckac-compare-img-link {
    display: block;
}

.truckac-compare-product-img {
    width: 140px;
    height: 140px;
    object-fit: contain;
}

.truckac-compare-product-name {
    font-size: 16px;
    font-weight: 500;
    font-family: 'Roboto Condensed';
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.truckac-compare-product-name a {
    color: #25364b;
    text-decoration: none;
}

.truckac-compare-product-name a:hover {
    text-decoration: underline;
}
.truckac-compare-product-card .price-box {
    margin: 0;
}

.truckac-compare-view-btn {
    padding: 7px 16px;
    background: #F26522;
    border: 1px solid #F26522;
    color: #fff !important;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    margin-top: 4px;
    height: 32px;
    box-sizing: border-box;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background-color .15s ease, border-color .15s ease;
}

.truckac-compare-view-btn:hover {
    background: #d9531a;
    border-color: #d9531a;
    color: #fff !important;
    text-decoration: none;
}

.truckac-compare-empty-slot {
    padding: 20px;
    text-align: center;
}

.truckac-compare-add-link {
    font-size: 13px;
    color: #25364b;
    text-decoration: none;
    border: 1px dashed #25364b;
    padding: 8px 12px;
    border-radius: 3px;
    display: inline-block;
}

.truckac-compare-add-link:hover {
    background: #f0f4f8;
}

.truckac-compare-no-attrs {
    padding: 24px;
    text-align: center;
    color: #888;
    font-size: 13px;
}
@media (max-width: 767px) {
    .truckac-compare-label-col {
        width: 80px;
        min-width: 80px;
    }
    .truckac-compare-product-col {
        width: 100px;
        min-width: 80px;
    }
}
