/* ===============================
   HEADER
================================= */

.shafa-shop-header {
    max-width: 1200px;
    margin: 0 auto 24px;
    text-align: center;
}

.shafa-shop-title {
    font-size: 36px;
    font-weight: 700;
    font-size: 2.6rem;
    font-weight: 900;
    color: #dddddd;
    text-shadow: 1px 1px 4px rgb(0, 0, 0, 1);
    /* margin: .5em 0; */
    font-family: var(--font-smm);
    padding: 1em 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-accent));
}

.shafa-shop-description {
    max-width: 700px;
    margin: 0 auto;
    color: #666;
    font-size: 16px;
    font-family: var(--font-smm);
    font-size: clamp(16px, 1.4vw, 3em);
    line-height: 1.8;
    text-align: justify;
}


/* ===============================
   SHOP TOOLBAR (RESULTS + SORT)
================================= */

.shafa-shop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1em;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--bg-accent);
    /* background-color: red; */
    /* margin: auto 0; */
}

/* Results Text */

.shafa-results-count {
    padding: 0;
    font-size: 1.4rem;
    color: #555555;
    font-family: var(--font-nhd);
    white-space: nowrap;
}

/* Sorting */

.shafa-sorting form {
    margin: 0;
}

.shafa-orderby {
    padding: 10px 40px 10px 15px;
    border-radius: 8px;
    border: 1px solid var(--bg-accent);
    background: #fff;
    font-size: 14px;
    appearance: none;
    /* background: linear-gradient(135deg,
            var(--bg-accent),
            var(--bg-primary),
            var(--bg-accent));
    background-size: 200% 200%;
    background-position: left center;
    transition: background-position 0.5s ease; */
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: var(--font-smm) !important;
}

/* Custom dropdown arrow */

.shafa-sorting {
    position: relative;
}

.shafa-sorting::after {
    content: "▾";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 16px;
    color: #666;
    /* background-color: red; */
}

.shafa-orderby:hover {
    border-color: var(--bg-accent);
}

.shafa-orderby:focus {
    outline: none;
    border-color: var(--bg-primary);
}

/* ===============================
   RESPONSIVE TOOLBAR
================================= */

@media (max-width: 768px) {
    .shafa-shop-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .shafa-orderby {
        width: 100%;
    }

    .shafa-sorting {
        width: 100%;
    }
}

/* ===============================
   SHOP WRAPPER
================================= */

.shafa-shop-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}


/* ===============================
   PRODUCT GRID
================================= */

.shafa-products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 105px 20px;
}

/* ===============================
   PRODUCT CARD
================================= */

.shafa-product-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 0;
    padding-bottom: 1em;
    transition: all 0.3s ease;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;

}

.shafa-product-card:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    transform: translateY(-5px);
}

/* ===============================
   PRODUCT IMAGE
================================= */

.shafa-product-image {
    display: block;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 15px;
}

.shafa-product-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.4s ease;
    overflow: hidden;
}

.shafa-product-card:hover .shafa-product-image img {
    transform: scale(1.05);
}

/* ===============================
   PRODUCT TITLE
================================= */

.shafa-product-card .content {
    position: absolute;
    width: 100%;
    height: auto;
    min-height: 190px;
    /* padding: 1em 0.8em; */
    top: 110px;
    z-index: 1;
    border-radius: 20px 20px 3px 3px;
    display: flex;
    flex-direction: column;
    /* background-color: rgb(78, 10, 33); */
    /* background: linear-gradient(180deg, #001816, #0d9488); */
    background: #f3f3f3b0;
    backdrop-filter: blur(3px);
    border-left: 2px solid var(--bg-primary);
    border-right: 2px solid var(--bg-primary);
    border-bottom: 2px solid var(--bg-primary);
    /* padding: 0 20px; */
    box-sizing: border-box;
}


.shafa-product-title {
    font-size: clamp(12px, 1.4vw, 3em);
    font-weight: 500;
    color: #001816;
    /* margin: 0 0 8px; */
    /* line-height: 1.4; */
    font-family: var(--font-sllf);
    font-weight: 900;
    text-align: center;
    padding: .8em 0;
    /* background-color: red; */
    border-bottom: 1px dotted #464646;
    max-height: 55px;
    overflow-y: scroll;
}

.shafa-product-title a {
    text-decoration: none;
    color: #111;
}

.shafa-product-title a:hover {
    color: var(--bg-accent);
}

/* ===============================
   PRODUCT PRICE
================================= */

.shafa-product-price {
    /* font-size: 16px; */
    font-weight: 600;
    margin-bottom: 0;
    /* background-color: red; */
}

.shafa-product-price del {
    color: #999;
    font-weight: 400;
    margin-right: 5px;
}

.shafa-product-price ins {
    text-decoration: none;
    color: #e60023;
}


