/* ========================================
   BROWSE PAGE STYLES
   Used by: Browse.cshtml, Index.cshtml, Rep.cshtml
   ======================================== */

/* Shared focus transition for inputs inside the filter panel */
.search-input,
.facet-search {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, outline 0.3s ease;
}

/* ========================================
   SEARCH AND FILTER BAR
   ======================================== */

.search-filter-bar {
    background: white;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 1rem;
}

.search-input {
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 50px;
    padding: 0.75rem 1.25rem;
    padding-left: 2.75rem;
    font-size: 0.95rem;
    background-color: var(--cream);
}

.search-input:focus {
    outline: 2px solid var(--gold);
    outline-offset: 1px;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
    background-color: white;
}

.search-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.search-clear-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    padding: 0.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (hover: hover) {
    .search-clear-btn:hover {
        color: var(--gold-dark);
        transform: translateY(-50%) scale(1.1);
    }
}

.filter-btn {
    background: white;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-weight: 500;
}

@media (hover: hover) {
    .filter-btn:hover {
        background: var(--gold);
        border-color: var(--gold);
        color: white;
    }
}

.sort-select {
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 50px;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* ========================================
   PRODUCT GRID
   ======================================== */

.product-card-link {
    position: relative;
    display: block;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.product-card-overlay-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(0,0,0,0.06);
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

@media (hover: hover) {
    .product-card-link:hover .product-card,
    .product-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 40px rgba(0,0,0,0.12);
        border-color: var(--gold-light);
    }
}

.product-image-wrapper {
    position: relative;
    padding-top: 100%;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    overflow: hidden;
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1;
}

@media (hover: hover) {
    .product-card-link:hover .product-image,
    .product-card:hover .product-image {
        transform: scale(1.08);
    }
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--gold);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* StyleBar badges - positioned on left side, stacking vertically */
.product-badge.stylebar-badge {
    background: #1a365d;
    top: 12px;
    right: auto;
    left: 12px;
}

.product-badge.stylebar-badge:nth-of-type(2) {
    top: 42px;
}

.product-badge.stylebar-badge:nth-of-type(3) {
    top: 72px;
}

/* Specific styleBar colors */
.product-badge.stylebar-nyvault {
    background: #0d6efd;
}

.product-badge.stylebar-show-special,
.product-badge.stylebar-showspecial {
    background: #b91c1c;
}

.product-details {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.product-sku {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.product-tag {
    background: var(--cream);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(0,0,0,0.06);
}

.product-tag.nyvault-tag {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.product-price {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gold-dark);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
}

.product-price .list-price {
    font-size: 0.9rem;
    color: var(--text-muted-price);
    text-decoration: line-through;
    font-weight: 400;
}

.product-price .sale-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold-dark);
}

.view-btn {
    background: var(--charcoal);
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

@media (hover: hover) {
    .view-btn:hover {
        background: var(--gold);
        color: white;
        transform: translateX(4px);
    }
}

/* ========================================
   SELECTED FILTERS
   ======================================== */

.selected-filters {
    background: white;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.selected-filters-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gold-light);
    color: var(--charcoal);
    padding: 0.5rem 0.75rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid var(--gold);
}

@media (hover: hover) {
    .filter-chip:hover {
        background: var(--gold);
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
    }
}

.filter-chip i {
    font-size: 1.1rem;
    font-weight: bold;
}

.clear-all-filters {
    color: var(--text-secondary);
    text-decoration: underline;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.clear-all-filters:hover {
    color: var(--gold-dark);
}

/* ========================================
   RESULT COUNT
   ======================================== */

.result-count {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ========================================
   FILTER SIDEBAR
   ======================================== */

.filter-sidebar {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(0,0,0,0.06);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
}

.filter-sidebar::-webkit-scrollbar {
    width: 8px;
}

.filter-sidebar::-webkit-scrollbar-track {
    background: var(--cream);
    border-radius: 10px;
    margin: 10px 0;
}

.filter-sidebar::-webkit-scrollbar-thumb {
    background: var(--gold-light);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.filter-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* Filters sidebar: full-width offcanvas on mobile, default width on sm+ */
.filters-sidebar {
    --bs-offcanvas-width: 100%;
}

@media (min-width: 576px) {
    .filters-sidebar {
        --bs-offcanvas-width: 400px;
    }
}

@media (min-width: 992px) {
    .filters-sidebar {
        position: sticky;
        top: 80px;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        padding-right: 1rem;
        flex: 0 0 25%;
        max-width: 300px;
    }
}

.filters-sidebar::-webkit-scrollbar {
    width: 8px;
}

.filters-sidebar::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 10px;
}

.filters-sidebar::-webkit-scrollbar-thumb {
    background: var(--gold-light);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.filters-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* Facet search box */
.facet-search-box {
    margin-bottom: 0.75rem;
}

.facet-search-box input {
    font-size: 0.875rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 4px;
}

/* Filter options with scrollbar */
.filter-options {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.filter-options::-webkit-scrollbar {
    width: 6px;
}

.filter-options::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 10px;
}

.filter-options::-webkit-scrollbar-thumb {
    background: var(--gold-light);
    border-radius: 10px;
}

.filter-options::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

.filter-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    border-top: none;
    border-left: none;
    border-right: none;
    padding-top: 0;
    padding-left: 0;
    padding-right: 0;
    min-width: 0;
}

.filter-section > legend.filter-label {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    padding: 0;
    float: none;
    width: auto;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.facet-search {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    background-color: var(--cream);
}

.facet-search:focus {
    outline: 2px solid var(--gold);
    outline-offset: 1px;
    border-color: var(--gold);
    background-color: white;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1);
}

.filter-options-container {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
}

.filter-options-container::-webkit-scrollbar {
    width: 6px;
}

.filter-options-container::-webkit-scrollbar-track {
    background: var(--cream);
    border-radius: 10px;
}

.filter-options-container::-webkit-scrollbar-thumb {
    background: var(--gold-light);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.filter-options-container::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

.filter-option {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    transition: opacity 0.2s ease;
}

.filter-option.hidden {
    display: none;
}

.filter-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 0.75rem;
    cursor: pointer;
    accent-color: var(--gold);
    flex-shrink: 0;
}

.filter-option label {
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0;
    user-select: none;
}

/* ========================================
   HIERARCHICAL CATEGORY STYLES
   ======================================== */

.category-group-header {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid var(--gold-light);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.category-group-header:first-child {
    margin-top: 0;
}

.main-group-header {
    font-size: 0.9rem;
    color: var(--gold-dark);
    border-bottom: 2px solid var(--gold);
}

.sub-group-header {
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--gold-light);
    margin-left: 0.5rem;
}

.sub-group-item {
    margin-left: 1.5rem;
    position: relative;
}

.sub-group-item::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: var(--gold-light);
    border-radius: 50%;
}

.main-group-item {
    font-weight: 500;
}

/* ========================================
   MOBILE OPTIMIZATIONS
   ======================================== */

@media (min-width: 768px) {
    .product-title {
        font-size: 1.25rem;
    }

    .product-price {
        font-size: 1.5rem;
    }
}

/* ========================================
   MOBILE FILTER TOGGLE BUTTON
   ======================================== */

.filter-toggle-btn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1030;
    padding: 0.75rem 2rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 50px;
    transition: all 0.3s ease;
}

@media (hover: hover) {
    .filter-toggle-btn:hover {
        box-shadow: 0 6px 16px rgba(0,0,0,0.2);
        transform: translateX(-50%) translateY(-2px);
    }
}

/* ========================================
   SCROLL TO TOP BUTTON
   ======================================== */

.scroll-to-top {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--gold);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1040;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

@media (hover: hover) {
    .scroll-to-top:hover {
        background: var(--gold-dark);
        box-shadow: 0 6px 16px rgba(0,0,0,0.2);
        transform: translateY(-2px);
    }
}

@media (min-width: 992px) {
    .scroll-to-top {
        bottom: 20px;
    }
}

/* ========================================
   REP LANDING PAGE
   ======================================== */

.rep-header {
    background: linear-gradient(135deg, var(--charcoal) 0%, var(--charcoal-light) 100%);
    color: white;
}

.rep-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--gold);
}

