/* =========================================================
   DIM · Picker fecha/hora · Overlay v2
   ========================================================= */

.tr_dim_datetime {
    cursor: pointer !important;
}

.tr-dim-picker[hidden] {
    display: none !important;
}

/* Portal real: fuera del contenedor Divi */
.tr-dim-picker--portal {
    position: fixed !important;
    z-index: 2147483000 !important;

    display: grid;
    grid-template-columns: 300px 125px;

    width: 425px;

    background: #fff;
    border: 1px solid #dfe6ee;
    border-radius: 12px;

    box-shadow: 0 18px 50px rgba(23, 50, 77, .20);

    overflow: hidden;

    isolation: isolate;
}

.tr-dim-picker button {
    font: inherit;
    -webkit-appearance: none;
    appearance: none;
}

/* CALENDARIO */

.tr-dim-picker__calendar {
    padding: 10px;
}

.tr-dim-picker__header {
    display: grid;
    grid-template-columns: 28px 1fr 28px;
    align-items: center;
    gap: 5px;

    margin-bottom: 5px;
}

.tr-dim-picker__month {
    text-align: center;

    color: #17324d;

    font-size: 14px;
    font-weight: 700;
}

.tr-dim-picker__nav {
    width: 28px;
    height: 28px;

    padding: 0;

    border: 0;
    border-radius: 6px;

    background: #f2f7fb;
    color: #1f6fa8;

    font-size: 19px;
    line-height: 1;

    cursor: pointer;
}

.tr-dim-picker__nav:hover:not(:disabled) {
    background: #e8f2fa;
}

.tr-dim-picker__nav:disabled {
    opacity: .3;
    cursor: default;
}

.tr-dim-picker__weekdays,
.tr-dim-picker__days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}

.tr-dim-picker__weekdays {
    margin-bottom: 3px;
}

.tr-dim-picker__weekdays span {
    padding: 2px 0;

    text-align: center;

    color: #7b8997;

    font-size: 10px;
    font-weight: 700;
}

.tr-dim-picker__blank {
    min-height: 27px;
}

.tr-dim-picker__day {
    min-width: 0;
    height: 27px;

    padding: 0;

    border: 0;
    border-radius: 6px;

    background: transparent;
    color: #324a60;

    font-size: 11px;

    cursor: pointer;
}

.tr-dim-picker__day:hover:not(:disabled):not(.is-selected) {
    background: #edf5fb;
    color: #1f6fa8;
}

.tr-dim-picker__day.is-selected {
    background: #1f83df;
    color: #fff;

    font-weight: 700;
}

.tr-dim-picker__day:disabled {
    color: #c4ccd4;
    cursor: default;
}

/* HORARIOS */

.tr-dim-picker__times {
    padding: 10px 7px;

    border-left: 1px solid #e5ebf0;

    background: #f8fafc;
}

.tr-dim-picker__times-title {
    margin-bottom: 6px;

    color: #17324d;

    font-size: 10px;
    line-height: 1.25;
    font-weight: 700;
}

.tr-dim-picker__times-help {
    color: #7b8997;

    font-size: 11px;
    line-height: 1.4;
}

.tr-dim-picker__slots {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;

    max-height: 190px;

    padding-right: 3px;

    overflow-y: auto;
    overscroll-behavior: contain;
}

.tr-dim-picker__slot {
    width: 100%;
    min-height: 27px;

    padding: 3px 5px;

    border: 1px solid #dce6ee;
    border-radius: 6px;

    background: #fff;
    color: #324a60;

    font-size: 11px;
    font-weight: 600;

    cursor: pointer;
}

.tr-dim-picker__slot:hover {
    border-color: #1f83df;

    background: #eef6fd;
    color: #1f6fa8;
}

/* MÓVIL: modal compacto */

@media (max-width: 767px) {
    .tr-dim-picker--portal {
        position: fixed !important;

        top: 50% !important;
        left: 50% !important;

        grid-template-columns: 1fr;

        width: calc(100vw - 28px);
        max-width: 430px;
        max-height: calc(100vh - 30px);

        transform: translate(-50%, -50%);

        overflow-y: auto;
    }

    .tr-dim-picker__calendar {
        padding: 14px;
    }

    .tr-dim-picker__times {
        padding: 12px 14px 14px;

        border-top: 1px solid #e5ebf0;
        border-left: 0;
    }

    .tr-dim-picker__slots {
        grid-template-columns: repeat(3, 1fr);
        max-height: none;
    }
}
