/*
 * Small, production-safe UI fixes that must load independently of the legacy
 * child-theme stylesheet. Keep every rule tightly scoped.
 */

/* Checkout: the coupon heading already contains the instruction. */
body.woocommerce-checkout .e-coupon-anchor-description {
    display: none !important;
}

/*
 * Checkout activation-date calendar. Flatpickr itself is initialized by the
 * existing checkout widget; these rules only correct RTL layout and overflow.
 */
body.woocommerce-checkout .flatpickr-calendar {
    direction: rtl;
    z-index: 1000000 !important;
    max-width: calc(100vw - 24px);
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    font-family: "coherentic", Sans-serif;
    box-shadow: 0 16px 40px rgba(5, 10, 48, 0.18);
}

body.woocommerce-checkout .flatpickr-current-month,
body.woocommerce-checkout .flatpickr-weekdays,
body.woocommerce-checkout .flatpickr-days,
body.woocommerce-checkout .flatpickr-day {
    font-family: "coherentic", Sans-serif;
}

body.woocommerce-checkout .flatpickr-current-month,
body.woocommerce-checkout .flatpickr-weekdays,
body.woocommerce-checkout .dayContainer {
    direction: rtl;
}

/* Month changes are done from the visible month/year controls. The side
 * navigation arrows are confusing in RTL, so keep them out of the UI. */
body.woocommerce-checkout .flatpickr-prev-month,
body.woocommerce-checkout .flatpickr-next-month {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

body.woocommerce-checkout .flatpickr-day.selected,
body.woocommerce-checkout .flatpickr-day.startRange,
body.woocommerce-checkout .flatpickr-day.endRange {
    background: #b7094c;
    border-color: #b7094c;
}

body.woocommerce-checkout .flatpickr-day.today {
    border-color: #0091ad;
}

/* Header account control: the icon is a mobile-only alternative to the text. */
.esimax-header-btn .esimax-hdr-ico {
    display: none;
}

@media (max-width: 767px) {
    .esimax-header-cta a.esimax-header-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 50% !important;
        color: #111 !important;
        background: transparent !important;
        background-image: none !important;
        box-shadow: none !important;
    }

    .esimax-header-cta a.esimax-header-btn .btn-text {
        display: none !important;
    }

    .esimax-header-cta a.esimax-header-btn .esimax-hdr-ico {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        line-height: 0;
    }

    .esimax-header-cta a.esimax-header-btn .esimax-hdr-ico svg {
        width: 24px;
        height: 24px;
    }

    .esimax-header-cta a.esimax-header-btn .esimax-hdr-ico svg path {
        fill: #111 !important;
    }
}

@media (max-width: 480px) {
    body.woocommerce-checkout .flatpickr-calendar {
        right: 12px !important;
        left: auto !important;
        width: calc(100vw - 24px) !important;
        min-width: 0 !important;
    }

    body.woocommerce-checkout .flatpickr-calendar::before,
    body.woocommerce-checkout .flatpickr-calendar::after {
        display: none;
    }

    body.woocommerce-checkout .flatpickr-rContainer,
    body.woocommerce-checkout .flatpickr-weekdays,
    body.woocommerce-checkout .flatpickr-days,
    body.woocommerce-checkout .dayContainer {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    body.woocommerce-checkout .flatpickr-day {
        flex: 0 0 14.285714%;
        max-width: none;
    }
}
