.ddwp-widget:has(.layout-calendar) {
    .ddwp-canvas {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 10px;
    }
}

.ddwp-widget .layout-calendar {
    .ui-datepicker {
        border: none !important;
    }

    table td {
        padding: 0 !important;
    }

    .ui-datepicker-header {
        border: none !important;
        background: none !important;
        font-weight: bold !important;
    }

    .ui-state-default {
        background: none;
        border: none;
        padding: 10px;
    }

    .ui-datepicker-current-day {
        .ui-state-active {
            background-color: rgba(13, 136, 193) !important;
            color: white !important;
            font-weight: normal !important;
            border-radius: 50%;
        }
    }

    .ui-datepicker-today {
        .ui-state-default {
            background-color: rgba(0,0,0,0.1) !important;
            border-radius: 50%;
            color: black !important;
        }
    }
}

.ddwp-widget {

    #ddw-calendar-timeslots {
        overflow-y: auto;
        position: relative;
        padding: 1rem;
        height: 0;
        min-height: 100%;
    }

    .timeslots {
        .timeslot {
            background-color: rgba(0,0,0,0.05);
            padding:12px;
            width: 100%;
            margin-bottom: 8px;
            border-radius: 5px;
            cursor: pointer;
            user-select: none;
            font-size: 14px;
        }

        .timeslot.selected {
            background-color: rgba(13, 136, 193) !important;
            color: white;
        }
    }
}

.ddwp-widget[data-widget-type='dayview'] {
    .days {
        white-space: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        height: 80px;

        .day {
            height: 60px;
            font-size: 14px;
            width: 140px;
            display: inline-grid;
            place-items: center;
            padding: 0;
            cursor: pointer;
            user-select: none;
            background-color: rgba(0,0,0,0.08);
            text-align: center;
            border-radius: 8px;
        }

        .day.selected {
            background-color: #0d88c1;
            color: white;
        }
    }

    #ddw-calendar-timeslots {
        overflow: auto;
        padding: 0;
        height: auto !important;

        .timeslots {
            display: grid;
            grid-template-columns: auto auto auto;
            gap: 10px;

            .timeslot {
                margin: 0;
                text-align: center;
            }
        }
    }
}

.ddwp-widget[data-widget-type="table"] {

    overflow-y: scroll;
    max-height: 400px;
    overflow-x: hidden;

    @media all and (max-width: 500px) {
        max-height: 300px;
    }


    .ddwp-schedule-table {
        display: flex;
        flex-wrap: wrap;
        margin: 0 0 3em 0;
        padding: 0;
        position: relative;
        top: 3px;
        left: 3px;

        .ddwp-schedule-table-cell {
            box-sizing: border-box;
            flex-grow: 1;
            width: 100%;
            padding: 5px 5px;
            overflow: hidden;
            list-style: none;
            border-top: solid 3px white;
            font-size: 14px;
            margin: -3px 0 0 -3px;
            background-color: white;
            border-top-color: #eaeaea;
            user-select: none;

            .weekday {
                font-weight: bold;
                display: block;
            }
        }

        .ddwp-schedule-table-cell.timeslot {
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }

        .ddwp-schedule-table-cell.selected {
            background-color: rgba(13, 136, 193) !important;
            color: white;
        }

        .ddwp-schedule-table-cell.unavailable {
            background-color: #f7f7f7;
            cursor: auto !important;
            span {
                opacity: 0.3;
            }
        }
    }

    .ddwp-schedule-table--2cols .ddwp-schedule-table-cell {
        width: 50%;
    }

    .ddwp-schedule-table--3cols .ddwp-schedule-table-cell {
        width: 33.33%;
    }

    .ddwp-schedule-table--4cols .ddwp-schedule-table-cell {
        width: 25%;
    }

    .ddwp-schedule-table--5cols .ddwp-schedule-table-cell {
        width: 20%;
    }

    .ddwp-schedule-table--6cols .ddwp-schedule-table-cell {
        width: 16.6%;
    }

    @media all and (max-width: 500px) {
        .ddwp-schedule-table--collapse {
            display: block;
        }

        .ddwp-schedule-table--collapse > .Rtable-cell {
            width: 100% !important;
        }

        .ddwp-schedule-table--collapse > .Rtable-cell--foot {
            margin-bottom: 1em;
        }
    }

    @media all and (max-width: 500px) {
        .hiddenSmall {
            display: none;
        }
    }

    .ddwp-schedule-table.layout-style-list .ddwp-schedule-table-row {
        display: flex;
        flex-flow: nowrap;
        flex-grow: 1;
    }

    .ddwp-schedule-table.layout-style-days .ddwp-schedule-table-row {
        display: flex;
        flex-flow: row wrap;
        flex-grow: 1;
    }

    .ddwp-schedule-table.layout-style-glance .ddwp-schedule-table-row {
        display: flex;
        flex-flow: column wrap;
        flex-grow: 1;
    }

    @media all and (max-width: 500px) {
        .ddwp-schedule-table .ddwp-schedule-table-row {
            display: block !important;
            width: 100% !important;
        }

        .ddwp-schedule-table .ddwp-schedule-table-cell {
            width: 100% !important;
        }
    }
}

.ddwp-summary {
    margin: 20px 0;
    text-align: center;
    font-size: 16px;
}


.ddwp-widget[data-source='cart_product_line'] {
    #ddwp-calendar, #ddw-calendar-timeslots {
        display: none;
    }

    .ddwp-summary {
        color: #222;
        font-weight: normal;
        text-align: left;
        font-size: 14px;
        margin-bottom: 3px;
    }

    .ddwp-datepicker-toggle {
        display: block !important;
        color: black;
        font-size: 14px;
        font-weight: normal;
        text-decoration: underline;
        cursor: pointer;
    }

    .ui-datepicker * {
        font-size: 12px !important;
        padding: 0;

        td span, td a {
            padding: 2px 5px;
        }

        .ui-state-active, .ui-state-default {
            border-radius: 6px;
        }
    }
}


