﻿.product-index {
    position: absolute;
    left: 0;
    right: 0;
    background: #000;
    color: #fff;
    font-weight: bold;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    text-align: center;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    z-index: 2;
    transition: transform .3s;
}
.product-card:hover .product-image .product-index {
    transform: scale(1.05)
}
@media (max-width: 768px) {
    .product-index {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
}

@media (max-width: 480px) {
    .product-index {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }
}

.search-layout .product-card {
    transition: transform 140ms ease,box-shadow 140ms ease;
    will-change: transform
}

@media (hover:hover) {
    .search-layout .product-card:hover {
        transform: translateY(-4px)
    }
}

.search-layout .product-card:focus-within {
    transform: translateY(-4px)
}

@media (hover:none) {
    .search-layout .product-card:active {
        transform: translateY(-2px)
    }
}

@media (prefers-reduced-motion:reduce) {
    .search-layout .product-card {
        transition: none
    }
}

[aria-label]:hover::before {
    opacity: 0!important
}

.results-range {
    color: var(--grey-600);
    font-size: .9em;
    margin-left: .5rem
}

.pagination-wrapper {
    margin: 2rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--grey-200)
}

.pagination-nav {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem
}

.pagination {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: .25rem;
    align-items: center
}

.page-item {
    margin: 0
}

.page-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1rem!important;
    text-decoration: none;
    color: var(--grey-700);
    background: var(--white);
    border: 1px solid var(--grey-300);
    border-radius: var(--radius-md);
    transition: all .2s ease;
    font-size: .875rem;
    min-width: 44px;
    justify-content: center
}

.page-link:hover {
    background: var(--grey-100);
    color: var(--primary-green-darker);
    text-decoration: none;
    transform: translateY(-1px)
}

.page-item.active .page-link {
    background: var(--primary-green);
    color: var(--white);
    border-color: var(--primary-green);
    font-weight: 600
}

.page-item.disabled .page-link {
    color: var(--grey-400);
    background: var(--grey-100);
    border-color: var(--grey-200);
    cursor: not-allowed;
    pointer-events: none
}

.pagination-info {
    text-align: center;
    color: var(--grey-600);
    font-size: .875rem;
    margin-top: 1rem
}

@media (max-width:768px) {
    .pagination {
        flex-wrap: wrap;
        gap: .5rem;
        justify-content: center
    }

    .page-link {
        padding: .5rem .75rem;
        font-size: .8rem;
        min-width: 40px
    }

    .pagination-wrapper {
        margin: 1.5rem 0;
        padding: 1rem
    }
}

@media (max-width:480px) {
    .page-link {
        padding: .5rem;
        min-width: 36px
    }

    .page-link span {
        display: none
    }

    .page-item:first-child .page-link,.page-item:last-child .page-link {
        padding: .5rem .75rem
    }

    .page-item:first-child .page-link span,.page-item:last-child .page-link span {
        display: inline
    }
}

.search-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem
}

.search-sidebar {
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    height: fit-content;
    top: 120px
}

.sidebar-section {
    margin-bottom: 2rem
}

.sidebar-section:last-child {
    margin-bottom: 0
}

.sidebar-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--bde-headings-color);
    display: flex;
    align-items: center;
    gap: .5rem
}

.sidebar-section h3 i {
    color: var(--primary-green);
    font-size: 1rem
}

.btn-filter {
    background: var(--primary-green);
    color: #fff;
    border: 0;
    padding: .875rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    width: 100%;
    font-size: 1rem
}

.btn-filter:hover {
    background: var(--primary-green-hover)
}

.contact-phones {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--grey-200)
}

.contact-phones p {
    font-size: .875rem;
    color: var(--grey-600);
    margin-bottom: .5rem
}

.search-main {
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden
}

.results-header {
    background: linear-gradient(135deg,var(--primary-green-darker) 0%,var(--primary-green) 100%);
    color: #fff;
    padding: 2rem
}

.results-header h1 {
    color: #fff!important;
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: .5rem
}

.results-meta {
    font-size: 1.125rem;
    opacity: .9;
    word-wrap: break-word
}

.results-meta .highlight {
    color: var(--primary-green-light);
    font-weight: 600
}

.sort-controls {
    padding: 1.5rem 2rem;
    background: var(--grey-50);
    border-bottom: 1px solid var(--grey-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem
}

.sort-label {
    font-weight: 500;
    color: var(--grey-700);
    font-size: .875rem
}

.sort-select {
    padding: .5rem 1rem;
    border: 1px solid var(--grey-300);
    border-radius: var(--radius-md);
    font-size: .875rem;
    min-width: 200px;
    height: auto!important;
    line-height: auto!important
}

.results-list {
    padding: 2rem
}

.product-card,.product-image {
    border-radius: var(--radius-lg);
    overflow: hidden
    position: relative;
}

.product-card {
    display: grid;
    grid-template-columns: 200px 1fr auto;
    gap: 1.5rem;
    padding: 1.5rem;
    border: 1px solid var(--grey-200);
    margin-bottom: 1.5rem;
    transition: all .3s;
    background: #fff
}

.product-card:hover {
    border-color: var(--primary-green-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px)
}

.product-image {
    position: relative;
    background: var(--grey-100);
    aspect-ratio: 4/3;
    flex-shrink: 0
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
    border-radius: var(--radius-lg) var(--radius-lg) 0px 0px;
}

.product-card:hover .product-image img {
    transform: scale(1.05)
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    min-width: 0
}

.product-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--bde-headings-color);
    line-height: 1.4;
    text-decoration: none;
    transition: color .2s;
    word-wrap: break-word;
    hyphens: auto
}