.rep-photo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--charcoal-light);
    border: 4px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--gold);
}

.rep-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: white;
}

.rep-title {
    color: var(--gold);
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.rep-contact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rep-contact-item {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.2s;
}

.rep-contact-item:hover {
    color: var(--gold);
}

.rep-bio {
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 600px;
}

@media (min-width: 576px) {
    .rep-photo,
    .rep-photo-placeholder {
        width: 120px;
        height: 120px;
        font-size: 3rem;
    }

    .rep-name {
        font-size: 2.5rem;
    }

    .rep-contact {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1.5rem;
    }
}

/* ========================================
   WISHLIST HEART BUTTON ON PRODUCT CARDS
   ======================================== */

.wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

@media (hover: hover) {
    .wishlist-btn:hover {
        transform: scale(1.1);
    }
}

.wishlist-btn i {
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.wishlist-btn.active i {
    color: var(--gold);
}

@media (hover: hover) {
    .wishlist-btn:hover i {
        color: var(--gold);
    }
}

.wishlist-btn.active i {
    color: #e91e63;
}

/* ========================================
   SHARED INLINE STYLE REPLACEMENTS
   ======================================== */

.rep-photo-small {
    width: 48px;
    height: 48px;
    object-fit: cover;
}

#sortSelect {
    width: auto;
}
