/*
|--------------------------------------------------------------------------
| Category Page
|--------------------------------------------------------------------------
*/

.category-page {
    position: relative;

    min-height: 70vh;

    padding-top: clamp(40px, 6vw, 78px);
    padding-bottom: clamp(80px, 9vw, 130px);
}

.category-results-section {
    position: relative;
}

/*
|--------------------------------------------------------------------------
| Page heading
|--------------------------------------------------------------------------
*/

.category-page-heading {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;

    min-height: 125px;
}

.category-page-heading .heading-content {
    position: relative;
    z-index: 2;
}

.category-page-heading h1 {
    position: relative;

    margin: 8px 0 0;

    color: var(--ink, #263022);

    font-size: clamp(1.6rem, 3vw, 2.25rem);
    font-weight: 900;

    letter-spacing: -0.045em;
}

.category-page-heading h1::after {
    content: "";

    display: inline-block;

    width: 8px;
    height: 8px;

    margin-right: 10px;

    border-radius: 50%;

    background: var(--clay, #c88968);

    box-shadow:
        0 0 0 6px rgba(200, 137, 104, 0.12);
}

.category-page-description {
    margin: 13px 0 0;

    color: var(--muted, #757d6d);

    font-size: 0.94rem;
    line-height: 1.9;
}

.category-heading-art {
    position: relative;

    flex: 0 0 170px;

    width: 170px;
    height: 100px;
}

.category-heading-art svg {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    fill: none;

    stroke: rgba(127, 159, 89, 0.48);
    stroke-width: 2.3;
    stroke-linecap: round;
}

.art-bead {
    position: absolute;
    z-index: 2;

    display: block;

    border: 3px solid rgba(255, 255, 255, 0.85);
    border-radius: 50%;

    box-shadow:
        0 8px 16px rgba(70, 88, 58, 0.13);
}

.art-bead-one {
    top: 27px;
    right: 127px;

    width: 16px;
    height: 16px;

    background: var(--sage, #b7d58a);
}

.art-bead-two {
    top: 47px;
    right: 76px;

    width: 21px;
    height: 21px;

    background: var(--clay, #c88968);
}

.art-bead-three {
    top: 25px;
    right: 18px;

    width: 13px;
    height: 13px;

    background: var(--gold, #d7af61);
}

/*
|--------------------------------------------------------------------------
| Product stage
|--------------------------------------------------------------------------
*/

.category-products-stage {
    position: relative;

    margin-top: 26px;
    padding:
        clamp(22px, 4vw, 48px)
        clamp(15px, 3vw, 34px)
        clamp(30px, 5vw, 55px);

    overflow: hidden;

    border: 1px solid rgba(255, 255, 255, 0.84);
    border-radius: var(--radius-xl, 42px);

    background:
        radial-gradient(
            circle at 8% 13%,
            rgba(183, 213, 138, 0.19),
            transparent 20rem
        ),
        radial-gradient(
            circle at 94% 90%,
            rgba(200, 137, 104, 0.10),
            transparent 18rem
        ),
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.70),
            rgba(255, 250, 236, 0.52)
        );

    box-shadow:
        0 24px 70px rgba(66, 82, 52, 0.11),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);

    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
}

.category-stage-decoration {
    position: absolute;

    border: 1px solid rgba(127, 159, 89, 0.13);
    border-radius: 50%;

    pointer-events: none;
}

.decoration-one {
    top: -105px;
    left: -65px;

    width: 260px;
    height: 260px;
}

.decoration-one::before,
.decoration-one::after {
    content: "";

    position: absolute;

    border: inherit;
    border-radius: inherit;
}

.decoration-one::before {
    inset: 22px;
}

.decoration-one::after {
    inset: 48px;
}

.decoration-two {
    right: -90px;
    bottom: -135px;

    width: 310px;
    height: 310px;

    border-color: rgba(200, 137, 104, 0.11);
}

.category-stage-thread {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;

    width: 100%;
    height: 90px;

    fill: none;

    stroke: rgba(127, 159, 89, 0.13);
    stroke-width: 2;

    pointer-events: none;
}

/*
|--------------------------------------------------------------------------
| Dynamic products container
|--------------------------------------------------------------------------
*/

.category-products-container {
    position: relative;
    z-index: 2;

    width: 100%;

    margin: 0 !important;
    padding: 0 !important;
}

/*
|--------------------------------------------------------------------------
| Bootstrap rows generated by category.js
|--------------------------------------------------------------------------
*/

#category > .row,
#category .product-row,
#category .row {
    display: grid !important;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 22px;

    width: 100%;

    margin: 0 0 24px !important;
}

#category > .row:last-child,
#category .product-row:last-child,
#category .row:last-child {
    margin-bottom: 0 !important;
}

#category .row > [class*="col-"],
#category .product-row > [class*="col-"] {
    width: 100% !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;
}