.product-title:hover {
    color: var(--primary-green-darker);
    text-decoration: none
}

.product-description {
    color: var(--grey-600);
    line-height: 1.5;
    font-size: .875rem;
    word-wrap: break-word
}

.product-meta,.product-seller {
    display: flex;
    gap: .5rem;
    font-size: .875rem
}

.product-meta {
    flex-direction: column
}

.product-seller {
    align-items: center;
    margin-top: .75rem
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    align-items: flex-end;
    justify-content: flex-start;
    flex-shrink: 0
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-green-darker);
    text-align: center;
    border-radius: var(--radius-lg);
    min-width: 140px;
    white-space: nowrap
}

.mobile-filter-toggle {
    display: none;
    background: var(--primary-green);
    color: #fff;
    border: 0;
    padding: .875rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    width: 100%;
    font-size: 1rem;
    margin-bottom: 1.5rem
}

.mobile-filter-toggle:hover {
    background: var(--primary-green-hover)
}

.mobile-filter-toggle i {
    margin-right: .5rem
}

@media (max-width:1024px) {
    .search-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem 1rem
    }

    .search-main {
        order: 1
    }

    .mobile-filter-toggle {
        display: block
    }

.product-card {
    grid-template-columns: 150px 1fr;
    gap: 1rem
}

.product-actions {
    grid-column: 1/-1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem
}

.product-price {
    font-size: 1.25rem;
    padding: .625rem .875rem;
    min-width: 120px
}}

@media (max-width:768px) {
    .search-layout {
        padding: 1rem
    }

    .results-header {
        padding: 1.5rem
    }

    .results-header h1 {
        font-size: 1.5rem
    }

    .results-meta {
        font-size: 1rem
    }

    .sort-controls {
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
        text-align: center
    }

    .sort-select {
        min-width: auto;
        width: 100%
    }

    .results-list {
        padding: 1rem
    }

    .product-card {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 1rem;
        gap: 1rem
    }

    .product-image {
        max-width: 200px;
        margin: 0 auto;
        width: 100%
    }

    .product-info {
        text-align: left;
        gap: 0;
    }

    .product-title {
        font-size: 1rem
    }

    .product-description,.product-meta,.product-title {
        text-align: center
    }

    .product-meta {
        align-items: center;
        gap: 0;
    }

    .product-seller {
        justify-content: center
    }

    .product-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
        gap: .75rem;
        align-items: stretch;
        width: 100%;
    }

    .product-price {
        grid-row: 1;
        grid-column: 1;
        font-size: 1.125rem;
        padding: .5rem .75rem;
        margin-bottom: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%
    }
    .product-shipping {
        grid-column: 2;
        grid-row: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: .5rem .75rem;
        border-radius: var(--radius-md);
        font-size: 0.875rem;
    }
    
    .product-status{
      grid-column: 1 / -1;
    }
    .product-actions .btn-action:nth-of-type(1) {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
    }

    .product-actions .btn-action:nth-of-type(2) {
        grid-column: 1 / -1;
        grid-row: 3;
        width: 100%;
    }


    .sidebar-section {
        margin-bottom: 1.5rem
    }

}

@media (max-width:480px) {
    .search-layout {
        padding: .5rem
    }

    .results-header {
        padding: 1rem
    }

    .results-header h1 {
        font-size: 1.25rem
    }

    .results-meta {
        font-size: .9rem
    }

    .product-card,.results-list,.sort-controls {
        padding: .75rem
    }

    .product-card {
        margin-bottom: 1rem
    }

    .product-image {
        max-width: 250px;
        margin-bottom: 2rem;
    }

    .product-title {
        font-size: .95rem
    }

    .product-description {
        font-size: .8rem
    }

    .product-actions {
        grid-template-columns: 1fr 1fr;
        gap: .5rem;
    }

    .product-price {
        font-size: 1rem;
        padding: .375rem .5rem;
    }

    .product-shipping {
        font-size: 0.8rem;
        padding: .375rem .5rem;
    }

    .product-buttons {
        grid-row: 1/-1;
        gap: .375rem;
        justify-content: space-between;
        height: 100%
    }

    .sidebar-section {
        margin-bottom: 1rem
    }


    .form-group {
        margin-bottom: 1rem
    }

    .btn-filter,.form-control {
        font-size: .9rem;
        padding: .625rem
    }

    .btn-filter {
        padding: .75rem 1rem
    }
}

@media (max-width:360px) {
    .product-card {
        padding: .5rem
    }

    .product-image {
        max-width: 120px
    }

    .product-title {
        font-size: .875rem;
        line-height: 1.3
    }

    .product-description {
        font-size: .75rem
    }

    .product-actions {
        gap: .375rem
    }

    .product-price {
        font-size: .9rem;
        padding: .25rem .375rem
    }

    .product-actions .btn-action:nth-of-type(1),.product-actions .btn-action:nth-of-type(2) {
        grid-column: 2;
        grid-row: 1;
        width: 100%;
        max-width: none;
        min-width: auto
    }

    .product-actions .btn-action:nth-of-type(2) {
        grid-row: 2
    }

    .results-header h1 {
        font-size: 1.125rem
    }
}