/* ============================================
   CATEGORIES V2 LAYOUT
   Horizontal Goals Bar + Full-Width Filter Bar
   No sidebar — full-width plant grid
   ============================================ */

/* ---- OVERRIDE: Remove sidebar layout ---- */
.v2-layout .app-layout {
    display: block; /* Override flex sidebar+content layout */
}

.v2-layout .filter-sidebar {
    display: none !important; /* Hide the old sidebar completely */
}

.v2-layout .sidebar-overlay {
    display: none !important;
}

/* Hide the old nav bar (replaced by v2-header-nav) */
.v2-layout .nav#nav {
    display: none !important;
}

/* Hide the old desktop header text */
.v2-layout .header-text {
    display: none !important;
}

/* Hide old mobile filter button (replaced by v2 filter bar) */
.v2-layout .mobile-filter-btn {
    display: none !important;
}

/* Hide the original search section (we have v2 search in header) */
.v2-layout .search-section {
    display: none !important;
}

/* Hide welcome panel (can re-enable later) */
.v2-layout #welcomePanel {
    display: none !important;
}

.v2-layout .content-area {
    margin-left: 0 !important;
    max-width: 100%;
}

/* ---- V2 HEADER: Two-row layout ---- */
.v2-layout .main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-header, rgba(255,255,255,0.95));
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--border-light, #e2e5ea);
    padding: 0;
}

.v2-header-top {
    display: flex;
    align-items: center;
    padding: 10px clamp(14px, 3vw, 32px);
    gap: 20px;
    max-width: 1700px;
    margin: 0 auto;
    width: 100%;
}

.v2-header-top .header-logo-link {
    flex-shrink: 0;
}

.v2-search-bar {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 9999px;
    padding: 10px 20px;
    gap: 10px;
    flex: 1;
    border: 2px solid var(--border-light, #e2e5ea);
    transition: all 0.25s ease;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,61,1,0.06);
}

