/* =========================================================
   JALALI CALENDAR
   ========================================================= */

.jalali-calendar {
    width: 315px;
    padding: 16px 14px 18px;

    background: #ffffff;
    border-radius: 14px;

    direction: rtl;
    user-select: none;
    box-sizing: border-box;
}


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

.calendar-header {
    display: grid;
    grid-template-columns: 36px 1fr 36px;
    align-items: center;

    min-height: 38px;
    margin-bottom: 13px;
}

.calendar-month-title {
    text-align: center;

    color: #2d211a;

    font-family: "Vazir", Tahoma, sans-serif;
    font-size: 15px;
    font-weight: 700;

    white-space: nowrap;
}

.calendar-nav-button {
    width: 32px;
    height: 32px;

    padding: 0;

    border: 0;
    background: transparent;

    color: #9a9ca5;

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

    border-radius: 8px;

    font-size: 14px;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.calendar-nav-button:hover {
    background: #f5f0eb;
    color: #6b4632;
}


/* =========================================================
   WEEKDAYS
   ========================================================= */

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    align-items: center;

    margin-bottom: 4px;
}

.calendar-weekdays span {
    height: 34px;

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

    color: #777b86;

    font-family: "Vazir", Tahoma, sans-serif;
    font-size: 13px;
    font-weight: 400;
}


/* =========================================================
   DAYS
   ========================================================= */

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 41px;
}

.calendar-day {
    position: relative;

    width: 38px;
    height: 38px;

    margin: auto;

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

    border: 1px solid transparent;
    border-radius: 5px;

    background: transparent;

    color: #777b86;

    font-family: "Vazir FD", "Vazir", Tahoma, sans-serif;
    font-size: 13px;
    font-weight: 400;

    cursor: pointer;

    transition:
        background 0.12s ease,
        border-color 0.12s ease,
        color 0.12s ease;
}


/* =========================================================
   CURRENT MONTH
   ========================================================= */

.calendar-day.current-month {
    color: #646873;
}


/* =========================================================
   OTHER MONTH DAYS
   ========================================================= */

.calendar-day.other-month {
    color: #c9cbd1;
}


/* =========================================================
   HOVER
   ========================================================= */

.calendar-day.current-month:not(.disabled):hover {
    background: #f5f0eb;
    color: #3a2418;
}


/* =========================================================
   FRIDAY
   ========================================================= */

.calendar-day.friday {
    color: #d62f2f;
}


/* =========================================================
   SELECTED
   ========================================================= */

.calendar-day.selected {
    border-color: #6d7480;

    color: #3f4650;
    background: #ffffff;
}

.calendar-day.selected.friday {
    color: #d62f2f;
}


/* =========================================================
   TODAY
   ========================================================= */

.calendar-day.today {
    font-weight: 700;
}


/* =========================================================
   DISABLED
   ========================================================= */

.calendar-day.disabled {
    cursor: default;
    color: #d5d7dc;
}


/* =========================================================
   MOBILE CALENDAR
   ========================================================= */

@media (max-width: 480px) {

    .jalali-calendar {
        width: 100%;
        max-width: 315px;

        padding-left: 10px;
        padding-right: 10px;
    }

    .calendar-day {
        width: 36px;
        height: 36px;
    }
}


/* =========================================================
   HOME DATE FIELD
   ========================================================= */

.home-date-field {
    position: relative;
}


/*
 * IMPORTANT:
 *
 * direction: ltr makes the calendar icon stay
 * physically on the LEFT side.
 *
 * The button itself remains RTL so the Persian
 * date text is displayed correctly.
 */

.home-date-field .field-input-wrapper {
    position: relative;

    display: flex;
    align-items: center;

    direction: ltr;

    gap: 10px;
}


/* =========================================================
   CALENDAR ICON
   ========================================================= */

.home-date-field .field-input-wrapper > i {
    position: static;

    order: 1;

    flex: 0 0 auto;

    margin: 0;

    color: #777b86;

    font-size: 16px;

    pointer-events: none;
}


/* =========================================================
   DATE BUTTON
   ========================================================= */

.home-date-button {
    order: 2;

    flex: 1 1 auto;

    min-width: 0;

    width: auto;
    height: 100%;

    padding: 0;
    margin: 0;

    border: 0;
    outline: none;

    background: transparent;

    color: #777b86;

    font-family: "Vazir", Tahoma, sans-serif;
    font-size: 13px;
    font-weight: 400;

    text-align: right;
    direction: rtl;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    cursor: pointer;
}

.home-date-button.has-value {
    color: #2d211a;
}


/* =========================================================
   CALENDAR POSITION
   ========================================================= */

.home-date-field .home-calendar-wrapper {
    position: absolute;

    top: calc(100% + 10px);
    right: 0;

    z-index: 1000;
}


/*
 * Calendar is hidden by default.
 */

.home-date-field .home-calendar-wrapper .jalali-calendar {
    display: none;

    box-shadow:
        0 12px 35px rgba(58, 36, 24, 0.14);

    border: 1px solid #e5dbd0;
}


/*
 * JS adds "is-open" to the calendar.
 */

.home-date-field .home-calendar-wrapper
.jalali-calendar.is-open {
    display: block;
}


/* =========================================================
   RESPONSIVE DATE FIELD
   ========================================================= */

@media (max-width: 600px) {

    .home-date-field .home-calendar-wrapper {
        right: 50%;
        transform: translateX(50%);
    }
}


/* =========================================================
   FONTS
   ========================================================= */

/* Normal Vazir */

@font-face {
    font-family: "Vazir";

    src:
        url("../fonts/vazir-font/Vazir.woff2")
        format("woff2");

    font-weight: 400;
    font-style: normal;
    font-display: swap;
}


/* Vazir Bold */

@font-face {
    font-family: "Vazir";

    src:
        url("../fonts/vazir-font/Vazir-Bold.woff2")
        format("woff2");

    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


/* =========================================================
   VAZIR FONT WITH PERSIAN DIGITS
   ========================================================= */

@font-face {
    font-family: "Vazir FD";

    src:
        url("../fonts/vazir-font/Vazir-FD-WOL.woff2")
        format("woff2");

    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazir FD";

    src:
        url("../fonts/vazir-font/Vazir-Bold-FD-WOL.woff2")
        format("woff2");

    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


/* =========================================================
   LIGHT FONT
   ========================================================= */

@font-face {
    font-family: "Vazir";

    src:
        url("../fonts/vazir-font/Vazir-Light-FD-WOL.woff2")
        format("woff2");

    font-weight: 300;
    font-style: normal;
    font-display: swap;
}