/* OpenHours day ----------------------------------------------------------- */
.wp-block-smartson-openhours-day.openhours-smartson-message {
    display: block;
    margin: 0;
    line-height: 1;
}

.openhours-day-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 0;
    line-height: 1;
    vertical-align: middle;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.openhours-day-trigger:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
    border-radius: 4px;
}

.openhours-day-live {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    line-height: 1;
}

.openhours-status-dot {
    flex: 0 0 auto;
    width: .72em;
    height: .72em;
    margin-right: .45em;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .03);
}

.openhours-status-dot.is-open {
    background: #10c979;
}

.openhours-status-dot.is-closed {
    background: #e53935;
}

.openhours-message-frame {
    position: relative;
    display: inline-block;
    min-width: 0;
    height: 1em;
    line-height: 1;
    overflow: visible;
    vertical-align: middle;
    transition-property: width;
    transition-timing-function: cubic-bezier(.22, .61, .36, 1);
}

.openhours-rotating-message {
    position: absolute;
    top: 50%;
    left: 0;
    display: inline-block;
    width: max-content;
    max-width: none;
    opacity: 0;
    transform: translateY(-50%);
    pointer-events: none;
    transition-property: opacity;
    transition-timing-function: ease;
}

.openhours-rotating-message.is-active {
    position: relative;
    top: auto;
    left: auto;
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.openhours-bold {
    font-weight: 700;
}

.openhours-popup-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 20px;
    height: 20px;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 -4px 0 2px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: currentColor !important;
    font: inherit !important;
    line-height: 1 !important;
    box-shadow: none !important;
    cursor: pointer;
    appearance: none;
}

.openhours-day-trigger:hover .openhours-popup-icon,
.openhours-day-trigger:focus-visible .openhours-popup-icon {
    background: rgba(0, 0, 0, .06) !important;
}

.openhours-popup-icon svg {
    display: block;
    width: 14px;
    height: 14px;
    transition: transform .25s ease;
}

.openhours-day-trigger[aria-expanded="true"] .openhours-popup-icon svg {
    transform: rotate(180deg);
}

.wp-block-smartson-openhours-day.has-text-align-center,
.wp-block-smartson-openhours-week.has-text-align-center {
    text-align: center;
}

.wp-block-smartson-openhours-day.has-text-align-right,
.wp-block-smartson-openhours-week.has-text-align-right {
    text-align: right;
}

.wp-block-smartson-openhours-day.has-text-align-left,
.wp-block-smartson-openhours-week.has-text-align-left {
    text-align: left;
}

/* Calendar dialog -------------------------------------------------------- */
body.openhours-dialog-open {
    overflow: hidden;
}

.openhours-dialog[hidden] {
    display: none !important;
}

.openhours-dialog {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 24px 24px;
    font-family: inherit;
    color: #101828;
}

.openhours-dialog-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 20, .68);
    backdrop-filter: blur(1.5px);
    animation: openhours-overlay-in .24s ease both;
}

.openhours-dialog-close {
    position: absolute;
    z-index: 3;
    top: max(12px, calc(var(--openhours-dialog-card-top, 120px) - 81px));
    left: 50%;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #fff !important;
    color: #111 !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .22) !important;
    transform: translateX(-50%);
    cursor: pointer;
    appearance: none;
    animation: openhours-close-in .32s cubic-bezier(.22, .61, .36, 1) both;
}

.openhours-dialog-close:hover {
    transform: translateX(-50%) scale(1.04);
}

.openhours-dialog-close:focus-visible {
    outline: 3px solid #2271b1;
    outline-offset: 3px;
}

.openhours-dialog-close svg {
    width: 24px;
    height: 24px;
}

.openhours-dialog-card {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(220px, .72fr) minmax(0, 1.55fr);
    width: min(880px, calc(100vw - 48px));
    height: auto;
    max-height: none;
    margin: var(--openhours-dialog-card-top, 120px) auto 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 14px;
    background: #f3f5f8;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .34);
    animation: openhours-card-in .36s cubic-bezier(.22, .61, .36, 1) both;
}

.openhours-calendar-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 32px 24px;
    background: #fff;
    text-align: center;
}

.openhours-summary-today {
    margin-bottom: 8px;
    color: #667085;
    font-size: .72rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.openhours-summary-date {
    max-width: 230px;
    white-space: pre-line;
    font-size: clamp(1.25rem, 2vw, 1.8rem);
    line-height: 1.08;
    font-weight: 800;
    text-transform: uppercase;
}

.openhours-summary-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 28px;
    padding: 8px 13px;
    border: 1px solid #d0d5dd;
    border-radius: 7px;
    font-size: .85rem;
}

