/* --- Instagram Style Profile Section --- */
.insta-profile-header {
    padding: 20px 20px 0;
    max-width: 935px;
    margin: 80px auto 0;
    display: flex;
    flex-direction: column;
}

/* Base Profile Styles (Simplified since user removed content) */
.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Tabs Styling */
.profile-tabs {
    display: flex;
    justify-content: center;
    border-top: 1px solid #dbdbdb;
    gap: 60px;
    margin-top: 0;
}

.tab-item {
    padding: 18px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #8e8e8e;
    cursor: pointer;
    position: relative;
}

.tab-item.active {
    color: #262626;
    border-top: 1px solid #262626;
    margin-top: -1px;
}

/* --- Instagram Style Story Bar --- */
.insta-story-container {
    max-width: 990px;
    margin: 10px auto 10px;
    padding: 0 20px;
    position: relative;
    display: flex;
    align-items: center;
}

.story-wrapper {
    display: flex;
    gap: 40px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 10px 5px;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.story-wrapper::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari and Opera */
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    cursor: pointer;
    flex: 0 0 auto;
}

.story-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    width: 100px;
}

.story-circle {
    width: 100px;
    height: 100px;
    padding: 3px;
    border: 1px solid #dbdbdb;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 0.2s ease;
    margin: 0 auto;
}

.story-item:hover .story-circle {
    transform: scale(1.05);
}

.story-circle img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #f8f8f8;
}

.story-item span {
    font-size: 12px;
    font-weight: 700;
    color: #262626;
    width: 100%;
    text-align: center;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: capitalize;
    margin-top: 2px;
}

.story-nav-prev,
.story-nav-next {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: #ffffff;
    border-radius: 50%;
    display: none;
    /* hidden by default; JS will show when needed */
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    color: #8e8e8e;
    cursor: pointer;
    z-index: 5;
    font-size: 12px;
}

.story-nav-prev {
    left: 10px;
}

.story-nav-next {
    right: 10px;
}

.mobile-profile-info,
.mobile-stats-bar {
    display: none;
}

/* Insta Top Nav (Mobile View) */
.profile-top-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid #dbdbdb;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
}

.nav-back,
.nav-menu {
    font-size: 20px;
    color: #262626;
    cursor: pointer;
}

.nav-username {
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.verified-badge-small {
    font-size: 14px;
    color: #0095f6;
}

@media (max-width: 768px) {
    #topHeader {
        display: none !important;
    }

    .profile-top-nav {
        display: flex;
    }
}


/* --- Collection Layout Wrapper --- */
.collection-wrapper {
    display: flex;
    min-height: 100vh;
}

/* .collection-wrapper {
 use default stretch so main content can be full-width/fluid
}

*/
.collection-sidebar {
    width: 245px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: #ffffff;
    border-right: 1px solid #dbdbdb;
    padding: 20px;
    display: flex;
    flex-direction: column;
    z-index: 1001;
    overflow-y: auto;
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #dbdbdb #f1f1f1; /* Firefox */
}

/* Custom Scrollbar for Sidebar */
.collection-sidebar::-webkit-scrollbar {
    width: 5px;
}

.collection-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.collection-sidebar::-webkit-scrollbar-thumb {
    background: #dbdbdb;
    border-radius: 10px;
}

.main-content {
    margin: 0;
    width: 100%;
    max-width: none;
    min-height: 100vh;
    padding: 0 8px;
    /* minimal left/right spacing */
    padding-bottom: 20px;
}

/* Sidebar Section Styling */
.sidebar-header {
    margin-bottom: 10px;
}

.sidebar-mobile-header {
    display: none;
}

.sidebar-header h3 {
    font-size: 24px;
    font-weight: 600;
    color: #262626;
    letter-spacing: 0.5px;
    margin: 0px;
}

.sidebar-section {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: #262626;
    margin-bottom: 0px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title i {
    transition: transform 0.3s ease;
    font-size: 10px;
}

.sidebar-dropdown .dropdown-content {
    display: flex;
    flex-direction: column;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease,
        margin 0.3s ease;
}

.sidebar-dropdown.active .dropdown-content {
    max-height: 1000px;
    /* High enough value to accommodate all options */
    opacity: 1;
    margin-top: 10px;
    padding-bottom: 5px;
}

.sidebar-dropdown.active .section-title i {
    transform: rotate(180deg);
}

/* Sidebar Search */
.sidebar-section .search-wrap {
    margin: 0;
    max-width: 100%;
}

.sidebar-section .search-input-box {
    background: #efefef;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease-in-out;
    height: 38px;
}

.sidebar-section .search-input-box:focus-within {
    background: #ffffff;
    border-color: #dbdbdb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.sidebar-section .search-input-box i {
    color: #8e8e8e;
    font-size: 14px;
}

.sidebar-section .search-input-box input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #262626;
    outline: none;
    padding: 8px 0;
}

