* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.title-section {
    max-width: 1300px;
    margin: 0px auto;
    display: flex;
    align-items: center;
    justify-content: start;
    padding: 20px 0px;
    gap: 4px;
}

.title-section span i {
    color: var(--primary-color);
}

.opne-filter-btn {
    display: none;
}

.Home-title-section {
    color: var(--primary-color);
}

.link-clear-filters {
    text-decoration: none;
    line-height: 1.4;
    text-align: center;
    font-size: 14px;
    font-weight: 400;
    color: var(--primary-color);
    background-color: rgb(237, 237, 237);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    height: 48px;
}

/* base grid (stretches cards to fill row when many items) */
.products-grid{
    width: 100%;
    margin: 0 auto 50px;
    display: grid;
    gap: 25px;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    align-items: start;
    padding: 0;
    align-items: stretch;
    box-sizing: border-box;
}

/* product card */
.product-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 15px;
    height: 100%;
    box-sizing: border-box;
    width: 100%;
}

/* If there is exactly 1 product -> keep normal width and center it */
.products-grid:has(> .product-card:only-child) {
    grid-template-columns: 290px;
    justify-content: right; /* center the single column */
}

/* If there are exactly 2 products -> keep normal width for both and center them */
.products-grid:has(> .product-card:nth-child(2):last-child) {
    grid-template-columns: repeat(2, 290px);
    justify-content: right;
}



.product-card:hover {
    transform: translateY(-5px);
}

.checkout-card-button {
    background-color: var(--primary-color);
    flex: 1;
    width: 100%;
    color: white;
    height: 48px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
}

.checkout-card-button:hover {
    background-color: hsl(156, 95%, 32%);
    color: white;
    border: 1px solid hsl(156, 99%, 27%);
    transition: all 0.3s ease;
}

.checkout-card-favorite-button {
    height: 48px;
    padding: 0px 32px;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkout-card-favorite-button:hover {
    background-color: hsl(156, 95%, 32%);
    color: white;
    border: 1px solid hsl(156, 99%, 27%);
    transition: all 0.3s ease;
}

.checkout-card-favorite-button.active {
    background-color: hsl(352, 100%, 62%);
    color: white;
    border: 1px solid hsl(0, 100%, 58%);
    transition: all 0.3s ease;
}

.product-img {
    width: 100%;
    height: 300px;
    overflow: hidden;
    border-radius: 6px;
}
.products-section{
    width: 100%;
}

#products-details-container{
    margin-top: 20px;
    margin-bottom: 20px;
    direction: rtl;
}

.products-title{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0px;
    font-size: 32px;
}
.products-paragraph{
    font-size: 16px;
    color: #00000099;
}
.checkout-card-buttons-container {
    width: 100%;
    display: flex;
    gap: 8px;
    margin-top: 8px;
}


.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.card-profuct-prices-container {
    display: flex;
    margin-top: 0px;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 6px;
}
.old-card-profuct-price {
    font-size: 16px;
    margin-top: 0px;
    color: #474747;
    font-family: "Courier New", Courier, monospace;
    font-weight: 600;
    text-decoration: line-through;
}

.card-profuct-prices-container {
    display: flex;
    margin-top: 0px;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 6px;
}
.discount-amount-card-product {
    background-color: #b6ffde;
    border: 0.5px solid #01a35a;
    color: #01a35a;
    padding: 0px 16px;
    font-size: 14px;
    border-radius: 16px;
    line-height: 1;
    height: 20px;
    padding-top: 3px;
}
.product-price-seaction {
    display: flex;
    margin-top: 0px;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    direction: ltr;
}
.product-card:hover .product-img img {
    transform: scale(1.05);
}

