/* V1.2 modal/calendar hotfix - 2026-09-26 */
/* Buddhist Era Date Picker (BE/พ.ศ.) */
/* Keep canonical Gregorian date inputs available to existing JavaScript while removing them from visual layout. */
.be-date-original {
    position: absolute !important;
    width: 1px !important;
    min-width: 1px !important;
    height: 1px !important;
    min-height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    pointer-events: none !important;
}

input.be-date-display[data-be-date-display="1"] {
    padding-right: 2.65rem !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364758b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 18px 18px;
}

input.be-date-display[data-be-date-display="1"]:not(:disabled):not([readonly]) {
    cursor: text;
}

input.be-date-display[data-be-date-display="1"]:disabled,
input.be-date-display[data-be-date-display="1"][readonly] {
    cursor: default;
}

.be-date-popup {
    position: fixed;
    z-index: 2147483646 !important;
    width: 318px;
    max-width: calc(100vw - 16px);
    padding: 12px;
    border: 1px solid #d8e0ea;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .18);
    color: #172033;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.35;
}

.be-date-popup[hidden] {
    display: none !important;
}

.be-date-popup__header {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 8px;
}

.be-date-popup__selectors {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(86px, .8fr);
    gap: 6px;
}

.be-date-month,
.be-date-year {
    width: 100%;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #d8e0ea;
    border-radius: 9px;
    background: #fff;
    color: #172033;
    font: inherit;
}

.be-date-nav {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 9px;
    background: #f1f5f9;
    color: #334155;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.be-date-nav:hover,
.be-date-nav:focus-visible,
.be-date-action:hover,
.be-date-action:focus-visible {
    background: #e2e8f0;
    outline: none;
}

.be-date-popup__title {
    margin: 9px 0 6px;
    color: #334155;
    font-weight: 700;
    text-align: center;
}

.be-date-weekdays,
.be-date-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.be-date-weekdays > div {
    padding: 5px 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.be-date-day {
    min-width: 0;
    height: 35px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: #1e293b;
    font: inherit;
    cursor: pointer;
}

.be-date-day:hover:not(:disabled),
.be-date-day:focus-visible:not(:disabled) {
    border-color: #bfdbfe;
    background: #eff6ff;
    outline: none;
}

.be-date-day.is-outside {
    color: #94a3b8;
}

.be-date-day.is-today {
    border-color: #93c5fd;
    font-weight: 800;
}

.be-date-day.is-selected {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
    font-weight: 800;
}

.be-date-day.is-disabled,
.be-date-day:disabled {
    color: #cbd5e1;
    background: transparent;
    cursor: not-allowed;
}

.be-date-popup__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid #eef2f7;
}

.be-date-action {
    min-height: 32px;
    padding: 5px 10px;
    border: 0;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.be-date-action:disabled {
    opacity: .45;
    cursor: not-allowed;
}

@media (max-width: 575.98px) {
    .be-date-popup {
        width: min(318px, calc(100vw - 16px));
        padding: 10px;
        border-radius: 12px;
    }

    .be-date-day {
        height: 37px;
    }
}