/*
|--------------------------------------------------------------------------
| Product cards
|--------------------------------------------------------------------------
*/

#category .card {
    position: relative;

    display: flex;
    flex-direction: column;

    min-width: 0 !important;
    min-height: 390px;
    height: 100% !important;

    margin: 0 !important;
    padding: 10px !important;

    overflow: hidden;

    border: 1px solid rgba(255, 255, 255, 0.90) !important;
    border-radius: 29px !important;

    background:
        linear-gradient(
            155deg,
            rgba(255, 255, 255, 0.98),
            rgba(255, 252, 242, 0.95)
        ) !important;

    box-shadow:
        0 16px 38px rgba(59, 73, 46, 0.11) !important;

    transition:
        transform 260ms cubic-bezier(0.2, 0.75, 0.25, 1),
        box-shadow 260ms ease,
        border-color 260ms ease !important;
}

#category .card::after {
    content: "";

    position: absolute;
    z-index: 0;
    right: -30px;
    bottom: -42px;

    width: 125px;
    height: 125px;

    border: 1px solid rgba(183, 213, 138, 0.12);
    border-radius: 50%;

    pointer-events: none;
}

#category .card:hover {
    border-color:
        rgba(127, 159, 89, 0.35) !important;

    box-shadow:
        0 25px 58px rgba(59, 73, 46, 0.17) !important;

    transform:
        translateY(-8px) !important;
}

/*
|--------------------------------------------------------------------------
| Handmade badge inserted by category-ui.js
|--------------------------------------------------------------------------
*/

.category-handmade-badge {
    display: none !important;

    position: absolute;
    z-index: 5;
    top: 19px;
    right: 19px;

    display: inline-flex;
    align-items: center;

    gap: 6px;

    padding: 6px 10px;

    color: #ffffff;

    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;

    background:
        rgba(96, 121, 74, 0.82);

    box-shadow:
        0 8px 18px rgba(53, 70, 44, 0.16);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    font-size: 0.67rem;
    font-weight: 800;
}

.category-handmade-badge::before {
    content: "";

    width: 6px;
    height: 6px;

    border: 2px solid rgba(255, 255, 255, 0.78);
    border-radius: 50%;
}

/*
|--------------------------------------------------------------------------
| Product image
|--------------------------------------------------------------------------
*/

#category .card-img-top,
#category .product-image {
    position: relative;
    z-index: 1;

    display: block;
    order: 1;

    width: 100% !important;
    height: 220px !important;

    padding: 0 !important;

    object-fit: cover;

    border: 0 !important;
    border-radius: 22px !important;

    background: #f4f3e9;

    transition:
        transform 480ms ease,
        filter 480ms ease;
}

#category .card:hover .card-img-top,
#category .card:hover .product-image {
    filter:
        saturate(1.05)
        contrast(1.02);

    transform: scale(1.025);
}

/*
|--------------------------------------------------------------------------
| Card body
|--------------------------------------------------------------------------
*/

#category .card-body {
    position: relative;
    z-index: 2;

    display: flex;
    order: 2;
    flex: 1;
    flex-direction: column;

    padding: 17px 10px 8px !important;

    direction: rtl;
}