.product-title {
    font-size: 16px;
    width: 100%;
    text-align: start;
    direction: rtl;
    margin: 10px 0 4px 0;
    color: #333;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}



.contener {
    max-width: 1300px;
    margin: 0px auto 50px auto;
    display: flex;
    align-items: start;
    justify-content: start;
    gap: 20px;
    position: relative;
}

.filter-section {
    width: 26%;
    min-width: 306px;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border: 1px solid #dddddd;
    padding: 10px 25px;
    gap: 20px;
    position: sticky;
    top: 10px;
}

.close-filter-section-class {
    display: none;
}

.filter-title {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0px 20px 0px;
    border-bottom: 2px solid rgba(83, 83, 83, 0.082);
}

.filter-title span {
    line-height: 1;
    font-size: 20px;
}
.filter-title span img {
    line-height: 1;
    font-size: 20px;
    margin-top: 5px;
}

.catigory-filter {
    padding: 0px 0px 20px 0px;
    border-bottom: 1px solid rgba(83, 83, 83, 0.082);
}


#filter-overlay{
    display: none;
}
.catigory-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sub-filter-title {
    font-size: 18px;
    color: var(--primary-color);
}

.catigory-itme {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0px;
}

.catigory-name {
    color: #666666;
    font-weight: 500;
}

.catigory-icon i {
    color: #00000099;
    line-height: 1;
}

.color-filter {
    border-bottom: 2px solid rgba(83, 83, 83, 0.082);
    padding: 0px 0px 10px 0px;
}

.color-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 5px;
}

.color-head {
    font-size: 20px;
}





.descount {
    color: #ff3333;
    background-color: #ff33331a;
    border-radius: 62px;
    width: 58px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.buttons-filter {
    width: 100%;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

/* pagiation-section */

.pagiation-section {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row-reverse;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.089);
}
.pagiation-section .pagition-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pagiation-section .pagition-btn button i {
    line-height: 1;
}

.pagiation-section .pagition-btn button {
    height: 40px;
    border: 1px solid #0000001a;
    border-radius: 8px;
    padding: 0px 20px;
    cursor: pointer;
    background: none;
}

.pagition-button button {
    height: 40px;
    width: 40px;
    cursor: pointer;
    border-radius: 8px;
    background: none;
    border: none;
    color: #00000080;
}

.pagition-button button.active {
    height: 40px;
    width: 40px;
    cursor: pointer;
    border-radius: 8px;
    background-color: #0000000f;
    border: none;
    color: #000000;
}

#sort_by_select:focus {
    outline: none;
}

.handle {
    width: 20px;
    height: 20px;
    background-color: #000;
    border-radius: 50%;
    position: absolute;
    top: -7.5px;
    z-index: 2;
}

.price-values p {
    user-select: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
}



@keyframes filteranimation {
    from {
        top: 100%;
        width: 100%;
        bottom: 0px;
    }
    to {
        top: 100px; /* حسب ما تريد */
        width: 100%;
        bottom: 0px;
    }
}

@keyframes filteranimation2 {
    from {
        top: 100px; /* حسب ما تريد */
        width: 100%;
        bottom: 0px;
    }
    to {
        top: 100%;
        width: 100%;
        bottom: 0px;
    }
}








.category-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    justify-content: space-between;
    font-size: 16px;
    user-select: none;
    gap: 8px;
    direction: ltr;
    width: 100%;
}

.category-checkbox-input {
    display: none;
}

/* Custom checkbox box */
.category-checkbox .checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    position: relative;
    display: inline-block;
    transition: all 0.2s ease;
}

/* Checkmark when checked */
.category-checkbox-input:checked + .checkmark::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Fill background when checked */
.category-checkbox-input:checked + .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}


.price-range-input {
    width: 100%;
}


.price-range-container {
    display: flex;
    justify-content: space-between;
    padding: 6px 0px 0px 0px;
}

.price-range-container p {
    color: var(--primary-color);
    font-size: 16px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 400;
}

.custom-range-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 20px 0;
  direction: ltr;
}

.price-range-input {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  background: transparent; 
  position: relative;
  z-index: 2;
  cursor: pointer;
  border-radius: 4px;
  outline: none;
}

.price-range-input::-webkit-slider-runnable-track {
  height: 8px;
  background: transparent;
}

.price-filter{
    border-bottom-width: 1px;
    border-bottom-color: rgba(83, 83, 83, 0.082);
    border-bottom-style: solid;
}

.price-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background-color: var(--primary-color);
  border-radius: 50%;
  margin-top: -6px; 
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
  transition: background 0.3s ease;
}

.price-range-input::-webkit-slider-thumb:hover {
  background-color: var(--primary-color);
}

.price-range-input::-moz-range-track {
  height: 8px;
  background: transparent;
}

