/* ===== Work Areas ===== */
.work-areas {
    padding: 40px 16px 28px;
    text-align: center;
    overflow-x: clip;
    position: relative;
    margin-bottom: 2.3rem;
}

.work-areas__title {
    color: var(--color-white);
    margin: 0 0 18px;
    opacity: 50%;
}

/* Chips + Fade */
.work-areas__chips {
    --chips-max-h: 207px;
    --fade-height: 96px;
    --fade-overshoot: 140px;

    width: min(1100px, 92%);
    margin: 22px auto 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    position: relative;

    max-height: var(--chips-max-h);
    overflow-y: visible;
    overflow-x: clip;

    /* فقط پایین بریده شود (برای افکت گرادیان) */
    clip-path: inset(-9999px 0px 0px 0);

    /* انیمیشن ارتفاع */
    transition: height .36s cubic-bezier(.2,.8,.2,1);
    will-change: height;

    z-index: 1;
    flex-flow: wrap;
    align-content: flex-start;
}

@supports not (overflow: clip) {
    .work-areas__chips { overflow-x: hidden; }
}

/* گرادیان پوشاننده‌ی پایین با محوشدن نرم */
.work-areas__chips::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    top: calc(100% - var(--fade-height));
    height: calc(var(--fade-height) + var(--fade-overshoot));
    background: linear-gradient(to bottom, rgba(12, 10, 34, 0) 18%, rgba(12, 10, 34, 1) 51%);
    pointer-events: none;
    z-index: 3;
    opacity: 1;
    transition: opacity .36s cubic-bezier(.2,.8,.2,1);
}

/* حالت Expand (کاملاً باز) */
.work-areas.is-expanded .work-areas__chips {
    max-height: none;
}
.work-areas.is-expanded .work-areas__chips::after {
    opacity: 0; /* گرادیان محو می‌شود */
}

/* حالت Collapsing: گرادیان باید "فوراً" ظاهر شود و کلیپ همچنان غیرفعال بماند */

.work-areas.is-collapsing .work-areas__chips::after {
    opacity: 1;
    transition: none; /* بلافاصله نمایش داده شود */
}

/* Chip */
.chip {
    padding: 12px 20px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .14);
    color: rgb(255 255 255 / 76%);
    border-radius: 9999px;
    font-size: 24px;
    cursor: pointer;
    transition: background .2s, border-color .2s, transform .08s;
    font-weight: 300;
}
.chip:hover { background: #fff; border-color: #fff; color: #000; }
.chip:active { transform: translateY(1px); }

.chip-tip { position: relative; }

/* دکمهٔ بیشتر/بستن */
.work-areas__more {
    display: inline-block;
    margin-top: 22px;
    color: var(--color-white);
    text-decoration: none;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 0;
    font-weight: 700;
    font-size: 24px;
}
.work-areas__more:hover { color: var(--color-link-hover); }
.work-areas__more:focus-visible {
    outline: 2px solid var(--color-link-hover);
    outline-offset: 2px;
}

/* تولتیپ */
.mini-order-tooltip {
    max-width: 260px;
    inset-inline-start: 0;
    transform-origin: left bottom;
    z-index: 4;
}

/* ریسپانسیو */
@media (max-width: 640px) {
    .work-areas__title { font-size: 1.5rem; }
    .chip { font-size: 16px; padding: 10px 16px; }
    .work-areas__chips {
        --chips-max-h: 180px;
        --fade-height: 80px;
        --fade-overshoot: 120px;
        padding-top: 8px;
    }
    .work-areas__more{
        font-weight: 600;
        font-size: 18px;
    }
}
