html:has(.nsb-app),
body:has(.nsb-app) {
    width: 100%;
    max-width: 100%;
    margin: 0 !important;
    min-height: 100%;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background: #f7f7f8;
}

body:has(.nsb-app) .wp-block-post-title,
body:has(.nsb-app) h1.wp-block-post-title {
    display: none !important;
}

body:has(.nsb-app) .wp-site-blocks,
body:has(.nsb-app) main,
body:has(.nsb-app) article,
body:has(.nsb-app) .entry-content,
body:has(.nsb-app) .wp-block-post-content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.nsb-app,
.nsb-app * {
    box-sizing: border-box;
    letter-spacing: 0;
}

.nsb-app [hidden],
.nsb-home {
    display: none !important;
}

.nsb-app {
    --nsb-red: #ff2735;
    --nsb-red-soft: #ffe7ea;
    --nsb-card: #ffffff;
    --nsb-ink: #15172a;
    --nsb-muted: #707784;
    --nsb-line: #e8e9ee;
    position: relative !important;
    z-index: auto;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100vh;
    height: auto;
    margin: 0 !important;
    overflow-x: hidden;
    overflow-y: visible;
    color: var(--nsb-ink);
    background: #f1f1f3;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.nsb-booking {
    position: relative;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 100vh;
    height: auto;
    margin: 0 !important;
    display: grid;
    grid-template-rows: auto 1fr;
    padding: clamp(22px, 3vw, 44px) clamp(22px, 4vw, 72px);
    overflow: visible;
}

.nsb-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--nsb-line);
}

.nsb-header h2 {
    margin: 0;
    font-size: clamp(30px, 2.4vw, 44px);
    line-height: 1.05;
    font-weight: 850;
}

.nsb-header p {
    margin: 8px 0 0;
    color: var(--nsb-muted);
    font-size: clamp(16px, 1.15vw, 20px);
}

.nsb-back,
.nsb-progress {
    display: none;
}

.nsb-form {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
    padding-bottom: 40px;
}

.nsb-form-grid {
    min-height: 0;
    flex: 1;
    display: grid;
    width: 100%;
    max-width: none;
    grid-template-columns: minmax(300px, 0.72fr) minmax(420px, 1fr) minmax(320px, 0.78fr);
    grid-template-rows: auto 1fr;
    gap: clamp(18px, 2vw, 32px);
    padding-top: 28px;
    overflow: visible;
}

.nsb-panel {
    min-width: 0;
    padding: clamp(18px, 2vw, 28px);
    border: 1px solid rgba(232, 233, 238, .9);
    border-radius: 14px;
    background: rgba(255, 255, 255, .72);
    box-shadow: 0 22px 62px rgba(15, 23, 42, .06);
}

.nsb-panel h3 {
    margin: 0 0 12px;
    font-size: clamp(22px, 1.8vw, 30px);
    line-height: 1.08;
    font-weight: 820;
}

.nsb-panel p {
    margin: 0 0 24px;
    color: var(--nsb-muted);
    font-size: 17px;
    line-height: 1.45;
}

.nsb-duration-panel {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    position: sticky;
    top: 24px;
    background: #fff;
    border-radius: 24px;
    padding: clamp(24px, 3vw, 34px);
}

.nsb-date-panel {
    grid-column: 2;
    grid-row: 1;
}

.nsb-slots-panel {
    grid-column: 3;
    grid-row: 1 / span 2;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.nsb-details-panel {
    grid-column: 2;
    grid-row: 2;
    min-height: 0;
    overflow: visible;
}

.nsb-duration {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.nsb-duration label,
.nsb-services label,
.nsb-slot {
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 760;
    cursor: pointer;
}

.nsb-duration label {
    min-height: 98px;
    position: relative;
    display: grid !important;
    place-items: center !important;
    padding: 0 16px;
    overflow: hidden;
    background: #fff;
    color: var(--nsb-ink);
    border-color: var(--nsb-line);
    line-height: 1;
    text-align: center;
    font-size: clamp(20px, 1.45vw, 28px);
}

.nsb-duration label span {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    display: block !important;
    width: auto;
    max-width: calc(100% - 32px);
    margin: 0 !important;
    padding: 0 !important;
    transform: translate(-50%, -50%) !important;
    text-align: center !important;
    white-space: nowrap;
}

.nsb-duration input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    border: 0;
    appearance: none;
    clip-path: inset(50%);
    pointer-events: none;
}

.nsb-services input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    border: 0;
    appearance: none;
    clip-path: inset(50%);
    pointer-events: none;
}

.nsb-duration label:has(input:checked) {
    background: var(--nsb-red);
    border-color: var(--nsb-red);
    color: #fff;
    box-shadow: 0 18px 38px rgba(255, 39, 53, .18);
}