.woocommerce-Price-amount {
    font-family: var(--font-nhd);
    font-size: clamp(12px, 1.2vw, 3em);

    .woocommerce-Price-currencySymbol {
        font-size: clamp(12px, 1.2vw, 3em);
    }
}

.price-per-unit {
    margin-bottom: 3px;
    height: auto;
    text-align: center;
    font-family: var(--font-nhd);
    color: #001816;
    font-size: clamp(12px, 1.2vw, 3em);
}



/* ==================================
   ADD TO CART WRAPPER
================================== */


.add-to-cart-wrapper {
    margin-top: auto;
    width: 100%;
    /* background-color: red; */
}

.archive-add-to-cart-form {
    display: flex;
    flex-direction: column;
    gap: .5em;
    align-items: center;
    width: 100%;
}

.content .custom-button {
    border-radius: 10px 10px 0 0;
    width: 80%;
    margin: 0 auto;
}



/* ==================================
   QUANTITY INPUT GROUP
================================== */

.qty-with-unit {
    display: flex;
    align-items: center;
    background: #f7f7f7;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e5e5;
    /* min-width: 110px; */
    padding: 0;
    /* max-height: 10px; */
    max-height: 30px;
    width: 80%;
    margin: 0 auto;
    /* background-color: red !important; */


}

.archive-qty-input {
    width: 100%;
    border: none;
    /* padding: 0; */
    /* margin: 0; */
    text-align: center;
    background: transparent;
    direction: rtl;
    font-family: var(--font-nhd);
    font-size: clamp(14px, 1.2vw, 3em);
}

.archive-qty-input:focus {
    outline: none;
}

.qty-unit-label {
    background: #eee;
    padding: 4px 12px;
    font-size: 13px;
    color: #555;
    border-right: 1px solid #ddd;
}

/* Remove arrows for cleaner look */
.archive-qty-input::-webkit-outer-spin-button,
.archive-qty-input::-webkit-inner-spin-button {
    /* -webkit-appearance: none; */
    margin: 0;
}

.archive-qty-input[type=number] {
    -moz-appearance: textfield;
}

/* ===============================
   RESPONSIVE BREAKPOINTS
================================= */

/* Large Tablets */
@media (max-width: 1120px) {
    .shafa-products-grid {
        grid-template-columns: repeat(4, 1fr);
        /* gap: 85px 20px; */
    }
}

/* Tablets */
@media (max-width: 992px) {
    .shafa-products-grid {
        grid-template-columns: repeat(3, 1fr);
        /* gap: 85px 20px; */
    }

    .shafa-shop-title {
        font-size: 30px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .shafa-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 60px 20px;
    }

    .shafa-shop-wrapper {
        padding: 40px 15px;
    }

    .shafa-product-image img {
        height: 220px;
    }

    .shafa-product-title {
        font-size: 16px;
    }
}


/* Mobile */
@media (max-width: 496px) {
    .shafa-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 60px 10px;
    }

    .shafa-shop-wrapper {
        padding: 40px 15px;
    }

    .shafa-product-image img {
        height: 220px;
    }

    .shafa-product-title {
        font-size: 16px;
    }
}


@media (max-width: 992px) {
    .archive-add-to-cart-form {
        flex-direction: column;
        align-items: stretch;
    }

    .archive-add-btn {
        width: 100%;
    }

    .qty-with-unit {
        width: 80%;
        justify-content: space-between;
    }

    .archive-qty-input {
        width: 100%;
    }
}

/* Small mobile improvement */
@media (max-width: 480px) {
    .archive-qty-input {
        padding: 8px;
        font-size: 13px;
    }

    .archive-add-btn {
        font-size: 13px;
        padding: 10px;
    }
}



/* ===============================
   PAGINATION
================================= */

/* ===============================
   PAGINATION
================================= */

.shafa-pagination {
    margin-top: 120px;
    display: flex;
    justify-content: center;
}

.shafa-pagination ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.shafa-pagination li {
    list-style: none;
}

.shafa-pagination a,
.shafa-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    background: #f3f3f3;
    color: #111;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* Hover */
.shafa-pagination a:hover {
    background: #111;
    color: #fff;
}

/* Current page */
.shafa-pagination .current {
    background: #111;
    color: #fff;
}

/* Disabled (prev/next when inactive) */
.shafa-pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}


@media (max-width: 460px) {

    .shafa-pagination ul {
        gap: 6px;
    }

    .shafa-pagination a,
    .shafa-pagination span {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
        padding: 0 10px;
    }

    /* Hide all page numbers except:
       - first item (prev)
       - last item (next)
       - current page
    */
    .shafa-pagination li {
        display: none;
    }

    .shafa-pagination li:first-child,
    .shafa-pagination li:last-child,
    .shafa-pagination li .current {
        display: flex;
    }
}