#category .card-title {
    display: -webkit-box;

    min-height: 54px;

    margin: 0 !important;

    overflow: hidden;

    color: var(--ink, #263022) !important;

    font-size: 1rem !important;
    font-weight: 900 !important;
    line-height: 1.75 !important;

    text-align: right;

    white-space: normal;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/*
|--------------------------------------------------------------------------
| Price
|--------------------------------------------------------------------------
*/

#category .price {
    display: flex;
    align-items: baseline;

    gap: 5px;

    min-height: 32px;

    margin: 9px 0 0 !important;

    color:
        var(--sage-deep, #60794a) !important;

    font-size: 1.1rem !important;
    font-weight: 900 !important;

    direction: rtl;
}

#category .price::after {
    content: none !important;
}

#category .price-number {
    color:
        var(--sage-deep, #60794a);

    font-size: 1.08rem;
    font-weight: 900;
}

#category .price-currency {
    color:
        var(--muted, #757d6d);

    font-size: 0.73rem;
    font-weight: 600;
}

/*
|--------------------------------------------------------------------------
| View product button
|--------------------------------------------------------------------------
*/

#category .see-btn,
#category .btn-yellow {
    position: relative;
    z-index: 2;

    display: flex !important;
    align-items: center;
    justify-content: space-between;

    width: 100% !important;
    min-height: 46px;

    gap: 10px;

    margin-top: auto !important;
    padding: 10px 16px !important;

    color: #ffffff !important;

    border: 0 !important;
    border-radius: 15px !important;

    background:
        linear-gradient(
            135deg,
            var(--sage, #b7d58a),
            var(--sage-dark, #7f9f59)
        ) !important;

    box-shadow:
        0 12px 25px rgba(105, 137, 76, 0.21);

    font-size: 0.87rem !important;
    font-weight: 850 !important;

    text-decoration: none !important;

    transition:
        transform 220ms ease,
        box-shadow 220ms ease,
        filter 220ms ease;
}

#category .see-btn::after,
#category .btn-yellow::after {
    content: "←";

    display: grid;
    place-items: center;

    width: 27px;
    height: 27px;

    color: var(--sage-deep, #60794a);

    border-radius: 9px;

    background: rgba(255, 255, 255, 0.68);

    font-size: 0.95rem;

    transition:
        transform 220ms ease,
        background 220ms ease;
}

#category .see-btn:hover,
#category .btn-yellow:hover {
    color: #ffffff !important;

    filter: saturate(1.08);

    box-shadow:
        0 16px 31px rgba(105, 137, 76, 0.29);

    transform: translateY(-2px);
}

#category .see-btn:hover::after,
#category .btn-yellow:hover::after {
    background: #ffffff;
    transform: translateX(-3px);
}

/*
|--------------------------------------------------------------------------
| Empty and error state
|--------------------------------------------------------------------------
*/

.category-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    min-height: 310px;

    gap: 15px;
    padding: 35px;

    color: var(--muted, #757d6d);

    border: 1px dashed rgba(127, 159, 89, 0.30);
    border-radius: 27px;

    background: rgba(255, 255, 255, 0.45);

    text-align: center;
}

.category-image-fallback {
    order: 1;
    width: 100%;
    min-height: 220px;
    padding: 24px;
    border-radius: 22px;
}

.category-empty-state svg {
    width: 55px;
    height: 55px;

    fill: none;
    stroke: var(--sage-dark, #7f9f59);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/*
|--------------------------------------------------------------------------
| Custom alert modal
|--------------------------------------------------------------------------
*/

.category-modal-overlay {
    position: fixed;
    z-index: 99999;
    inset: 0;

    display: grid;
    place-items: center;

    padding: 20px;

    visibility: hidden;

    background: rgba(46, 58, 38, 0.36);

    opacity: 0;

    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);

    transition:
        opacity 220ms ease,
        visibility 220ms ease;
}

.category-modal-overlay.is-visible {
    visibility: visible;
    opacity: 1;
}

.category-modal {
    position: relative;

    width: min(100%, 430px);

    padding: 34px 26px 25px;

    overflow: hidden;

    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: 29px;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.98),
            rgba(255, 250, 237, 0.97)
        );

    box-shadow:
        0 28px 80px rgba(45, 58, 36, 0.23);

    text-align: center;

    transform:
        translateY(16px)
        scale(0.97);

    transition: transform 240ms ease;
}

