/* ---- Time selector button inside the addon popup ---- */

/* Hide the dates/time summary row when the time selector button is present */
#uws-invitem-pop .uws-itempop-body:has(.uwstimeselector) .uwsitemdetslist {
    display: none;
}

/* Hide the header image only when the timeslot selscreen is actively shown */
#uws-invitem-pop .uwsinv-item:has(.uws-itempop-selscreen.uwsviewshown) .uws-itempop-header {
    display: none;
}

#uws-invitem-pop .uwstimeselector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
    padding: .5rem 0;
    border-left: none;
    border-right: none;
    border-radius: 0;
    background: none;
    box-sizing: border-box;
    cursor: pointer;
    text-align: left;
}

#uws-invitem-pop .uwstimeselector:focus {
    outline: none;
}

#uws-invitem-pop .uwstimeselector .uwslabel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

#uws-invitem-pop .uwstimeselector.uwsblocked .uwslabel {
    flex-direction: row;
    align-items: center;
    margin: 0px;
}

#uws-invitem-pop .uwstimeselector .uwslabel>span:first-child {
    color: #212121;
    line-height: normal;
    display: block;
}

#uws-invitem-pop .uwstimeselector .uv-ts-timesel-sub {
    font-size: .8755rem;
    font-weight: 400;
    color: #616161;
    line-height: 1.4;
    display: block;
}

/* #uws-invitem-pop .uwstimeselector .uwsdy-otdtime {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 140px;
    height: 48px;
    background: #6E431A;
    color: #fff;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    line-height: normal;
    transition: opacity 0.2s ease;
    border: none;
    padding: 0;
    margin-left: 0;
}

#uws-invitem-pop .uwstimeselector:hover .uwsdy-otdtime,
#uws-invitem-pop .uwstimeselector:focus .uwsdy-otdtime,
#uws-invitem-pop .uwstimeselector:active .uwsdy-otdtime {
    background: #6E431A;
    color: #fff;
    opacity: 0.9;
} */

/* ---- Multi-day selscreen header ---- */

#uws-invitem-pop .uv-ts-screen-header {
    padding: 16px 16px 12px;
    border-bottom: 1px solid #EEEEEE;
    flex-shrink: 0;
}

#uws-invitem-pop .uv-ts-screen-title {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #212121;
    line-height: normal;
}

#uws-invitem-pop .uv-ts-screen-sub {
    display: block;
    font-size: 13px;
    color: #757575;
    margin-top: 4px;
    line-height: normal;
}

/* ---- Selscreen flex layout for multi-day ---- */

#uws-invitem-pop .uws-itempop-selscreen:has(.uv-ts-screen-header) {
    display: flex;
    flex-direction: column;
}

/* Override: collapse selscreen when uwsSwitchViewSibling marks it as fully hidden.
   Must come AFTER the display:flex rule above to win the cascade (same specificity). */
#uws-invitem-pop .uws-itempop-selscreen.uwsviewdispnone {
    display: none;
}

#uws-invitem-pop .uv-ts-multiday-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* ---- Collapsible day group headers ---- */

#uws-invitem-pop .uv-ts-daygroup {
    border-bottom: 1px solid #F5F5F5;
}

#uws-invitem-pop .uv-ts-daygroup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
    color: #212121;
    text-transform: none;
    letter-spacing: normal;
    text-align: left;
    line-height: normal;
}

#uws-invitem-pop .uv-ts-daygroup-header:focus {
    outline: none;
}

#uws-invitem-pop .uv-ts-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #EEE8E3;
    flex-shrink: 0;
    border: none;
    margin-top: 0;
}

#uws-invitem-pop .uv-ts-chevron::before {
    content: '';
    display: block;
    width: 7px;
    height: 7px;
    border-right: 2px solid #6E431A;
    border-bottom: 2px solid #6E431A;
    transform: rotate(45deg);
    margin-top: -3px;
    transition: transform 0.2s ease;
}

#uws-invitem-pop .uv-ts-daygroup.uv-ts-collapsed .uv-ts-chevron::before {
    transform: rotate(-135deg);
    margin-top: 3px;
}

#uws-invitem-pop .uv-ts-daygroup.uv-ts-collapsed .uv-ts-daygroup-times {
    display: none;
}

/* ---- Multi-select time chips ---- */

#uws-invitem-pop .uv-ts-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 16px 16px;
    list-style: none;
    margin: 0;
}

#uws-invitem-pop .uv-ts-chips li {
    flex: 0 0 auto;
    padding: 0;
    border: none;
    background: none;
}

#uws-invitem-pop .uv-ts-chips li::before {
    display: none;
}

#uws-invitem-pop .uv-ts-chips .uwsjs-rv-selectottime {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border: 1.5px solid #6E431A;
    border-radius: 6px;
    background: #fff;
    color: #6E431A;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    line-height: normal;
    transition: background 0.15s ease, color 0.15s ease;
    height: auto;
    width: auto;
    max-width: none;
}

#uws-invitem-pop .uv-ts-chips .uwsjs-rv-selectottime span {
    pointer-events: none;
}

#uws-invitem-pop .uv-ts-chips .uwsjs-rv-selectottime.uv-ts-selected {
    background: #EEE8E3;
    color: #6E431A;
}

/* ---- Multi-day footer with confirm button ---- */

#uws-invitem-pop .uv-ts-multiday-footer {
    padding: 12px 16px;
    border-top: 1px solid #EEEEEE;
    flex-shrink: 0;
}

#uws-invitem-pop .uv-ts-confirm-slots {
    display: block;
    width: 100%;
    background: #6E431A;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    line-height: normal;
    transition: opacity 0.2s ease;
}

#uws-invitem-pop .uv-ts-confirm-slots:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Addon action buttons are dimmed until times are confirmed */
.uv-ts-btn-pending {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}