.price-range-input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background-color: var(--primary-color);
  border-radius: 50%;
  border: none;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}


.price-range-input:focus::-webkit-slider-thumb,
.price-range-input:focus::-moz-range-thumb {
  outline: none;
}


#apply-filter-button {
    width: 100%;
    height: 48px;
    background-color: var(--primary-color);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-size: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s linear;
}

#apply-filter-button:hover {
    background-color: #ececec;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}


@media (max-width: 1300px) {
    #products-details-container {
        padding-left: 20px;
        padding-right: 20px;
    }
}




@media (max-width: 1024px) {


    #filter-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        backdrop-filter: blur(5px);
        background-color: rgba(0, 0, 0, 0.2);
        z-index: 1;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    #filter-overlay.active {
        opacity: 1;
        pointer-events: all;
    }


    .filter-section {
        position: fixed;
        right: 0px;
        background-color: rgb(255, 255, 255);
        top: 100%;
        width: 100%;
        z-index: 2;
        bottom: 0px;
        padding-bottom: 20px;
    }
    .close-filter-section-class {
        display: flex;
    }
    #close-filter-section {
        cursor: pointer;
    }

    .close-filter-section-class i {
        font-size: 30px;
    }
    .filter-title span img {
        display: none;
    }
    .opne-filter-btn {
        display: flex;
        margin-right: auto;
        cursor: pointer;
    }
    .products-paragraph{
        margin-right: 20px;
    }

    .custom-range-wrapper{
        width: 100%;
        max-width: 1024px;
    }

}


@media (max-width: 700px) {


     


    .products-grid {
        width: 100%;
        margin: 0 auto 50px;
        display: grid;
        grid-template-columns: repeat(2, 1fr); 
        justify-content: space-between;
        gap: 4px; 
    }

    .products-grid:has(> .product-card:only-child) {
         grid-template-columns: repeat(2, 1fr); 
    }

    /* If there are exactly 2 products -> keep normal width for both and center them */
    .products-grid:has(> .product-card:nth-child(2):last-child) {
        grid-template-columns: repeat(2, 1fr); 
    }

    

    .products-title-text {
        font-size: 20px;
    }

    .products-paragraph {
        font-size: 14px;
    }

    .opne-filter-btn img {
        width: 24px;
        height: 24px;
    }

    .product-img {
        height: 170px;
    }

    .product-card {
        position: relative;
    }

    .product-title {
        font-size: 14px;
        line-height: 1.2;
    }

    .discount-amount-card-product {
        position: absolute;
        top: 20px;
        right: 8px;
    }

    .card-profuct-prices-container {
        justify-content: space-between;
        width: 100%;
    }


    .old-card-profuct-price{
        font-size: 12px;
    }


    .card-profuct-price{
        font-size: 14px;
    }

    .checkout-card-buttons-container {
        flex-direction: column-reverse;
    }

    .checkout-card-button{
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .checkout-card-favorite-button {
        height: fit-content;
        padding-top: 5px;
        padding-bottom: 5px;
    }
}



@media (max-width: 350px) {

    .products-grid {
        width: 100%;
        margin: 0px auto 50px;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 25px;
    }

    .products-grid:has(> .product-card:only-child) {
         grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    /* If there are exactly 2 products -> keep normal width for both and center them */
    .products-grid:has(> .product-card:nth-child(2):last-child) {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .product-card {
        max-width: 400px;
    }

    .product-img {
        height: 300px;
    }

    .pagiation-section {
        display: flex;
        flex-direction: column-reverse;
        gap: 10px;
    }
}


.animate-content-fade-in {
    animation: fadeIn 0.3s linear;
}


@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.no-products-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 80px 20px;
    min-height: 400px;
}

.no-products-card {
    text-align: center;
    padding: 40px 30px;
    border-radius: 15px;
    max-width: 400px;
    width: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}


.no-products-image {
    width: 160px;
    margin-bottom: 20px;
}


.no-products-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.no-products-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.no-products-button {
    display: inline-block;
    padding: 12px 25px;
    background-color: var(--primary-color); /* Indigo */
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s ease;
}

.no-products-button:hover {
    background-color: rgb(84, 84, 84);
}