.openhours-summary-status > span {
    width: 9px;
    height: 9px;
    border-radius: 999px;
}

.openhours-summary-status.is-open > span {
    background: #12b76a;
}

.openhours-summary-status.is-closed > span {
    background: #e53935;
}

.openhours-summary-hours {
    margin-top: 14px;
    font-size: 1.18rem;
    line-height: 1.35;
    font-weight: 750;
}

.openhours-calendar-panel {
    min-width: 0;
    overflow: auto;
    padding: 24px 28px 36px;
}

.openhours-calendar {
    min-width: 0;
}

.openhours-calendar-popup-title {
    margin: 0 0 18px;
    color: inherit;
    font: inherit;
    font-size: clamp(1.1rem, 2vw, 1.42rem);
    line-height: 1.2;
    font-weight: 700;
    text-align: center;
}

.openhours-calendar-nav {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.openhours-calendar-month {
    font-size: clamp(1.42rem, 3vw, 2rem);
    line-height: 1.1;
    font-weight: 850;
    letter-spacing: -.02em;
    text-align: center;
}

.openhours-calendar-arrow {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: #111827 !important;
    box-shadow: none !important;
    cursor: pointer;
    appearance: none;
}

.openhours-calendar-arrow:hover:not(:disabled),
.openhours-calendar-arrow:focus-visible:not(:disabled) {
    background: rgba(17, 24, 39, .06) !important;
}

.openhours-calendar-arrow:disabled {
    color: #c9ced6 !important;
    cursor: default;
}

.openhours-calendar-arrow svg {
    width: 23px;
    height: 23px;
}

.openhours-calendar-weekdays,
.openhours-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
}

.openhours-calendar-weekdays {
    margin-bottom: 8px;
}

.openhours-calendar-weekdays span {
    min-width: 0;
    padding: 0 2px;
    color: #344054;
    font-size: .72rem;
    line-height: 1;
    font-weight: 650;
    text-align: center;
}

.openhours-calendar-day {
    position: relative;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1.5 / 1;
    min-width: 0;
    margin: 0 !important;
    padding: 4px 3px 3px !important;
    border: 1px solid #dde2e8 !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #202938 !important;
    font: inherit !important;
    line-height: 1 !important;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .03) !important;
    cursor: default;
    appearance: none;
}

.openhours-calendar-day:disabled {
    cursor: default;
}

.openhours-calendar-day.is-past,
.openhours-calendar-day.is-previous-month {
    background: rgba(255, 255, 255, .45) !important;
    color: #b5bbc4 !important;
}

.openhours-calendar-day.is-closed:not(.is-past) {
    background: #eef0f3 !important;
}

.openhours-calendar-day.is-next-month {
    opacity: .58;
}

.openhours-calendar-day.is-today {
    border-color: #12b76a !important;
    box-shadow: inset 0 0 0 1px #12b76a !important;
}



.openhours-calendar-dot {
    position: absolute;
    top: 7px;
    left: 7px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
}

.openhours-calendar-day.is-open .openhours-calendar-dot {
    background: #12b76a;
}

.openhours-calendar-day.is-closed .openhours-calendar-dot {
    background: #e53935;
}

.openhours-calendar-number {
    font-size: clamp(.92rem, 2vw, 1.12rem);
    line-height: 1;
    font-weight: 620;
}

.openhours-calendar-hours {
    display: block;
    max-width: 100%;
    margin-top: 2px;
    overflow: hidden;
    font-size: clamp(.48rem, 1.2vw, .67rem);
    line-height: 1.05;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* OpenHours week --------------------------------------------------------- */
.wp-block-smartson-openhours-week.openhours-smartson-week {
    margin: 0;
}

.openhours-week-card {
    width: min(100%, 920px);
    box-sizing: border-box;
    padding: clamp(24px, 4vw, 44px);
    border: 1px solid rgba(16, 24, 40, .06);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 14px 42px rgba(16, 24, 40, .08);
    color: inherit;
}

.openhours-week-title {
    margin: 0 0 28px;
    color: inherit;
    font: inherit;
    font-size: clamp(1.5em, 4vw, 2.2em);
    line-height: 1.12;
    font-weight: 750;
    letter-spacing: -.02em;
}

.openhours-week-list {
    display: grid;
}

.openhours-week-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    min-height: 64px;
    padding: 12px 16px;
    border-bottom: 1px solid #e6e9ee;
}

.openhours-week-row:last-child {
    border-bottom: 0;
}

.openhours-week-row.is-today {
    border-bottom-color: transparent;
    border-radius: 10px;
    background: #f1f5fb;
    font-weight: 700;
}