.sidebar-section .search-input-box input::placeholder {
    color: #8e8e8e;
    font-weight: 300;
}

/* Sidebar Sort */
.sort-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sort-option {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #262626;
    cursor: pointer;
    transition: background 0.2s;
}

.sort-option:hover {
    background: #fafafa;
}

.sort-option.active {
    background: #efefef;
    font-weight: 600;
}

/* Sidebar Filters */
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #262626;
    cursor: pointer;
    padding: 4px 0;
}

.filter-option input {
    width: 16px;
    height: 16px;
    accent-color: #000;
}

/* Price Slider adjustments for sidebar */


.price-range-header {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 15px;
    color: #262626;
}

/* Reset Body and Common elements for sidebar view */


#topHeader {
    border-bottom: 1px solid #dbdbdb;
}

.profile-top-nav {
    left: 245px;
    width: calc(100% - 245px);
}

.insta-profile-header {
    margin: 0px auto 0;
    max-width: 935px;
}

.product-grid {
    margin: 40px auto 60px;
    width: 100%;
}

/* Old horizontal filter bar cleanup */
.filter-bar {
    display: none;
}

.filter-label {
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    transition: color 0.3s ease;
}

.filter-label i {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.filter-dropdown:hover .filter-label {
    color: #d4af37;
}

.filter-dropdown:hover .filter-label i {
    transform: rotate(180deg);
}

.filter-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    min-width: 220px;
    padding: 20px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.filter-dropdown:hover .filter-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sort-dropdown {
    position: relative;
    margin-left: auto;
}

.sort-label {
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    transition: color 0.3s ease;
    min-width: 180px;
    justify-content: flex-end;
}

#currentSort {
    color: #1a1a1a;
    font-weight: 600;
}

.sort-label i {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.sort-dropdown:hover .sort-label i {
    transform: rotate(180deg);
}

.sort-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    min-width: 200px;
    padding: 15px 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.sort-dropdown:hover .sort-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sort-option {
    padding: 10px 25px;
    cursor: pointer;
    font-size: 14px;
    color: #666666;
    transition: all 0.3s ease;
}

.sort-option:hover {
    background: #e9e5e2;
    color: #1a1a1a;
}

.sort-option.active {
    color: #1a1a1a;
    font-weight: 500;
    background: #e9e5e2;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 0;
    cursor: pointer;
    font-size: 14px;
    color: #666666;
    transition: color 0.3s ease;
}

.filter-option:hover {
    color: #1a1a1a;
}

.filter-option input {
    accent-color: #1a1a1a;
}

/* --- Price Range Slider --- */
.price-range-menu {
    min-width: 280px;
    padding: 30px 25px;
}

.price-range-header {
    display: flex;
    justify-content: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 25px;
    color: #1a1a1a;
    font-family: 'Poppins', sans-serif;
}

body {
    color: #1a1a1a;
    font-family: 'Poppins', sans-serif;
    background-color: #e9e5e2;
}

.range-slider-container {
    position: relative;
    height: 20px;
    width: 100%;
}

.slider-track {
    position: absolute;
    width: 100%;
    height: 3px;
    background: #e9e5e2;
    border-radius: 5px;
    top: 50%;
    transform: translateY(-50%);
}

.range-slider-container input[type="range"] {
    position: absolute;
    width: 100%;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    height: 3px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}

.range-slider-container input[type="range"]::-webkit-slider-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #1a1a1a;
    cursor: pointer;
    pointer-events: auto;
    -webkit-appearance: none;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    z-index: 2;
    position: relative;
    transition: transform 0.2s ease;
}

.range-slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.range-slider-container input[type="range"]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #1a1a1a;
    cursor: pointer;
    pointer-events: auto;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.active-filters {
    display: flex;
    gap: 10px;
    padding: 10px 40px 15px;
    background: #ffffff;
}

.filter-chip {
    padding: 6px 15px;
    background: #e9e5e2;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.filter-chip i {
    font-size: 10px;
}