.v2-search-bar:focus-within {
    border-color: var(--primary, #00b83d);
    box-shadow: 0 0 20px rgba(0,184,61,0.12), 0 2px 12px rgba(0,184,61,0.08);
}

.v2-search-bar svg {
    width: 20px;
    height: 20px;
    color: var(--grey-400, #9ba1ab);
    flex-shrink: 0;
}

.v2-search-bar input {
    border: none;
    background: none;
    font-family: 'Mulish', sans-serif;
    font-size: 0.92rem;
    color: var(--text-primary, #1a1e25);
    outline: none;
    width: 100%;
}

.v2-search-bar input::placeholder {
    color: var(--grey-400, #9ba1ab);
}

.v2-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.v2-icon-link {
    position: relative;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.v2-icon-img {
    width: 24px;
    height: 24px;
}

.v2-cart-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background: var(--primary, #00b83d);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.v2-auth-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary, #5a6272);
    text-decoration: none;
    white-space: nowrap;
}

.v2-search-icon {
    color: var(--grey-400, #9ba1ab);
}

.v2-header-nav {
    display: flex;
    gap: 0;
    padding: 0 clamp(14px, 3vw, 32px);
    border-top: 1px solid rgba(0,0,0,0.06);
    max-width: 1700px;
    margin: 0 auto;
    width: 100%;
}

.v2-header-nav a {
    padding: 8px 16px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary, #5a6272);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
}

.v2-nav-brand {
    font-weight: 700 !important;
    font-size: 0.88rem !important;
    color: var(--primary, #00b83d) !important;
    margin-right: auto;
    border-bottom: none !important;
    letter-spacing: -0.01em;
}

.v2-nav-brand:hover {
    color: var(--primary-dark, #003d01) !important;
    border-bottom: none !important;
}

.v2-header-nav a:hover {
    color: var(--primary-dark, #003d01);
    border-bottom-color: rgba(0,184,61,0.15);
}

.v2-header-nav a.active {
    color: var(--primary-dark, #003d01);
    border-bottom-color: var(--primary, #00b83d);
    font-weight: 600;
}

/* ---- V2 MAIN CONTAINER ---- */
.v2-main-container {
    max-width: 1700px;
    margin: 0 auto;
    padding: 0 clamp(14px, 3vw, 32px);
    position: relative;
    z-index: 1;
}

/* ---- GOALS BAR ---- */
.v2-goals-bar {
    padding: 20px 0 12px;
}

.v2-goals-bar-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
}

.v2-goals-bar-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--primary-dark, #003d01);
    font-style: italic;
}

.v2-see-all-btn {
    font-size: 0.78rem;
    font-weight: 600;
    color: #008a2e;
    cursor: pointer;
    border: none;
    background: none;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.v2-see-all-btn:hover {
    text-decoration: underline;
}

.v2-goals-scroll-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.v2-goals-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    flex: 1;
    min-width: 0;
}

.v2-goals-scroll::-webkit-scrollbar {
    display: none;
}

.v2-goals-scroll.wrapped {
    flex-wrap: wrap;
    overflow-x: visible;
}

.v2-scroll-arrow {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: white;
    border: 1px solid var(--border-light, #e2e5ea);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-secondary, #5a6272);
    box-shadow: 0 1px 3px rgba(0,61,1,0.06);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.v2-scroll-arrow:hover {
    background: var(--grey-50, #f8f9fa);
    box-shadow: 0 4px 12px rgba(0,61,1,0.08);
    color: var(--primary-dark, #003d01);
}

/* Goal cards — reuse existing .goal-btn styles where possible */
.v2-goal-card {
    flex: 0 0 auto;
    width: 130px;
    padding: 14px 12px;
    background: rgba(255,255,255,0.92);
    border: 1.5px solid var(--border-light, #e2e5ea);
    border-radius: 16px;
    cursor: pointer;
    text-align: center;
    transition: all 0.25s ease;
    scroll-snap-align: start;
    position: relative;
    font-family: 'Mulish', sans-serif;
}

.v2-goal-card:hover {
    border-color: var(--primary, #00b83d);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,61,1,0.08), 0 0 0 1px rgba(0,184,61,0.15);
}

.v2-goal-card.selected {
    border-color: var(--primary, #00b83d);
    background: rgba(0,184,61,0.18);
    box-shadow: 0 4px 12px rgba(0,184,61,0.2);
}

.v2-goal-card.selected::after {
    content: '\2713';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.6rem;
    font-weight: 700;
    color: white;
    background: var(--primary, #00b83d);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.v2-goal-card.active-hidden::before {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary, #00b83d);
}

.v2-goal-card-icon {
    font-size: 1.6rem;
    margin-bottom: 6px;
    display: block;
}

.v2-goal-card-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary, #1a1e25);
    line-height: 1.25;
}

.v2-goal-card.selected .v2-goal-card-name {
    color: var(--primary-dark, #003d01);
}

/* ---- REFINEMENT STRIP ---- */
.v2-refinement-strip {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.25s ease;
    background: linear-gradient(135deg, rgba(0,184,61,0.08), rgba(112,255,160,0.04));
    border-radius: 10px;
    margin-bottom: 0;
}

.v2-refinement-strip.visible {
    max-height: 120px;
    padding: 12px 16px;
    opacity: 1;
    margin-bottom: 12px;
    border: 1px solid rgba(0,184,61,0.15);
}

.v2-refinement-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.v2-refinement-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.v2-refinement-dot {
    width: 8px;
    height: 8px;
    background: var(--primary, #00b83d);
    border-radius: 50%;
    flex-shrink: 0;
}

.v2-refinement-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-dark, #003d01);
}

.v2-refinement-dismiss {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0,184,61,0.15);
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.7rem;
    color: var(--grey-400, #9ba1ab);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.v2-refinement-dismiss:hover {
    border-color: var(--grey-300, #c4c8ce);
    color: var(--text-primary, #1a1e25);
}

.v2-refinement-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.v2-refinement-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-dark, #003d01);
    background: rgba(0,184,61,0.25);
    border: 1px solid rgba(0,184,61,0.3);
    border-radius: 9999px;
    animation: v2ChipIn 0.25s ease-out both;
}

.v2-refinement-chip .remove {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: var(--primary, #00b83d);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.v2-refinement-chip .remove:hover {
    background: var(--primary, #00b83d);
    color: white;
}

@keyframes v2ChipIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

/* ---- FILTER BAR ---- */
.v2-filter-bar-wrapper {
    position: relative;
    z-index: 50;
    border-bottom: 1px solid var(--border-light, #e2e5ea);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 0;
}

.v2-filter-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex: 1;
    min-width: 0;
}

/* Plant Type appears before Zone: In Stock → Plant Type → Zone → rest */
#v2FilterButtons {
    display: contents; /* children participate in parent flex layout */
}
.v2-filter-bar > .v2-stock-toggle { order: 0; }
#v2FilterButtons > :first-child { order: 1; } /* Plant Type (first filter) */
.v2-filter-bar > .v2-filter-dropdown:has(#v2ZoneBtn) { order: 2; } /* Zone */
#v2FilterButtons > :not(:first-child) { order: 3; } /* Remaining filters */

.v2-filter-bar::-webkit-scrollbar {
    display: none;
}

.v2-filter-bar.wrapped {
    flex-wrap: wrap;
    overflow-x: visible;
}

/* In Stock / All Plants — iOS-style segmented toggle */
.v2-stock-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 3px;
    background: #eef0f3;
    border: 1px solid var(--border-light, #e2e5ea);
    border-radius: 9999px;
    cursor: pointer;
    flex-shrink: 0;
    user-select: none;
}

.v2-stock-segment {
    position: relative;
    z-index: 1;
    padding: 5px 14px;
    font-family: 'Mulish', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary, #5a6272);
    border-radius: 9999px;
    transition: color 0.2s ease;
    white-space: nowrap;
    text-align: center;
}

/* Slider — white pill behind the active segment */
.v2-stock-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 50%;
    height: calc(100% - 6px);
    background: white;
    border-radius: 9999px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.06);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

/* Default state: "All Plants" is active (slider on left) */
.v2-stock-segment[data-value="all"] {
    color: var(--text-primary, #1a1d23);
}

/* Active state: "In Stock" is active (slider moves right, turns green) */
.v2-stock-toggle.active .v2-stock-slider {
    transform: translateX(100%);
    background: var(--primary, #00b83d);
    box-shadow: 0 1px 4px rgba(0,184,61,0.3);
}

.v2-stock-toggle.active .v2-stock-segment[data-value="all"] {
    color: var(--text-secondary, #5a6272);
}

.v2-stock-toggle.active .v2-stock-segment[data-value="instock"] {
    color: white;
}

/* USDA Zone selector in filter bar */
.v2-zone-selector {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    white-space: nowrap;
}

.v2-zone-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary, #5a6272);
}

.v2-zone-select {
    padding: 6px 10px;
    font-family: 'Mulish', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary, #1a1e25);
    background: white;
    border: 1.5px solid var(--border-light, #e2e5ea);
    border-radius: 9999px;
    cursor: pointer;
    outline: none;
    transition: all 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
    padding-right: 24px;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239ba1ab' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.v2-zone-select:focus {
    border-color: var(--primary, #00b83d);
}

/* Filter dropdown */
.v2-filter-dropdown {
    position: relative;
    flex-shrink: 0;
}

.v2-filter-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-family: 'Mulish', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary, #5a6272);
    background: white;
    border: 1.5px solid var(--border-light, #e2e5ea);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.v2-filter-dropdown-btn:hover {
    border-color: var(--primary, #00b83d);
    color: var(--primary-dark, #003d01);
}

.v2-filter-dropdown-btn.has-selection {
    background: rgba(0,184,61,0.08);
    border-color: rgba(0,184,61,0.15);
    color: var(--primary-dark, #003d01);
}

.v2-filter-dropdown-btn.open {
    border-color: var(--primary, #00b83d);
    color: var(--primary-dark, #003d01);
}

.v2-filter-dropdown-btn .chevron {
    font-size: 0.55rem;
    transition: transform 0.15s ease;
}

.v2-filter-dropdown-btn.open .chevron {
    transform: rotate(180deg);
}

.v2-filter-dropdown-btn .count-badge {
    background: var(--primary, #00b83d);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Toggle chip (for Fragrant, Edibles) */
.v2-toggle-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-family: 'Mulish', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary, #5a6272);
    background: white;
    border: 1.5px solid var(--border-light, #e2e5ea);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.v2-toggle-chip.selected {
    color: var(--primary-dark, #003d01);
    background: rgba(0,184,61,0.08);
    border-color: var(--primary, #00b83d);
}

/* Dropdown panel — position: fixed to escape overflow clipping */
.v2-dropdown-panel {
    position: fixed;
    min-width: 220px;
    max-width: 340px;
    background: white;
    border: 1px solid var(--border-light, #e2e5ea);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,61,1,0.12);
    padding: 12px;
    z-index: 500;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    max-height: 380px;
    overflow-y: auto;
    display: none;
}

.v2-dropdown-panel.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    display: block;
}

.v2-dropdown-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.v2-dropdown-pill {
    padding: 8px 14px;
    font-family: 'Mulish', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary, #5a6272);
    background: var(--grey-50, #f8f9fa);
    border: 1.5px solid var(--border-light, #e2e5ea);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
}

.v2-dropdown-pill:hover {
    border-color: var(--primary, #00b83d);
    color: var(--primary-dark, #003d01);
}

.v2-dropdown-pill.selected {
    background: var(--primary, #00b83d);
    border-color: var(--primary, #00b83d);
    color: white;
    font-weight: 600;
}

.v2-dropdown-footer {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.v2-dropdown-clear {
    flex: 1;
    padding: 8px;
    font-family: 'Mulish', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--grey-500, #6c737e);
    background: var(--grey-50, #f8f9fa);
    border: 1px solid var(--border-light, #e2e5ea);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.v2-dropdown-clear:hover {
    color: #e53424;
    border-color: rgba(229,52,36,0.3);
    background: rgba(229,52,36,0.04);
}

.v2-dropdown-done {
    flex: 1;
    padding: 8px;
    font-family: 'Mulish', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: white;
    background: var(--primary, #00b83d);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.v2-dropdown-done:hover {
    background: var(--primary-dark, #003d01);
}

/* Filter bar "See all" button — sits outside scroll area */
.v2-filter-see-all {
    flex-shrink: 0;
    padding: 7px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary, #00b83d);
    border: none;
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
    border-left: 1px solid var(--border-light, #e2e5ea);
    margin-left: 4px;
}

.v2-filter-see-all:hover {
    text-decoration: underline;
}

/* ---- RESULTS INFO ROW ---- */
.v2-results-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    flex-wrap: wrap;
    gap: 8px;
}

.v2-active-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    align-items: center;
}

.v2-active-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-dark, #003d01);
    background: rgba(0,184,61,0.22);
    border: 1px solid rgba(0,184,61,0.3);
    border-radius: 9999px;
    animation: v2ChipIn 0.2s ease-out;
}

.v2-active-chip .remove {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: var(--primary, #00b83d);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.v2-active-chip .remove:hover {
    background: var(--primary, #00b83d);
    color: white;
}

.v2-sort-select {
    padding: 6px 12px;
    font-family: 'Mulish', sans-serif;
    font-size: 0.78rem;
    color: var(--text-secondary, #5a6272);
    background: white;
    border: 1.5px solid var(--border-light, #e2e5ea);
    border-radius: 6px;
    cursor: pointer;
    outline: none;
}

.v2-sort-select:focus {
    border-color: var(--primary, #00b83d);
}

.v2-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    font-family: 'Mulish', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background: rgba(0,184,61,0.7);
    border: 1.5px solid rgba(0,184,61,0.8);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.v2-share-btn:hover {
    background: rgba(0,184,61,0.18);
    border-color: rgba(0,184,61,0.4);
}

/* Clear all button — always visible, prominent */
.v2-clear-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 16px;
    font-family: 'Mulish', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    background: rgba(229,52,36,0.7);
    border: 1.5px solid rgba(229,52,36,0.8);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.v2-clear-all-btn:hover {
    background: rgba(229,52,36,0.22);
    border-color: rgba(229,52,36,0.5);
    transform: translateY(-1px);
}

.v2-plant-count {
    font-size: 0.85rem;
    color: var(--text-secondary, #5a6272);
    font-weight: 500;
}

.v2-plant-count strong {
    font-weight: 700;
    color: var(--text-primary, #1a1e25);
}

.v2-results-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* ---- UNIVERSAL SEARCH AUTOCOMPLETE ---- */
.v2-search-autocomplete {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-light, #e2e5ea);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,61,1,0.12);
    z-index: 600;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.v2-search-autocomplete.visible {
    display: block;
}

.v2-search-group {
    padding: 6px 0;
}

.v2-search-group + .v2-search-group {
    border-top: 1px solid rgba(0,0,0,0.06);
}

.v2-search-group-label {
    padding: 4px 14px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--grey-400, #9ba1ab);
}

.v2-search-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.82rem;
    transition: background 0.15s ease;
}

.v2-search-result:hover {
    background: rgba(0,184,61,0.08);
}

.v2-search-result-icon {
    font-size: 1rem;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.v2-search-result-text {
    flex: 1;
}

.v2-search-result-type {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--grey-400, #9ba1ab);
    padding: 2px 6px;
    background: var(--grey-100, #f0f1f3);
    border-radius: 6px;
}

/* ---- MOBILE DROPDOWN BACKDROP ---- */
.v2-dropdown-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 499;
}

.v2-dropdown-backdrop.visible {
    display: block;
}

/* ---- V2 FULL-WIDTH PLANT GRID ---- */
.v2-layout .plant-grid {
    position: relative;
    z-index: 1;
}

/* ---- SCROLL TO TOP BUTTON ---- */
.v2-scroll-top-btn {
    display: none; /* Hidden by default, shown on mobile via media query */
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .v2-scroll-top-btn {
        display: none; /* JS adds .visible when scrolled */
        width: 32px;
        height: 32px;
        border: none;
        border-radius: 50%;
        background: var(--primary, #4a7c59);
        color: white;
        font-size: 12px;
        line-height: 1;
        cursor: pointer;
        flex-shrink: 0;
        opacity: 0;
        transform: scale(0.5);
        transition: opacity 0.2s ease, transform 0.2s ease;
        box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    }

    .v2-scroll-top-btn.visible {
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 1;
        transform: scale(1);
    }

    .v2-header-top {
        padding: 8px 14px;
        gap: 10px;
    }

    .v2-header-nav {
        display: none;
    }

    .v2-search-bar {
        padding: 8px 14px;
    }

    .v2-search-bar input {
        font-size: 0.85rem;
    }

    .v2-scroll-arrow {
        display: none;
    }

    .v2-goal-card {
        width: 100px;
        padding: 10px 8px;
    }

    .v2-goal-card-icon {
        font-size: 1.3rem;
        margin-bottom: 4px;
    }

    .v2-goal-card-name {
        font-size: 0.68rem;
    }

    .v2-main-container {
        padding: 0 12px;
    }

    .v2-results-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .v2-results-right {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .v2-clear-all-btn,
    .v2-share-btn {
        flex-shrink: 0;
        font-size: 0.72rem;
        padding: 5px 12px;
    }

    .v2-sort-select {
        flex: 1;
        min-width: 0;
    }

    .v2-plant-count {
        display: none; /* Redundant on mobile — results are visible, saves space */
    }

    /* Mobile dropdowns as bottom sheets — must be above chat widget (z-index 9999) */
    .v2-dropdown-panel {
        position: fixed !important;
        left: 12px !important;
        right: 12px !important;
        top: auto !important;
        bottom: 0 !important;
        max-width: 100% !important;
        width: auto !important;
        border-radius: 24px 24px 0 0;
        max-height: 60vh;
        z-index: 10010;
        box-shadow: 0 -4px 30px rgba(0,0,0,0.15);
        padding: 16px;
    }

    .v2-dropdown-backdrop.visible {
        z-index: 10009;
    }

    /* Elevate the filter bar wrapper when a dropdown is open
       so its descendant panel escapes the z-index:50 stacking context */
    .v2-filter-bar-wrapper:has(.v2-dropdown-panel.open) {
        z-index: 10011;
    }
}

@media (max-width: 480px) {
    .v2-goal-card {
        width: 90px;
        padding: 8px 6px;
    }

    .v2-goal-card-icon {
        font-size: 1.1rem;
    }

    .v2-goal-card-name {
        font-size: 0.65rem;
    }
}

/* V2 filter buttons container */
.v2-filter-buttons {
    display: contents;
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */
.dark-mode .v2-main-container {
    background: var(--bg-page, #242424);
    padding-top: 4px;
    padding-bottom: 4px;
}

.dark-mode .v2-header-top {
    background: transparent;
}

.dark-mode .v2-search-bar {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
    color: #fafafa;
}

.dark-mode .v2-search-bar input {
    color: #fafafa;
}

.dark-mode .v2-search-bar input::placeholder {
    color: rgba(255,255,255,0.4);
}

.dark-mode .v2-search-bar:focus-within {
    background: rgba(255,255,255,0.12);
    border-color: var(--primary, #00b83d);
}

.dark-mode .v2-header-nav {
    border-top-color: rgba(255,255,255,0.08);
}

.dark-mode .v2-nav-brand {
    color: var(--primary-light, #70ffa0) !important;
}

.dark-mode .v2-nav-brand:hover {
    color: #fff !important;
}

.dark-mode .v2-header-nav a {
    color: rgba(255,255,255,0.6);
}

.dark-mode .v2-header-nav a:hover {
    color: var(--primary-light, #70ffa0);
    border-bottom-color: rgba(112,255,160,0.3);
}

.dark-mode .v2-header-nav a.active {
    color: var(--primary-light, #70ffa0);
    border-bottom-color: var(--primary-light, #70ffa0);
}

/* Goals bar */
.dark-mode .v2-goals-bar {
    background: var(--bg-page, #242424);
}

.dark-mode .v2-goals-bar-title {
    color: var(--primary-light, #70ffa0);
}

.dark-mode .v2-see-all-btn {
    color: var(--primary-light, #70ffa0);
}

.dark-mode .v2-goal-card {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.12);
}

.dark-mode .v2-goal-card:hover {
    border-color: var(--primary, #00b83d);
    background: rgba(255,255,255,0.12);
}

.dark-mode .v2-goal-card.selected {
    background: rgba(0,184,61,0.15);
    border-color: var(--primary, #00b83d);
}

.dark-mode .v2-goal-card-name {
    color: #fafafa;
}

.dark-mode .v2-goal-card.selected .v2-goal-card-name {
    color: white;
}

.dark-mode .v2-scroll-arrow {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.6);
}

.dark-mode .v2-scroll-arrow:hover {
    background: rgba(255,255,255,0.15);
    color: #fafafa;
}

/* Refinement strip */
.dark-mode .v2-refinement-strip.visible {
    background: rgba(0,184,61,0.1);
    border-color: rgba(0,184,61,0.2);
}

.dark-mode .v2-refinement-text {
    color: var(--primary-light, #70ffa0);
}

.dark-mode .v2-refinement-chip {
    background: rgba(0,184,61,0.2);
    border-color: rgba(0,184,61,0.3);
    color: var(--primary-light, #70ffa0);
}

.dark-mode .v2-refinement-dismiss {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.5);
}

/* Filter bar */
.dark-mode .v2-filter-bar-wrapper {
    background: var(--bg-page, #242424);
    border-bottom-color: rgba(255,255,255,0.08);
}

.dark-mode .v2-stock-toggle {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.15);
}
.dark-mode .v2-stock-segment {
    color: rgba(255,255,255,0.5);
}
.dark-mode .v2-stock-segment[data-value="all"] {
    color: rgba(255,255,255,0.9);
}
.dark-mode .v2-stock-slider {
    background: rgba(255,255,255,0.15);
}
.dark-mode .v2-stock-toggle.active .v2-stock-slider {
    background: var(--primary, #00b83d);
}
.dark-mode .v2-stock-toggle.active .v2-stock-segment[data-value="all"] {
    color: rgba(255,255,255,0.5);
}
.dark-mode .v2-stock-toggle.active .v2-stock-segment[data-value="instock"] {
    color: white;
}

/* Zone selector dark mode */
.dark-mode .v2-zone-label {
    color: rgba(255,255,255,0.5);
}

.dark-mode .v2-zone-select {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
    color: #fafafa;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.dark-mode .v2-zone-select:focus {
    border-color: var(--primary, #00b83d);
}

.dark-mode .v2-filter-dropdown-btn {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.7);
}

.dark-mode .v2-filter-dropdown-btn:hover,
.dark-mode .v2-filter-dropdown-btn.open {
    border-color: var(--primary, #00b83d);
    color: var(--primary-light, #70ffa0);
}

.dark-mode .v2-filter-dropdown-btn.has-selection {
    background: rgba(0,184,61,0.15);
    border-color: rgba(0,184,61,0.3);
    color: var(--primary-light, #70ffa0);
}

.dark-mode .v2-toggle-chip {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.7);
}

.dark-mode .v2-toggle-chip.selected {
    background: rgba(0,184,61,0.15);
    border-color: var(--primary, #00b83d);
    color: var(--primary-light, #70ffa0);
}

.dark-mode .v2-filter-see-all {
    color: var(--primary-light, #70ffa0);
    border-left-color: rgba(255,255,255,0.08);
}

/* Dropdown panels */
.dark-mode .v2-dropdown-panel {
    background: #2a2d32;
    border-color: rgba(255,255,255,0.12);
}

.dark-mode .v2-dropdown-pill {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
}

.dark-mode .v2-dropdown-pill:hover {
    border-color: var(--primary, #00b83d);
    color: var(--primary-light, #70ffa0);
}

.dark-mode .v2-dropdown-pill.selected {
    background: var(--primary, #00b83d);
    border-color: var(--primary, #00b83d);
    color: white;
}

.dark-mode .v2-dropdown-clear {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.6);
}

.dark-mode .v2-dropdown-done {
    background: var(--primary, #00b83d);
}

/* Active chips */
.dark-mode .v2-active-chip {
    background: rgba(0,184,61,0.15);
    border-color: rgba(0,184,61,0.25);
    color: var(--primary-light, #70ffa0);
}

.dark-mode .v2-active-chip .remove {
    color: var(--primary-light, #70ffa0);
}

.dark-mode .v2-clear-all-btn {
    color: #ff6b6b;
    background: rgba(255,107,107,0.1);
    border-color: rgba(255,107,107,0.2);
}

.dark-mode .v2-clear-all-btn:hover {
    background: rgba(255,107,107,0.2);
    border-color: rgba(255,107,107,0.35);
}

.dark-mode .v2-sort-select {
    background-color: #2a2d32 !important;
    border-color: rgba(255,255,255,0.15) !important;
    color: #fafafa !important;
}

.dark-mode .v2-sort-select option {
    background-color: #2a2d32;
    color: #fafafa;
}

.dark-mode .v2-share-btn {
    color: var(--primary-light, #70ffa0);
    background: rgba(0,184,61,0.1);
    border-color: rgba(0,184,61,0.2);
}

/* Results info */
.dark-mode .v2-results-info {
    color: rgba(255,255,255,0.6);
}

.dark-mode .v2-plant-count {
    color: rgba(255,255,255,0.6);
}

.dark-mode .v2-plant-count strong {
    color: #fafafa;
}

/* Search autocomplete */
.dark-mode .v2-search-autocomplete {
    background: #2a2d32;
    border-color: rgba(255,255,255,0.12);
}

.dark-mode .v2-search-group-label {
    color: rgba(255,255,255,0.4);
}

.dark-mode .v2-search-result {
    color: #fafafa;
}

.dark-mode .v2-search-result:hover {
    background: rgba(0,184,61,0.12);
}

.dark-mode .v2-search-result-type {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
}

/* Header actions in dark mode */
.dark-mode .v2-icon-img {
    filter: invert(1) brightness(0.85);
}

.dark-mode .v2-auth-link {
    color: rgba(255,255,255,0.7) !important;
}

.dark-mode .v2-search-icon {
    color: rgba(255,255,255,0.4);
}

/* Nav on top — no top border, bottom border instead */
.v2-header-nav {
    border-top: none;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.dark-mode .v2-header-nav {
    border-bottom-color: rgba(255,255,255,0.08);
}
