/* Shop Page Specific Styles */

/* Filter Sidebar */
.filter-sidebar {
    position: fixed;
    height: 100vh;
    width: 100%;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.5);
    cursor: url('../images/cursor-close.svg'), auto;
    inset: 0;
    padding: 0;
    transform: translateX(-110%);
}

.filter-sidebar.preview {
    transform: translateX(0);
}

.filter-sidebar .container {
    width: 100%;
    max-width: 400px;
    height: 100%;
    background-color: var(--white);
    margin-left: 0;
    cursor: auto;
    padding: 80px 20px;
    position: relative;
}

.filter-sidebar .filter-content-wrapper {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 10px;
}

.filter-sidebar .filter-content-wrapper::-webkit-scrollbar {
    width: 5px;
}

.reset-filter-btn {
    position: absolute;
    bottom: 0;
    width: 100%;
    background-color: var(--white);
    right: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;

    .btn {
        width: 100%;
    }

    .btn:hover {
        background-color: var(--error);
    }
}

.filter-sidebar .filter-content-wrapper::-webkit-scrollbar-thumb {
    cursor: grab;
    background-color: var(--primary);
}

.filter-wrapper-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 30px;

    span svg {
        height: 30px;
        color: var(--black);
    }

    span.close-menu {
        display: block;
    }
}

.filter-section {
    border-bottom: 1px solid var(--line-10);
    padding: 10px 0;
}

.filter-section:first-child {
    padding-top: 0;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    margin-bottom: 20px;
}

.filter-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--black);
}

.filter-toggle {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--text-2);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.filter-section.collapsed .filter-toggle {
    transform: rotate(180deg);
}

.filter-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

/* .filter-section.collapsed .filter-content {
    max-height: 0;
} */

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.filter-option label {
    font-size: 16px;
    color: var(--text);
    cursor: pointer;
    flex: 1;
    display: flex;
    justify-content: space-between;
}

.filter-count {
    color: var(--text-3);
    font-size: 14px;
}

/* Price Range Slider */
.price-range {
    margin: 20px 0;
}

.price-slider {
    position: relative;
    margin: 20px 0;
}

.price-slider input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--line-10);
    outline: none;
    -webkit-appearance: none;
}

.price-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--black);
    cursor: pointer;
}

.price-values {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    font-size: 16px;
    font-weight: 500;
    color: var(--black);
}

/* Size Filter */
.size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.size-option {
    display: flex;
    align-items: center;
}

.size-option input[type="checkbox"] {
    display: none;
}

.size-option label {
    padding: 8px 16px;
    border: 1px solid var(--line-6);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

.size-option input[type="checkbox"]:checked+label {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}

/* Color Filter */
.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px;
}

.color-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.color-option input[type="checkbox"] {
    /* display: none; */
    opacity: 0;
    height: 100%;
    width: 100%;
    cursor: pointer;
}

.color-swatch {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    pointer-events: none;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.color-option input[type="checkbox"]:checked+.color-swatch {
    border-color: var(--black);
    box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--black);
}

/* Color swatches */
.color-light-blue {
    background-color: #E6F3FF;
}

.color-black {
    background-color: #000000;
}

.color-dark-green {
    background-color: #2D5A3D;
}

.color-light-green {
    background-color: #90EE90;
}

.color-green {
    background-color: #4CAF50;
}

.color-red {
    background-color: #F44336;
}

.color-orange {
    background-color: #FF9800;
}

.color-brown {
    background-color: #8D6E63;
}

.color-pink {
    background-color: #E91E63;
}

.color-purple {
    background-color: #9C27B0;
}

.color-blue {
    background-color: #2196F3;
}

.color-gray {
    background-color: #9E9E9E;
}

/* Promotional Banner */
/* .promo-banner {
    margin-top: 30px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.promo-banner img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.promo-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    color: var(--white);
}

.promo-label {
    font-size: 12px;
    color: var(--secondary);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.promo-title {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 16px;
}

.promo-btn {
    background: var(--white);
    color: var(--black);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.promo-btn:hover {
    background: var(--primary);
    color: var(--white);
} */

/* Main Content Area */
.main-content {
    min-height: 500px;
}

.shop-container {
    /* display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start; */

    display: flex;
    align-items: center;
    justify-content: start;
    flex-direction: column;
    gap: 40px;
    width: 100%;
}

.filter-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--black);
    padding: 12px 20px;
    border: 1px solid var(--black);
    border-radius: 15px;
    font-weight: 500;
    cursor: pointer;

    &:hover {
        color: var(--white);
        background-color: var(--black);
    }
}

/* Toolbar */
.shop-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* margin-bottom: 30px; */
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
    /* background-color: red; */
}