.openhours-week-day {
    min-width: 0;
}

.openhours-week-hours {
    display: grid;
    grid-template-columns: 10px auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    white-space: nowrap;
}

.openhours-week-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
}

.openhours-week-row.is-open .openhours-week-dot {
    background: #24ad3d;
}

.openhours-week-row.is-closed .openhours-week-dot {
    background: #e53935;
}

.openhours-week-note {
    grid-column: 2;
    color: #667085;
    font-size: .72em;
    line-height: 1;
    font-weight: 500;
}

@keyframes openhours-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes openhours-card-in {
    from { opacity: 0; transform: translateY(-18px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes openhours-close-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-12px) scale(.92); }
    to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@media (max-width: 900px) {
    .openhours-dialog-card {
        grid-template-columns: 1fr;
        width: min(720px, calc(100vw - 28px));
        border-radius: 12px;
    }

    .openhours-calendar-summary {
        display: none;
    }

    .openhours-calendar-panel {
        padding: 30px 26px 32px;
    }
}

@media (max-width: 600px) {

    .openhours-dialog {
        align-items: flex-start;
        padding: var(--openhours-popup-top, 100px) 12px 12px;
    }

    .openhours-dialog-close {
        top: max(12px, calc(var(--openhours-popup-top, 100px) - 58px));
    }

    .openhours-dialog-card {
        margin: 0 auto 8px;
    }
    .openhours-day-trigger {
        max-width: calc(100vw - 24px);
    }

    .openhours-dialog-card {
        width: calc(100vw - 24px);
        max-height: calc(100dvh - var(--openhours-popup-top, 100px) - 12px);
        margin-bottom: 8px;
        border-radius: 10px;
    }

    .openhours-dialog-close {
        width: 44px;
        height: 44px;
    }

    .openhours-calendar-panel {
        padding: 25px 16px 22px;
    }

    .openhours-calendar-popup-title {
        margin-bottom: 22px;
        font-size: 1.16rem;
    }

    .openhours-calendar-nav {
        grid-template-columns: 38px minmax(0, 1fr) 38px;
        gap: 5px;
        margin-bottom: 24px;
    }

    .openhours-calendar-month {
        font-size: clamp(1.28rem, 7vw, 1.72rem);
    }

    .openhours-calendar-arrow {
        width: 38px;
        height: 38px;
    }

    .openhours-calendar-weekdays,
    .openhours-calendar-grid {
        gap: 5px;
    }

    .openhours-calendar-day {
        aspect-ratio: auto;
        height: 40px;
        min-height: 40px;
        padding: 3px 2px 2px !important;
        border-radius: 5px !important;
    }

    .openhours-calendar-number {
        line-height: 1;
    }

    .openhours-calendar-hours {
        margin-top: 1px;
    }

    .openhours-calendar-weekdays {
        margin-bottom: 7px;
    }

    .openhours-calendar-weekdays span {
        font-size: .6rem;
    }

    .openhours-calendar-dot {
        top: 5px;
        left: 5px;
        width: 6px;
        height: 6px;
    }

    .openhours-calendar-number {
        font-size: clamp(.78rem, 4vw, .98rem);
    }

    .openhours-calendar-hours {
        margin-top: 5px;
        font-size: clamp(.4rem, 2.25vw, .58rem);
    }

    .openhours-week-card {
        padding: 22px 18px;
        border-radius: 16px;
    }

    .openhours-week-title {
        margin-bottom: 18px;
    }

    .openhours-week-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        min-height: 54px;
        padding: 10px 8px;
        font-size: .93em;
    }

    .openhours-week-hours {
        gap: 7px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .openhours-message-frame,
    .openhours-rotating-message,
    .openhours-popup-icon svg,
    .openhours-dialog-overlay,
    .openhours-dialog-card,
    .openhours-dialog-close {
        animation: none !important;
        transition: none !important;
    }
}

.openhours-message-frame.is-rotation-ready .openhours-rotating-message,
.openhours-message-frame.is-rotation-ready .openhours-rotating-message.is-active {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.openhours-dialog.is-closing .openhours-dialog-overlay {
    animation: openhours-overlay-out .22s ease both;
}

.openhours-dialog.is-closing .openhours-dialog-card {
    animation: openhours-card-out .25s ease both;
}

.openhours-dialog.is-closing .openhours-dialog-close {
    animation: openhours-close-out .2s ease both;
}

@keyframes openhours-overlay-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes openhours-card-out {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-14px) scale(.985); }
}

@keyframes openhours-close-out {
    from { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
    to { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(.92); }
}