.nsb-services {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 10px;
}

.nsb-services label {
    min-height: 52px;
    position: relative;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 16px;
    background: var(--nsb-red-soft);
    color: #cf1727;
    line-height: 1.05;
    text-align: center;
    font-size: clamp(17px, 1.05vw, 21px);
}

.nsb-services label:has(input:checked) {
    background: var(--nsb-red);
    border-color: var(--nsb-red);
    color: #fff;
    box-shadow: 0 12px 26px rgba(255, 39, 53, .16);
}

.nsb-slots {
    min-height: 0;
    flex: 0 0 auto;
    overflow-y: visible;
    overflow-x: hidden;
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(58px, auto);
    align-content: start;
    gap: 14px;
    padding-right: 8px;
}

.nsb-slot {
    justify-content: space-between;
    padding: 0 24px;
    background: var(--nsb-red-soft);
    color: #cf1727;
    border-color: transparent;
}

.nsb-slot::after {
    content: "Disponibile";
    margin-left: 16px;
    font-size: 14px;
    color: currentColor;
    opacity: .82;
}

.nsb-slot.is-selected {
    background: var(--nsb-red);
    color: #fff;
    box-shadow: 0 16px 30px rgba(255, 39, 53, .18);
}

.nsb-slot:disabled {
    background: #f0eef0;
    color: #a5a1a6;
    cursor: not-allowed;
}

.nsb-form input[type="date"],
.nsb-form input[type="text"],
.nsb-form input[type="email"],
.nsb-form input[type="tel"],
.nsb-form textarea {
    width: 100%;
    min-height: 54px;
    margin: 8px 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--nsb-line);
    border-radius: 8px;
    background: #fff;
    color: var(--nsb-ink);
    font: inherit;
}

.nsb-form textarea {
    min-height: 92px;
    resize: vertical;
}

.nsb-form label {
    display: block;
    color: var(--nsb-ink);
    font-weight: 760;
}

.nsb-service-field {
    padding: 0;
    border: 0;
    margin-top: 24px;
}

.nsb-service-field legend {
    margin-bottom: 0;
    color: var(--nsb-ink);
    font-weight: 820;
    font-size: clamp(18px, 1.15vw, 22px);
}

.nsb-slot {
    min-height: 58px;
    display: flex;
    align-items: center;
}

.nsb-submit {
    align-self: stretch;
    width: 100%;
    max-width: none;
    min-height: 58px;
    margin-top: 8px;
    border: 0;
    border-radius: 8px;
    background: #050505;
    color: #fff;
    font: inherit;
    font-weight: 820;
    cursor: pointer;
}

.nsb-message {
    min-height: 24px;
    margin-top: 12px;
    color: #177245;
    font-weight: 760;
}

.nsb-message.is-error {
    color: #b42318;
}

.nsb-loading,
.nsb-empty {
    margin: 0;
    color: var(--nsb-muted);
}

@media (max-width: 1100px) {
    .nsb-app {
        overflow-y: visible;
        overflow-x: hidden;
    }

    .nsb-booking {
        height: auto;
        min-height: 100vh;
        overflow: visible;
        width: 100% !important;
        padding: 20px;
    }

    .nsb-form-grid {
        grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr);
        grid-template-rows: auto auto auto;
        overflow: visible;
    }

    .nsb-duration-panel {
        grid-column: 1 / -1;
        grid-row: 1;
        position: static;
    }

    .nsb-duration {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .nsb-services {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nsb-date-panel {
        grid-column: 1;
        grid-row: 2;
        padding-right: 0;
    }

    .nsb-details-panel {
        grid-column: 1;
        grid-row: 3;
        padding-right: 0;
    }

    .nsb-slots-panel {
        grid-column: 2;
        grid-row: 2 / span 2;
    }

    .nsb-slots {
        max-height: none;
    }

    .nsb-submit {
        position: sticky;
        bottom: 16px;
        z-index: 5;
        box-shadow: 0 16px 34px rgba(0, 0, 0, .18);
    }
}

@media (max-width: 760px) {
    .nsb-booking {
        padding: 16px;
    }

    .nsb-header {
        padding-bottom: 18px;
    }

    .nsb-form-grid {
        display: block;
        padding-top: 20px;
    }

    .nsb-panel {
        margin-bottom: 26px;
        padding: 18px;
        border-radius: 12px;
    }

    .nsb-duration {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nsb-services {
        grid-template-columns: 1fr;
    }

    .nsb-duration label {
        min-height: 86px;
    }

    .nsb-slots {
        max-height: none;
        overflow: visible;
    }

    .nsb-form {
        overflow: visible;
    }
}

@media (max-width: 420px) {
    .nsb-duration {
        grid-template-columns: 1fr;
    }

}