/* View Toggle */
.view-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-btn {
    /* width: 40px;
    height: 40px; */
    padding: 10px;
    border: 1px solid var(--line-6);
    background: var(--white);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn.active {
    background: var(--black);
    border-color: var(--black);
    color: var(--white);
}

/* .view-btn svg {
    height: 22px;
} */

/* Show Sale Checkbox */
.show-sale {
    display: flex;
    align-items: center;
    gap: 8px;
}

.show-sale input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.show-sale label {
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
}

/* Sort Dropdown */
.sort-dropdown {
    position: relative;
}

.sort-dropdown select {
    padding: 12px 40px 12px 16px;
    border: 1px solid var(--line-6);
    border-radius: 6px;
    background: var(--white);
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    outline: none;
    appearance: none;
    min-width: 150px;
}

.sort-dropdown::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-2);
    pointer-events: none;
}

.filter-and-count {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap;
    /* margin-bottom: 24px; */
}

/* Active Filters */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    flex-grow: 1;
}

.filter-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-2);
    padding: 8px 12px;
    /* border-radius: 20px; */
    /* font-size: 14px; */
    color: var(--text);
}

.filter-tag .remove-filter {
    background: none;
    border: none;
    width: 16px;
    height: 16px;
    /* border-radius: 10px; */
    /* background: var(--text-3); */
    color: var(--black);
    cursor: pointer;
    /* font-size: 12px; */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.filter-tag .remove-filter:hover {
    color: var(--primary);
}

.clear-all-btn {
    background: none;
    border: none;
    color: var(--text-2);
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    padding: 8px 0;
}

.clear-all-btn:hover {
    color: var(--primary);
}

/* Results Counter */
.results-counter {
    font-size: 14px;
    color: var(--text-2);
}

/* Products Grid */
.products-container {
    transition: all 0.3s ease;
    width: 100%;
}

.products-grid {
    display: grid;
    gap: 24px;
    transition: .3s ease;
}

/* Grid Views */
.products-grid.grid-1 {
    grid-template-columns: 1fr;
    transition: .3s ease;
}

.products-grid.grid-2 {
    grid-template-columns: repeat(2, 1fr);
    transition: .3s ease;
}

.products-grid.grid-3 {
    grid-template-columns: repeat(3, 1fr);
    transition: .3s ease;
}

.products-grid.grid-4 {
    grid-template-columns: repeat(4, 1fr);
    transition: .3s ease;
}

/* Product Cards */
.product-card {
    width: 100%;
    background: var(--white);
    border-radius: 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Product Image */
.product-image {
    width: 100%;
    position: relative;
    background-color: var(--bg-2);
    overflow: hidden;
    margin-bottom: 16px;
    aspect-ratio: 1;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.3s ease;
}


/* Product Actions */
.product-actions {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 1;
    z-index: 10;
    transition: all 0.3s ease;
}

.product-actions .action-btn {
    width: 40px;
    height: 40px;
    background: var(--white);
    border: 1px solid var(--line-6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transform: translateX(70px);
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-actions .action-btn::before {
    position: absolute;
    border-radius: 5px;
    background-color: var(--black);
    content: '';
    display: block;
    right: calc(120% + 8px);
    top: 50%;
    transform: translateY(-50%) translateX(5px);
    padding: 5px;
    font-size: 14px;
    color: var(--white) !important;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
}

.product-actions .action-btn::after {
    content: '';
    position: absolute;
    display: block;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 10px solid var(--black);
    right: 120%;
    top: 50%;
    transform: translateY(-50%) translateX(5px);
    opacity: 0;
}

.product-actions .action-btn:hover::before,
.product-actions .action-btn:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.product-actions .action-btn:nth-child(1) {
    transition-delay: 0s;

    &::before {
        content: 'Add to cart';
    }
}

.product-actions .action-btn:nth-child(2) {
    transition-delay: .1s;

    &::before {
        content: 'Add to Wishlist';
    }
}

/* .product-actions .action-btn:nth-child(3) {
    transition-delay: .2s;

    &::before {
        content: 'Compare';
    }
} */

.product-actions .action-btn:nth-child(3) {
    transition-delay: .2s;

    &::before {
        content: 'Quick view';
    }
}

/* Product Badges */
.product-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-hot {
    background: var(--bg-7);
    color: var(--white);
}

.badge-flash {
    background: var(--black);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;

    svg {
        color: var(--error);
        animation: flashAnimate .3s ease-in-out infinite;
    }
}

@keyframes flashAnimate {
    0% {
        transform: scale(1.1) rotate(10deg);
    }

    50% {
        transform: scale(1.1) rotate(-10deg);
    }

    100% {
        transform: scale(1) rotate(0);
    }
}

.badge-trending {
    background: #6366F1;
    color: var(--white);
}

.badge-new {
    background: var(--success);
    color: var(--white);
}

/* Countdown Timer */
.countdown-timer {
    position: absolute;
    bottom: 12px;
    left: 12px;
    /* background: rgba(0, 0, 0, 0.8); */
    background-color: var(--white);
    color: var(--primary);
    padding: 10px 12px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    width: 80%;
    left: 50%;
    transform: translate(-50%);
    /* transition: .3s ease-in-out; */
}

/* Product carousel */
.product-carousel {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    background-color: var(--black);

    .carousel-track {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 20px;
        width: 100%;
        animation: carousel 5s linear infinite;
    }

    .carousel-track .carousel {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 20px;

        h4 {
            white-space: nowrap;
            color: var(--white);
            line-height: 0;
        }
    }
}


.product-card:hover {
    .product-actions .action-btn {
        transform: translateX(0);
    }

    .countdown-timer,
    .product-carousel {
        bottom: -50%;
    }
}

@media (max-width: 1199px) {
    .product-card .countdown-timer,
    .product-card .product-carousel {
        display: none;
    }
}


/* Product Info */
.product-info {
    text-align: left;

    .list-view-info {
        display: none;
    }
}

.list-view-actions {
    display: none;
}

.product-title {
    color: var(--black);
    margin-bottom: 8px;
    line-height: 1.3;
    font-weight: 500;
}

.product-price {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 12px;
}

.original-price {
    color: var(--text-3);
    text-decoration: line-through;
    font-size: 14px;
}

.current-price {
    color: var(--black);
    font-weight: 600;
    font-size: 16px;
}

/* Product Color Variants */
.product-colors {
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 10px;
}

.color-variant {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid var(--line-6);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;

    &::after {
        content: '';
        position: absolute;
        display: block;
        height: calc(100% + 8px);
        width: calc(100% + 8px);
        border: 2px solid transparent;
        border-radius: 50%;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
}

.color-variant.active::after {
    border-color: var(--black);
}

@media (max-width: 768px) {
    .product-card .product-actions {
        .action-btn {
            transform: translate(0);
        }
    }
}

@media (max-width: 500px) {
    .product-card .product-actions {
        .action-btn {
            transform: translate(0);
            width: 25px;
            height: 25px;
            flex-shrink: 0;
        }

        .action-btn:nth-child(4), .action-btn:nth-child(3) {
            display: none;
        }
    }
}

/* List View Specific Styles */
.products-grid.grid-1 .product-card {
    display: grid;
    gap: 20px;
    align-content: center;
    grid-template-columns: 1.5fr 3fr;
}

.products-grid.grid-1 .product-image {
    width: 100%;
    height: 100%;
    /* min-width: 200px; */
    flex-shrink: 0;
    margin-bottom: 0;

    .product-actions .action-btn:nth-child(1),
    .product-actions .action-btn:nth-child(2) {
        display: none;
    }
}

@media (max-width: 768px) {
    .products-grid.grid-1 .product-card .product-actions {
        bottom: 20px;
        top: unset;
        flex-direction: row;
        left: 50%;
        transform: translate(-50%);


        .action-btn {
            transform: translate(0);
        }
    }
}

.products-grid.grid-1 .product-info-con {
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    /* background-color: red; */

    .product-info {
        border-right: 1px solid var(--line-10);
        padding-right: 20px;
        display: flex;
        align-items: flex-start;
        justify-content: start;
        gap: 10px;
        flex-direction: column;
        /* align-self: flex-start; */
        /* background-color: green; */
    }


    .list-view-info {
        display: block;

        p {
            font-size: 18px;
            /* line-height: 1.6; */
            margin-bottom: 10px;

            strong {
                color: var(--black);
            }
        }
    }

    .product-title,
    .product-price {
        margin: 0;
    }
}

.products-grid.grid-1 .product-price {
    font-size: 18px;
}

.products-grid.grid-1 .product-colors .color-variant {
    height: 20px;
    width: 20px;
}

.products-grid.grid-1 .list-view-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;

    span,
    div {
        width: 100%;
    }

    div {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .btn {
        padding: 12px 36px;
        white-space: nowrap;
    }

    .btn.to-list {
        background-color: var(--white);
        color: var(--black);
        border: 1px solid var(--line-6);

        &:hover {
            background-color: var(--bg-8);
        }
    }

    b {
        color: var(--black);
    }
}

@media (max-width: 768px) {
    .products-grid.grid-1 .product-info-con {
        flex-direction: column;
        align-items: start;

        .list-view-info p:nth-child(2) {
            display: none;
        }

        .list-view-actions,
        .product-info {
            width: 100%;
            padding: 0;
            border: 0;

            div {
                flex-direction: row;
            }
        }
    }
}

@media (max-width: 570px) {
    .list-view-info p:nth-child(1) {
        display: none;
    }

    .products-grid.grid-1 .product-info-con {
        gap: 10px;

        .list-view-actions div {
            flex-direction: column;

            .btn {
                padding: 8px 12px;
                font-size: 14px;
            }
        }
    }

    .products-grid.grid-1 .product-card .product-actions {
        bottom: 10px;

        .action-btn {
            width: 25px;
            height: 25px;
            flex-shrink: 0;
        }
    }
}

@media (max-width: 400px) {
    .products-grid.grid-1 .product-card {
        grid-template-columns: 1fr 1fr;
    }

    .products-grid.grid-1 .product-info-con {
        gap: 5px;

        .list-view-actions div {
            flex-direction: column;

            .btn {
                padding: 5px 8px;
                font-size: 14px;
            }
        }
    }
}


/* Loading State */
.products-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-2);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--line-10);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 16px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}