/**
 * HBE Pump Selection Experience Styles
 * Enhanced pump selection with collections and advanced filtering
 */

/* Main Container */
#hbe-pump-selection-experience {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin: 20px 0;
}

/* Tip Banner */
.hbe-tip-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #495057;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
    animation: slide-in-down 0.4s ease-out forwards;
}

.hbe-tip-text {
    flex: 1;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 2px;
}

.hbe-tip-text svg {
    color: var(--hbe-purple, #564fa5);
}

.hbe-tip-dismiss {
    background: none;
    border: none;
    color: #868e96;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.hbe-tip-dismiss:hover {
    background: rgba(0,0,0,0.05);
    color: #495057;
}

@media (max-width: 768px) {
    .hbe-tip-banner {
        font-size: 13px;
        padding: 8px 12px;
    }
}

/* Banner animations */
@keyframes slide-in-down {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-out-up {
    from {
        opacity: 1;
        transform: translateY(0);
        max-height: 100px;
        margin-bottom: 20px;
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

/* Current Selection Display */
.hbe-current-selection {
    margin: 20px 0;
    /* Allow box shadows to show - add some padding for shadow space */
}

.hbe-selection-wrapper {
    position: relative;
    min-height: 60px; /* Minimum height for empty state */
}

.hbe-selected-pump-display {
    display: flex;
    flex-direction: column;
    gap: 16px;
    opacity: 0;
    transform: translate3d(0, 20px, 0);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transition-behavior: allow-discrete;
    will-change: opacity, transform;

    &.active {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.hbe-no-selection {
    display: none; /* Hide entirely when nothing selected */
}

.hbe-current-selection {
    display: none; /* Hide the entire selection container by default */

    &.has-selection {
        display: block;
    }
}

.hbe-selected-pump-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    h3 {
        margin: 0;
        color: var(--hbe-purple, #564fa5);
        font-size: 26px !important;
        font-weight: 600;
    }
}

/* Override global CSS with higher specificity */
#hbe-pump-selection .hbe-selected-pump-header h3,
#hbe-pump-selection-experience .hbe-selected-pump-header h3 {
    font-size: 26px !important;
    margin: 0 !important;
    color: var(--hbe-purple, #564fa5) !important;
    font-weight: 600 !important;
}

.hbe-change-selection-btn {
    background: var(--hbe-purple, #564fa5);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;

    &:hover {
        background: color-mix(in srgb, var(--hbe-purple, #564fa5) 90%, black);
        transform: translateY(-1px);
    }
}

.hbe-no-selection {
    text-align: center;
    padding: 20px;

    h3 {
        margin: 0 0 8px 0;
        color: #333;
        font-size: 26px;
        font-weight: 600;
    }

    p {
        margin: 0;
        color: #666;
        font-size: 16px;
    }
}

/* Custom Form Navigation */
.hbe-custom-form-navigation {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #ededed;
    display: flex;
    gap: 10px;
    align-items: center;

    .hbe-custom-next-btn {
        background-color: var(--hbe-purple, #564fa5);
        color: white;
        font-weight: 600;
        padding: 12px 24px;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s ease;

        &:hover {
            background-color: color-mix(in srgb, var(--hbe-purple, #564fa5) 90%, black);
            transform: translateY(-1px);
        }
    }

    .hbe-custom-previous-btn {
        background-color: transparent;
        color: #666;
        border: 2px solid #ededed;
        padding: 12px 24px;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s ease;

        &:hover {
            border-color: #ccc;
            color: #444;
        }
    }

    .hbe-custom-save-btn {
        background-color: transparent;
        color: #666;
        border: none;
        font-size: 14px;
        display: flex;
        align-items: center;
        gap: 5px;
        margin-left: auto;
        cursor: pointer;
        padding: 8px 12px;
        border-radius: 4px;
        transition: all 0.2s ease;

        &:hover {
            color: #333;
            background-color: rgba(0, 0, 0, 0.05);
        }

        svg {
            opacity: 0.7;
        }
    }
}

/* View Toggle */
.hbe-view-toggle {
    display: flex;
    justify-content: center;
    margin: 16px 0;
}

.hbe-view-tabs {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.hbe-view-tab {
    padding: 16px 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;

    &:hover {
        background: rgba(86, 79, 165, 0.1);
        color: var(--hbe-purple, #564fa5);
    }

    &.active {
        background: var(--hbe-purple, #564fa5);
        color: white;
        box-shadow: 0 2px 8px rgba(86, 79, 165, 0.2);
    }
}

/* Collections tab tooltip */
.hbe-view-tab {
    position: relative;
}

.hbe-collections-tooltip {
    position: absolute;
    bottom: -45px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.hbe-collections-tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.9);
}

.hbe-view-tab:hover .hbe-collections-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-2px);
}

/* Hide tooltip when tab is active */
.hbe-view-tab.active .hbe-collections-tooltip {
    display: none;
}

/* New feature indicator for Collections tab */
.hbe-view-tab .hbe-new-indicator {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 8px;
    background: var(--hbe-purple, #564fa5);
    border-radius: 50%;
    box-shadow:
        0 0 4px rgba(86, 79, 165, 0.8),
        0 0 8px rgba(86, 79, 165, 0.6),
        0 0 12px rgba(86, 79, 165, 0.4);
    animation: coloredGlow 1.5s ease-in-out infinite;
}

.hbe-view-tab.active .hbe-new-indicator {
    background: white;
    box-shadow:
        0 0 6px rgba(255, 255, 255, 1),
        0 0 12px rgba(255, 255, 255, 0.8),
        0 0 18px rgba(255, 255, 255, 0.6);
}

@keyframes coloredGlow {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.9;
        box-shadow:
            0 0 4px rgba(86, 79, 165, 0.8),
            0 0 8px rgba(86, 79, 165, 0.6),
            0 0 12px rgba(86, 79, 165, 0.4);
    }

    50% {
        transform: scale(1.3);
        opacity: 1;
        box-shadow:
            0 0 8px rgba(86, 79, 165, 1),
            0 0 16px rgba(86, 79, 165, 0.8),
            0 0 24px rgba(86, 79, 165, 0.6);
    }
}

/* Collections Grid */
.hbe-collections-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-top: 20px;
    max-width: 1200px;
}

/* Mobile-specific collection fixes */
@media (max-width: 768px) {
    .hbe-collection-card {
        padding: 16px;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .hbe-collection-products {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
    }
}

.hbe-collection-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 8px;
    transition: all 0.3s ease;

    &:hover {
        border-color: var(--hbe-purple, #564fa5);
        box-shadow: 0 4px 12px rgba(86, 79, 165, 0.1);
        transform: translateY(-2px);
    }
}

.hbe-collection-header {
    margin-bottom: 16px;
}

.hbe-collection-info {
    h4 {
        margin: 0 0 8px 0;
        color: var(--hbe-purple, #564fa5);
        font-size: 21px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
}

.hbe-collection-collapse-toggle {
    background: none;
    border: none;
    color: var(--hbe-purple, #564fa5);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-left: auto;
    opacity: 0.7;

    &:hover {
        background: rgba(86, 79, 165, 0.1);
        opacity: 1;
        transform: scale(1.1);
    }

    .collapse-icon {
        font-size: 12px;
        line-height: 1;
        font-weight: bold;
    }
}

.hbe-collapsed-count {
    font-size: 14px;
    font-weight: 500;
    color: #888;
    margin-left: 8px;
}

.hbe-collapsed-count-display {
    margin: 8px 0 0 0;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.hbe-collection-card.collapsed {
    .hbe-collection-collapse-toggle {
        .collapse-icon {
            transform: rotate(-90deg);
        }
    }

    .hbe-collection-description,
    .hbe-collection-meta,
    .hbe-collection-products {
        display: none;
    }

    .hbe-collapsed-count-display {
        display: block;
    }
}

.hbe-collection-description {
    margin: 0 0 8px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.hbe-collection-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hbe-collection-count {
    color: #888;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hbe-collection-products {
    display: grid;
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    gap: 20px;
    margin: 20px 0;
    min-width: 0;
    overflow: visible;

    /* Responsive grid columns */
    @media (max-width: 1200px) {
        grid-template-columns: repeat(4, minmax(140px, 1fr));
    }

    @media (max-width: 900px) {
        grid-template-columns: repeat(3, minmax(140px, 1fr));
    }

    @media (max-width: 768px) {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 16px;
    }
}

.hbe-more-products {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    color: #666;
    font-size: 12px;
    font-weight: 500;
    min-height: 200px;
    min-width: 140px;
    max-width: 180px;
    text-align: center;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.hbe-more-products {
    order: 999;
    /* Ensure it always appears last */

    &:hover {
        background: #e9ecef;
        border-color: #adb5bd;
    }
}

/* Override global featured pump ordering in collections */
#hbe-pump-selection .hbe-collection-products .pumpoption.free-option.featured-pump.compact,
#hbe-pump-selection .hbe-collection-products .pumpoption.upgrade-option.featured-pump.compact {
    order: initial !important;
}

/* Collection Toggle Button */
.hbe-collection-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;

    &:hover {
        background: #f8f9fa;
        border-color: #adb5bd;
    }

    .toggle-icon {
        font-size: 14px;
        font-weight: bold;
        line-height: 1;
    }
}

/* Expanded Collection States */
.hbe-collection-card {
    &.expanded {
        background: #f8f9fa;
        border-color: #dee2e6;
    }
}

.hbe-collection-products {
    transition: all 0.3s ease;
    overflow: visible;

    &.expanded {
        grid-template-columns: repeat(5, minmax(160px, 1fr));
        max-height: none;
        overflow: visible;

        /* Responsive grid columns for expanded state */
        @media (max-width: 1200px) {
            grid-template-columns: repeat(4, minmax(140px, 1fr));
        }

        @media (max-width: 900px) {
            grid-template-columns: repeat(3, minmax(140px, 1fr));
        }

        @media (max-width: 768px) {
            grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        }
    }
}

.hbe-view-collection-btn {
    width: 100%;
    background: color-mix(in srgb, var(--hbe-purple, #564fa5) 10%, white);
    color: var(--hbe-purple, #564fa5);
    border: 1px solid var(--hbe-purple, #564fa5);
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;

    &:hover {
        background: var(--hbe-purple, #564fa5);
        color: white;
        transform: translateY(-1px);
    }
}

/* Browse All Section */
.hbe-browse-container {
    margin-top: 20px;
}

.hbe-products-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.hbe-filters-and-sort {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.hbe-filters-container {
    flex: 1;
    min-width: 0;
}

.hbe-filters-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--hbe-purple, #564fa5);
    border: 1px solid var(--hbe-purple, #564fa5);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;

    &:hover {
        background: color-mix(in srgb, var(--hbe-purple, #564fa5) 85%, black);
        border-color: color-mix(in srgb, var(--hbe-purple, #564fa5) 85%, black);
        transform: translateY(-1px);
    }
}

.hbe-filters-icon {
    color: #fff;
    flex-shrink: 0;
}

.hbe-filters-count-badge {
    color: color-mix(in srgb, white 80%, var(--hbe-purple, #564fa5));
    flex-shrink: 0;
}

.hbe-filters-chevron {
    margin-left: auto;
    font-size: 12px;
}

/* Dialog Styles */
.hbe-filters-dialog {
    border: none;
    border-radius: 12px;
    padding: 0;
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    background: white;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
    transition: all 0.3s ease;

    &[open] {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.hbe-filters-dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.hbe-filters-dialog-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.hbe-filters-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, rgba(86, 79, 165, 0.02), rgba(86, 79, 165, 0.05));
}

.hbe-filters-dialog-title {
    display: flex;
    flex-direction: column;
    gap: 4px;

    h3 {
        margin: 0;
        font-size: 20px;
        font-weight: 600;
        color: var(--hbe-purple, #564fa5);
    }
}

.hbe-filters-live-count {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: color 0.3s ease;

    .hbe-live-count-text {
        transition: color 0.3s ease;
    }
}

/* Filter Pills Styles */
.hbe-filter-pills-section {
    margin-bottom: 24px;

    h4 {
        margin: 0 0 16px 0;
        font-size: 16px;
        font-weight: 600;
        color: #333;
    }
}

.hbe-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hbe-filter-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;

    &:hover {
        border-color: var(--hbe-purple, #564fa5);
        background: rgba(86, 79, 165, 0.02);
        color: var(--hbe-purple, #564fa5);
    }

    &.active {
        background: var(--hbe-purple, #564fa5);
        border-color: var(--hbe-purple, #564fa5);
        color: white;

        .hbe-pill-count {
            background: rgba(255, 255, 255, 0.2);
            color: white;
        }
    }
}

.hbe-pill-count {
    background: #f0f0f0;
    color: #666;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.hbe-selected-filters-section {
    margin-bottom: 24px;

    h4 {
        margin: 0 0 16px 0;
        font-size: 16px;
        font-weight: 600;
        color: #333;
    }
}

.hbe-filter-options {
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(86, 79, 165, 0.02);
    border: 1px solid rgba(86, 79, 165, 0.1);
    border-radius: 8px;

    &:last-child {
        margin-bottom: 0;
    }

    h5 {
        margin: 0 0 12px 0;
        font-size: 14px;
        font-weight: 600;
        color: var(--hbe-purple, #564fa5);
    }
}

.hbe-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hbe-filter-option {
    padding: 8px 16px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;

    &:hover {
        border-color: var(--hbe-purple, #564fa5);
        background: rgba(86, 79, 165, 0.05);
        color: var(--hbe-purple, #564fa5);
    }

    &.active {
        background: var(--hbe-purple, #564fa5);
        border-color: var(--hbe-purple, #564fa5);
        color: white;
    }
}

.hbe-active-filters-section {
    margin-bottom: 24px;

    h4 {
        margin: 0 0 16px 0;
        font-size: 16px;
        font-weight: 600;
        color: #333;
    }
}

.hbe-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hbe-active-filter-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(86, 79, 165, 0.1);
    border: 1px solid rgba(86, 79, 165, 0.2);
    border-radius: 16px;
    font-size: 13px;
    color: var(--hbe-purple, #564fa5);
}

.hbe-filter-tag-label {
    font-weight: 500;
}

.hbe-remove-filter {
    background: none;
    border: none;
    color: var(--hbe-purple, #564fa5);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;

    &:hover {
        background: var(--hbe-purple, #564fa5);
        color: white;
    }
}

.hbe-filters-dialog-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    color: #666;

    span {
        pointer-events: none;
    }

    &:hover {
        background: rgba(86, 79, 165, 0.1);
        color: var(--hbe-purple, #564fa5);
    }
}

.hbe-filters-dialog-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.hbe-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.hbe-filters-dialog-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.hbe-clear-filters-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;

    &:hover {
        background: #c82333;
        transform: translateY(-1px);
    }
}

.hbe-apply-filters-btn {
    background: var(--hbe-purple, #564fa5);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;

    &:hover {
        background: color-mix(in srgb, var(--hbe-purple, #564fa5) 85%, black);
        transform: translateY(-1px);
    }
}

/* Prevent body scroll when dialog is open */
body.hbe-filters-dialog-open {
    overflow: hidden;
}

.hbe-sort-controls {
    flex-shrink: 0;
    margin-left: auto;
}

.hbe-sort-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hbe-sort-icon {
    color: var(--hbe-purple, #564fa5);
    flex-shrink: 0;
}

.hbe-sort-select {
    appearance: none;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 8px 32px 8px 12px;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px;

    &:hover {
        border-color: var(--hbe-purple, #564fa5);
        box-shadow: 0 0 0 1px var(--hbe-purple, #564fa5);
    }

    &:focus {
        outline: none;
        border-color: var(--hbe-purple, #564fa5);
        box-shadow: 0 0 0 2px rgba(86, 79, 165, 0.2);
    }
}

.hbe-filter-section {
    display: flex;
    flex-direction: column;
    gap: 4px;

    h4 {
        margin: 0;
        color: #333;
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
}

.hbe-filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;

    &:focus {
        outline: none;
        border-color: var(--hbe-purple, #564fa5);
        box-shadow: 0 0 0 3px rgba(86, 79, 165, 0.1);
    }
}

.hbe-products-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hbe-products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid #e9ecef;
}

.hbe-results-count {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.hbe-sort-select {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.hbe-products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 20px;
    align-items: stretch;
}

.hbe-collection-products {
    display: grid;
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    gap: 20px;
    margin: 20px 0;
    min-width: 0;
    overflow: visible;

    /* Responsive grid columns */
    @media (max-width: 1200px) {
        grid-template-columns: repeat(4, minmax(140px, 1fr));
    }

    @media (max-width: 900px) {
        grid-template-columns: repeat(3, minmax(140px, 1fr));
    }

    @media (max-width: 768px) {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 16px;
    }
}

.hbe-more-products {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    color: #666;
    font-size: 12px;
    font-weight: 500;
    min-height: 100px;
    text-align: center;

    .pumpoption {
        min-width: 120px !important;
        max-width: 150px;
        flex-shrink: 0;
    }
}

/* Pump Cards - Complete replacement styles for our new experience */
#hbe-pump-selection-experience .pumpoption {
    /* Layout */
    display: flex !important;
    flex-direction: column;
    width: 100% !important;
    height: 100%;
    position: relative;

    /* Visual styling from original pumpoption */
    padding: 30px 20px;
    box-shadow: -2px 0px 20px 1px rgba(148, 144, 201, 0.3);
    border-radius: 10px;
    border: 3px solid #ededed;
    background: white;
    transition: all 0.3s ease;
    animation: slideUp 0.5s ease-out forwards;

    &:hover {
        box-shadow: -2px 0px 20px 1px rgba(148, 144, 201, 0.3);
        transform: translateY(-2px);
    }

    &.selected {
        box-shadow: -2px 0px 20px 1px rgba(148, 144, 201, 0.9);
        border: 3px solid #635ea7;
    }

    /* Image styling */
    img {
        aspect-ratio: 1/1;
        object-fit: contain;
        border: 1px solid #ccc;
    }

    /* Typography */
    h3 {
        font-size: 26px !important;
        margin: 0;
        padding: 0;
    }

    .woocommerce {
        display: flex;
        flex-direction: column;
        gap: 8px;
        flex: 1;
        width: 100%;

        p {
            padding-top: 6px;
            margin: 0;

            em {
                font-style: normal;
                text-decoration: line-through;
                color: #888;
            }

            strong.product-price {
                font-family: 'Neucha', handwriting;
                font-size: 20px;
                color: #15c39a;
                display: block;
            }
        }
    }

    /* Enhanced pricing section with inline variant selector */
    .hbe-pricing-section {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        margin-top: 8px;
    }

    .hbe-price-info {
        flex: 1;

        em {
            font-style: normal;
            text-decoration: line-through;
            color: #888;
            font-size: 14px;
            display: block;
        }

        .product-promotional-discount {
            font-size: 12px;
            color: #e74c3c;
            display: block;
            margin: 2px 0;
        }

        strong.product-price {
            font-family: 'Neucha', handwriting;
            font-size: 20px;
            color: #15c39a;
            display: block;
        }
    }

    .hbe-pump-variant-selector {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
    }

    .hbe-variant-label {
        font-size: 12px;
        color: #666;
        text-transform: capitalize;
        font-weight: 500;
        margin: 0;
    }

    .hbe-variant-select {
        padding: 6px 8px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 13px;
        background: white;
        color: #333;
        min-width: 70px;
        cursor: pointer;
        transition: all 0.2s ease;

        &:focus {
            outline: none;
            border-color: var(--hbe-purple, #564fa5);
            box-shadow: 0 0 0 2px rgba(86, 79, 165, 0.1);
        }

        &:hover {
            border-color: #bbb;
        }
    }

    .hbe-pump-actions {
        margin-top: 4px;
    }

    /* Button styling - ensure buttons are at bottom */
    a.button {
        max-height: 40px;
        text-align: center;
        margin: 0;
        margin-top: auto;
        width: 100%;
        padding: 10px 16px;
        border-radius: 4px;
        text-decoration: none;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        -webkit-user-drag: none;
        -moz-user-drag: none;
        user-drag: none;
        pointer-events: auto;
        font-weight: 500;
        transition: all 0.2s ease;

        &:hover {
            background-color: var(--hbe-green, #15c39a);
        }

        &.yith-wcqv-button {
            border-radius: 3px !important;
            color: #444 !important;
            background-color: #eee !important;

            &:hover {
                color: #fff !important;
                background-color: #666 !important;
            }
        }

        &.remove-pump {
            background-color: #888 !important;

            &:hover {
                background-color: #666 !important;
            }
        }
    }

    /* Ordering for free vs upgrade options */
    &.free-option {
        order: 2;

        &.featured-pump {
            order: 1;
        }
    }

    &.upgrade-option {
        order: 4;

        &.featured-pump {
            order: 3;
        }
    }

    /* Compact mode for collection previews */
    &.compact {
        padding: 16px 12px;
        min-width: 140px !important;
        max-width: 180px;
        flex-shrink: 0;
        cursor: pointer;
        transition: all 0.2s ease;
        order: initial !important;
        /* Don't reorder compact cards in collections */

        &:hover {
            transform: translateY(-4px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
            border-color: var(--hbe-purple, #564fa5);

            h3 {
                color: var(--hbe-purple, #564fa5);
            }
        }

        &:active {
            transform: translateY(-2px);
            transition: all 0.1s ease;
        }

        h3 {
            font-size: 18px !important;
            transition: color 0.2s ease;
        }

        .woocommerce p strong.product-price {
            font-size: 16px;
        }

        a.button {
            display: none;
            /* Hide buttons in compact mode */
        }
    }
}

.hbe-pump-image {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 120px;
    background: #f8f9fa;
    border-radius: 6px;
    overflow: visible;

    img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    .placeholder-image {
        color: #999;
        font-size: 12px;
        text-align: center;
    }
}

.hbe-pump-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hbe-pump-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.hbe-pump-pricing {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hbe-pump-msrp {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
}

.hbe-pump-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--hbe-green, #15c39a);
}

.hbe-pump-actions {
    margin-top: auto;
}

.hbe-pump-btn {
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hbe-select-btn {
    background: var(--hbe-purple, #564fa5);
    color: white;

    &:hover {
        background: color-mix(in srgb, var(--hbe-purple, #564fa5) 90%, black);
        transform: translateY(-1px);
    }
}

.hbe-remove-btn {
    background: #dc3545;
    color: white;

    &:hover {
        background: color-mix(in srgb, #dc3545 90%, black);
        transform: translateY(-1px);
    }
}

/* Empty State */
.hbe-empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #666;

    .hbe-empty-icon {
        margin-bottom: 20px;
        color: #ccc;
    }

    h3 {
        margin: 0 0 12px 0;
        color: #333;
        font-size: 26px;
        font-weight: 600;
    }

    p {
        margin: 0 0 24px 0;
        font-size: 16px;
        line-height: 1.5;
        max-width: 400px;
    }

    .hbe-clear-filters-btn {
        background: var(--hbe-purple, #564fa5);
        color: white;
        border: none;
        padding: 12px 24px;
        border-radius: 6px;
        font-size: 16px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;

        &:hover {
            background: color-mix(in srgb, var(--hbe-purple, #564fa5) 90%, black);
            transform: translateY(-1px);
        }
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hbe-browse-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 1024px) {
    .hbe-browse-container {
        grid-template-columns: 180px 1fr;
        gap: 16px;
    }
}

/* Collections grid responsive styles handled above */

.hbe-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.hbe-products-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

.hbe-view-tabs {
    padding: 2px;
}

.hbe-view-tab {
    padding: 10px 16px;
    font-size: 18px;
}

@media (max-width: 480px) {
    #hbe-pump-selection-experience {
        gap: 16px;
        margin: 16px 0;
    }

    .hbe-current-selection {
        padding: 16px;
    }

    .hbe-selected-pump-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .hbe-change-selection-btn {
        align-self: stretch;
        text-align: center;
    }

    .hbe-collection-card,
    .hbe-filters-sidebar {
        padding: 16px;
    }

    .hbe-products-grid {
        grid-template-columns: 1fr;
    }

    .hbe-pump-card {
        padding: 12px;
    }
}

/* Comparison Corner Button (from existing comparison system) */
.pumpoption .hbe-compare-corner {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(150, 150, 150, 0.15);
    border: 1px solid rgba(150, 150, 150, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
}

.pumpoption .hbe-compare-corner .compare-icon {
    color: rgba(100, 100, 100, 0.5);
    width: 16px;
    height: 16px;
    display: block;
}

.pumpoption .hbe-compare-corner:hover {
    background: rgba(86, 79, 165, 0.9);
    border-color: transparent;
    transform: scale(1.1);
}

.pumpoption .hbe-compare-corner:hover .compare-icon {
    color: white;
}

.pumpoption .hbe-compare-corner:hover .compare-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

.pumpoption .hbe-compare-corner.in-comparison {
    background: var(--hbe-green, #15c39a);
    border-color: transparent;
}

.pumpoption .hbe-compare-corner.in-comparison .compare-icon {
    display: none;
}

.pumpoption .hbe-compare-corner.in-comparison .compare-remove-icon {
    display: block;
}

.pumpoption .hbe-compare-corner.show-tooltip-on-load {
    animation: pulse-comparison 2s ease-in-out infinite;
}

#hbe-pump-selection .pumpoption .hbe-compare-corner.tooltip-visible .compare-tooltip {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(-50%) translateY(-8px) !important;
    animation: gentle-float 2.5s ease-in-out infinite;
}

.pumpoption .hbe-compare-corner .compare-remove-icon {
    color: white;
    font-size: 18px;
    font-weight: bold;
    display: none;
    line-height: 1;
}

.pumpoption .hbe-compare-corner .compare-tooltip {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 100;
    min-width: 110px;
    text-align: center;
}

.pumpoption .hbe-compare-corner .compare-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

/* Completely hidden on compact cards */
.pumpoption.compact .hbe-compare-corner {
    display: none !important;
}

/* Pulse animation for first card comparison icon */
@keyframes pulse-comparison {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(86, 79, 165, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(86, 79, 165, 0);
    }
}

/* Gentle float animation for auto-shown tooltips */
@keyframes gentle-float {
    0%, 100% {
        transform: translateX(-50%) translateY(-8px);
    }
    50% {
        transform: translateX(-50%) translateY(-12px);
    }
}

/* Animation for pump cards */
@keyframes slideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