.category-modal-overlay.is-visible .category-modal {
    transform:
        translateY(0)
        scale(1);
}

.category-modal::before {
    content: "";

    position: absolute;
    top: -90px;
    right: -75px;

    width: 210px;
    height: 210px;

    border: 1px solid rgba(183, 213, 138, 0.18);
    border-radius: 50%;
}

.category-modal-icon {
    position: relative;

    display: grid;
    place-items: center;

    width: 72px;
    height: 72px;

    margin: 0 auto 18px;

    color: var(--sage-deep, #60794a);

    border-radius: 23px;

    background: rgba(183, 213, 138, 0.24);
}

.category-modal-icon svg {
    width: 36px;
    height: 36px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.category-modal h3 {
    position: relative;

    margin: 0 0 10px;

    color: var(--ink, #263022);

    font-size: 1.18rem;
    font-weight: 900;
}

.category-modal p {
    position: relative;

    margin: 0;

    color: var(--muted, #757d6d);

    font-size: 0.92rem;
    line-height: 1.9;
}

.category-modal-action {
    position: relative;

    width: 100%;
    min-height: 46px;

    margin-top: 23px;

    color: #ffffff;

    border: 0;
    border-radius: 15px;

    background:
        linear-gradient(
            135deg,
            var(--sage, #b7d58a),
            var(--sage-dark, #7f9f59)
        );

    box-shadow:
        0 12px 25px rgba(105, 137, 76, 0.22);

    font-weight: 850;

    cursor: pointer;
}

.category-modal-close {
    position: absolute;
    z-index: 4;
    top: 14px;
    left: 14px;

    display: grid;
    place-items: center;

    width: 35px;
    height: 35px;

    padding: 0;

    color: var(--muted, #757d6d);

    border: 0;
    border-radius: 50%;

    background: rgba(127, 159, 89, 0.10);

    cursor: pointer;
}

/*
|--------------------------------------------------------------------------
| Tablet
|--------------------------------------------------------------------------
*/

@media only screen and (max-width: 1100px) {
    #category > .row,
    #category .product-row,
    #category .row {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}

@media only screen and (max-width: 850px) {
    #category > .row,
    #category .product-row,
    #category .row {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .category-heading-art {
        flex-basis: 135px;

        width: 135px;
        height: 85px;
    }

    #category .card-img-top,
    #category .product-image {
        height: 210px !important;
    }
}

/*
|--------------------------------------------------------------------------
| Mobile
|--------------------------------------------------------------------------
*/

@media only screen and (max-width: 576px) {
    .category-page {
        padding-top: 36px;
        padding-bottom: 85px;
    }

    .category-page-heading {
        align-items: flex-start;

        min-height: auto;
    }

    .category-heading-art {
        position: absolute;
        top: -15px;
        left: 12px;

        width: 100px;
        height: 70px;

        opacity: 0.58;
    }

    .category-page-description {
        max-width: 76%;

        font-size: 0.84rem;
    }

    .category-products-stage {
        padding: 18px 12px 30px;

        border-radius: 29px;
    }

    #category > .row,
    #category .product-row,
    #category .row {
        grid-template-columns: 1fr;

        gap: 17px;
    }

    #category .card {
        min-height: 390px;

        border-radius: 25px !important;
    }

    #category .card-img-top,
    #category .product-image {
        height: 245px !important;
    }
}

/*
|--------------------------------------------------------------------------
| Very small screens
|--------------------------------------------------------------------------
*/

@media only screen and (max-width: 390px) {
    #category .card-img-top,
    #category .product-image {
        height: 215px !important;
    }

    .category-page-description {
        max-width: 100%;

        padding-left: 80px;
    }
}

/*
|--------------------------------------------------------------------------
| Reduced motion
|--------------------------------------------------------------------------
*/

@media (prefers-reduced-motion: reduce) {
    #category .card,
    #category .card-img-top,
    #category .product-image,
    #category .see-btn,
    #category .btn-yellow {
        transition: none !important;
    }
}