/* --- Instagram Style Grid --- */
.product-grid {
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 products per row on desktop */
    gap: 4px;
    /* very small spacing between cards */
    width: 100%;
    margin: 0;
    /* remove extra top/bottom margins to make grid flush */
    border-top: 1px solid #dbdbdb;
}

.product-card {
    position: relative;
    background: #ffffff;
    cursor: pointer;
    overflow: hidden;
}

.product-image-box {
    position: relative;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #f8f8f8;
}

.product-img,
.product-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.4s ease, transform 0.4s ease, opacity 0.4s ease;
}

/* Focus Hover Effect: When grid is hovered, overlay ONLY the cards NOT being hovered */
.product-grid:hover .product-card:not(:hover) .product-image-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(245, 237, 237, 0.4);
    z-index: 5;
    pointer-events: none;
}

/* The selected card remains perfectly clear - No scale, No filters */
.product-card:hover .product-img,
.product-card:hover .product-video {
    filter: none !important;
    opacity: 1 !important;
    transform: none !important;
}

/* Hover Overlay (Container for Buttons) */
.product-card .product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.overlay-actions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 15px;
    z-index: 20;
}

.overlay-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    color: #1a1a1a;
    font-size: 18px;
}

.overlay-btn:hover {
    transform: scale(1.15);
    background: #1a1a1a;
    color: #ffffff;
}

.overlay-btn.wishlist-btn i.fas {
    color: #ff4d4d;
}

/* Central Play Icon for Videos */
.central-play-icon {
    font-size: 50px;
    color: #ffffff;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.3));
}

/* Post Icons (Reel/Carousel Icons) refinement */
.post-type-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #ffffff;
    font-size: 18px;
    z-index: 15;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.product-info {
    display: none !important;
}

/* --- Mobile Overlay & Toggle Base --- */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

.mobile-filter-toggle {
    display: none;
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 14px 28px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 14px;
    gap: 12px;
    align-items: center;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    border: none;
    outline: none;
    transition: transform 0.2s active;
}

.mobile-filter-toggle:active {
    transform: translateX(-50%) scale(0.95);
}

@media (max-width: 768px) {
    .submenu-links a {
        justify-content: left;
        min-height: 30px;
    }

    .submenu-links {
        padding-left: 5px;
        gap: 5px;
    }

    .collection-wrapper {
        flex-direction: column;
    }

    .collection-sidebar {
        width: 300px;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 2100;
        padding: 0;
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
        display: flex;
        flex-direction: column;
        overflow-y: hidden;
        background: #fff;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
    }

    .collection-sidebar.active {
        transform: translateX(0);
    }

    .sidebar-header {
        display: none;
    }

    .sidebar-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 20px;
        border-bottom: 1px solid #dbdbdb;
        background: #fff;
    }

    .sidebar-mobile-header h3 {
        font-size: 18px;
        font-weight: 600;
        margin: 0;
    }

    .sidebar-mobile-header button {
        background: none;
        border: none;
        font-size: 20px;
        color: #262626;
        cursor: pointer;
    }

    .sidebar-content {
        flex: 1;
        overflow-y: auto;
        padding: 20px;
        -webkit-overflow-scrolling: touch;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding-top: 60px;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    #topHeader {
        display: flex !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        z-index: 1500 !important;
        border-bottom: 1px solid #dbdbdb !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
    }

    /* Improve touch targets for mobile */
    .filter-option {
        padding: 12px 0;
        font-size: 16px;
    }

    .sort-option {
        padding: 12px 15px;
        font-size: 16px;
    }

    .section-title {
        padding: 15px 0;
        font-size: 15px;
    }

    /* iPad adjustments (portrait) */
    .insta-profile-header {
        max-width: 100%;
        margin-top: 20px;
    }

    .product-grid {
        max-width: 100%;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 6px;
        margin-top: 10px;
    }

    .insta-story-container {
        padding: 0px
    }

    /* Floating Filter Toggle for Mobile */
    .mobile-filter-toggle {
        display: flex;
        opacity: 1;
        visibility: visible;
        bottom: 15px;
        box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
        padding: 15px;
    }
}

/* Tablet Landscape (iPad Pro, etc.) */
@media (min-width: 769px) and (max-width: 1024px) {
    .collection-sidebar {
        width: 220px;
    }

    .main-content {
        margin-left: 220px;
        width: calc(100% - 220px);
    }

    #topHeader,
    .profile-top-nav {
        left: 220px;
        width: calc(100% - 220px);
    }
}