/* ===== Lowengrube Booking Widget — TheFork style ===== */

/* ── Theme reset: neutralizza stili pagina (Flatsome, Divi, ecc.) ── */
.lgrb-booking,
.lgrb-booking * {
    box-sizing: border-box;
}

.lgrb-booking button {
    min-height: 0 !important;
    max-width: none !important;
    font-family: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
    background: transparent;
    border: none;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
    width: auto;
    margin: 0;
}

.lgrb-booking select,
.lgrb-booking input,
.lgrb-booking textarea {
    min-height: 0 !important;
    height: auto !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
    max-width: none !important;
}

.lgrb-booking p,
.lgrb-booking h1,
.lgrb-booking h2,
.lgrb-booking h3,
.lgrb-booking h4,
.lgrb-booking label {
    margin: 0;
    padding: 0;
}

.lgrb-booking .lgrb-cal-nav button,
.lgrb-booking .lgrb-locale-bar button,
.lgrb-booking .lgrb-nav-row button,
.lgrb-booking .lgrb-stepper-input button {
    margin: 0 !important;
}

/* Force button widths to fit content (Flatsome often sets width:100%) */
.lgrb-booking .lgrb-btn,
.lgrb-booking .lgrb-cal-btn,
.lgrb-booking .lgrb-locale-change {
    width: auto !important;
}

.lgrb-booking .lgrb-btn-block {
    width: 100% !important;
}

/* ── Container ── */
.lgrb-booking {
    max-width: 420px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #1a1a1a;
    background: #ffffff !important;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,.08);
    position: relative;
    overflow: hidden;
}

.lgrb-hidden {
    display: none !important;
}

/* ── Header ── */
.lgrb-header {
    padding: 24px 24px 16px;
}

.lgrb-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
    color: #1a1a1a;
}

.lgrb-subtitle {
    margin: 4px 0 0;
    font-size: .9rem;
    color: #666;
}

/* ── Locale bar ── */
.lgrb-locale-bar {
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px !important;
    background: #fafafa !important;
    border-top: 1px solid #eee !important;
    border-bottom: 1px solid #eee !important;
    cursor: pointer;
}

.lgrb-locale-bar.lgrb-locale-bar-locked {
    cursor: default;
    opacity: .75;
}

.lgrb-locale-bar.lgrb-locale-bar-locked .lgrb-locale-hidden-select {
    pointer-events: none !important;
    cursor: default !important;
}

.lgrb-locale-bar.lgrb-locale-bar-locked .lgrb-locale-change {
    opacity: .5 !important;
}

.lgrb-locale-name {
    font-weight: 600;
    font-size: .95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lgrb-locale-name.lgrb-placeholder {
    color: #888;
    font-style: italic;
    font-weight: 500;
}

.lgrb-locale-change {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: #fff !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    padding: 4px 10px !important;
    font-size: 1rem !important;
    line-height: 1 !important;
    color: #555 !important;
    flex-shrink: 0;
    pointer-events: none;
    visibility: visible !important;
    opacity: 1 !important;
}

.lgrb-locale-hidden-select {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0 !important;
    cursor: pointer !important;
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 16px !important;
    z-index: 2 !important;
    /* Defensive: alcuni browser (Safari) renderizzano il testo dell'option
       selezionata anche con opacity:0, sovrapposto alla span visibile. */
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
    text-shadow: none !important;
}

/* ── Toast popup ── */
.lgrb-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,.82);
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: .88rem;
    font-weight: 600;
    z-index: 20;
    pointer-events: none;
    white-space: nowrap;
    animation: lgrb-toast-fade 2s ease forwards;
}

@keyframes lgrb-toast-fade {
    0%   { opacity: 1; }
    70%  { opacity: 1; }
    100% { opacity: 0; }
}

/* ── Stepper ── */
.lgrb-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    gap: 4px;
    background: #f8f8f8;
    border-bottom: 1px solid #eee;
}

.lgrb-step-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 20px;
    font-size: .75rem;
    color: #aaa;
    cursor: default;
    transition: all .2s;
    white-space: nowrap;
}

.lgrb-step-indicator.active {
    background: #2c8c5a;
    color: #fff;
    font-weight: 600;
}

.lgrb-step-indicator.done {
    color: #2c8c5a;
    font-weight: 600;
}

.lgrb-step-icon {
    font-size: .9rem;
    line-height: 1;
}

.lgrb-step-label {
    display: none;
}

.lgrb-step-indicator.active .lgrb-step-label {
    display: inline;
}

.lgrb-step-chevron {
    color: #ccc;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    user-select: none;
}

/* ── Panel (each step content) ── */
.lgrb-panel {
    padding: 16px 20px 14px !important;
    background: transparent !important;
}

.lgrb-panel-title {
    margin: 0 0 16px;
    font-size: 1rem;
    font-weight: 700;
}

/* ── Inputs & Selects ── */
.lgrb-form-group {
    margin-bottom: 16px;
}

.lgrb-label {
    display: block !important;
    margin: 0 0 6px !important;
    padding: 0 !important;
    font-family: inherit !important;
    font-weight: 600 !important;
    font-size: .85rem !important;
    color: #444 !important;
    line-height: 1.3 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}

.lgrb-select-wrap {
    position: relative;
}

.lgrb-select-wrap::after {
    content: '▾';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #999;
    font-size: .85rem;
}

.lgrb-select,
.lgrb-input,
.lgrb-textarea {
    display: block !important;
    width: 100% !important;
    padding: 10px 14px !important;
    border: 1px solid #d8d8d8 !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #1a1a1a !important;
    font-family: inherit !important;
    font-size: .95rem !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
    transition: border-color .2s, box-shadow .2s !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    height: auto !important;
    min-height: 0 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}

.lgrb-select:focus,
.lgrb-input:focus,
.lgrb-textarea:focus {
    outline: none !important;
    border-color: #2c8c5a !important;
    box-shadow: 0 0 0 3px rgba(44,140,90,.12) !important;
}

.lgrb-select:disabled,
.lgrb-input:disabled,
.lgrb-textarea:disabled {
    background: #f5f5f5 !important;
    color: #999 !important;
}

.lgrb-select {
    padding-right: 36px !important;
    cursor: pointer;
}

.lgrb-textarea {
    resize: vertical !important;
    min-height: 60px !important;
}

/* ── Quantity stepper ── */
.lgrb-stepper-input {
    display: flex !important;
    align-items: stretch !important;
    gap: 0 !important;
    border: 1px solid #d8d8d8 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    background: #fff !important;
    height: 44px !important;
    padding: 0 !important;
}

.lgrb-booking .lgrb-stepper-input > .lgrb-qty-btn {
    flex: 0 0 44px !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 0 !important;
    max-height: 44px !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: #f5f5f5 !important;
    color: #1a1a1a !important;
    font-size: 1.2rem !important;
    font-weight: 400 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background .15s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    line-height: 1 !important;
    margin: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    box-sizing: border-box !important;
}

.lgrb-booking .lgrb-stepper-input > .lgrb-qty-btn:hover {
    background: #e8e8e8 !important;
}

.lgrb-booking .lgrb-stepper-input > .lgrb-qty-btn:active {
    background: #ddd !important;
}

.lgrb-qty-input {
    flex: 1 1 auto !important;
    width: auto !important;
    height: 44px !important;
    min-height: 0 !important;
    text-align: center !important;
    border: none !important;
    border-radius: 0 !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    background: transparent !important;
    color: #1a1a1a !important;
    font-family: inherit !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    -moz-appearance: textfield;
    line-height: 1.2 !important;
}

.lgrb-qty-input:focus {
    outline: none !important;
    box-shadow: none !important;
}

.lgrb-qty-input::-webkit-inner-spin-button,
.lgrb-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ── Calendar ── */
.lgrb-calendar {
    border-radius: 10px;
    overflow: hidden;
}

.lgrb-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px;
    font-weight: 700;
    font-size: 1rem;
}

.lgrb-cal-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #1a1a1a;
    font-size: 1.6rem;
    line-height: 1;
    padding: 4px 10px;
    border-radius: 8px;
    transition: background .15s;
}

.lgrb-cal-btn:hover {
    background: #f0f0f0;
}

.lgrb-cal-btn:disabled {
    opacity: .2;
    cursor: default;
}

.lgrb-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 0 2px 6px;
}

.lgrb-cal-dow {
    text-align: center;
    padding: 6px 2px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: lowercase;
    color: #999;
    letter-spacing: .03em;
}

.lgrb-cal-day {
    position: relative;
    text-align: center;
    padding: 10px 2px;
    font-size: .9rem;
    border-radius: 10px;
    cursor: default;
    transition: background .15s, color .15s;
    user-select: none;
}

.lgrb-cal-day.available {
    cursor: pointer;
    color: #1a1a1a;
    font-weight: 500;
}

.lgrb-cal-day.available:hover {
    background: #e8f5e9;
}

.lgrb-cal-day.past,
.lgrb-cal-day.closed {
    color: #ccc;
}

.lgrb-cal-day.today {
    font-weight: 800;
}

.lgrb-cal-day.today::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #2c8c5a;
    border-radius: 50%;
}

.lgrb-cal-day.selected {
    background: #2c8c5a;
    color: #fff;
    font-weight: 700;
}

.lgrb-cal-day.selected::after {
    display: none;
}

.lgrb-cal-icons {
    position: absolute;
    bottom: 1px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: .75rem;
    line-height: 1;
    pointer-events: none;
}

/* ── Promo day ── */
.lgrb-cal-day.promo {
    background: #fff8e1;
    border: 1.5px solid #ffca28;
}

.lgrb-cal-day.promo:hover {
    background: #fff0b3;
}

.lgrb-cal-day.promo.selected {
    background: #2c8c5a;
    border-color: #2c8c5a;
}

.lgrb-cal-promo {
    position: absolute;
    top: 1px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: .55rem;
    font-weight: 800;
    color: #e65100;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lgrb-cal-day.promo.selected .lgrb-cal-promo {
    color: rgba(255,255,255,.85);
}

/* ── Promo banner (step timeslot) ── */
.lgrb-promo-banner {
    background: linear-gradient(135deg, #fff8e1 0%, #fff3cd 100%);
    border: 1.5px solid #ffca28;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: .85rem;
    color: #6d4c00;
    text-align: center;
}

.lgrb-promo-banner strong {
    color: #e65100;
}

.lgrb-cal-day.loading {
    color: #ddd;
    animation: lgrb-pulse 1s ease-in-out infinite;
}

.lgrb-cal-day.empty {
    visibility: hidden;
}

@keyframes lgrb-pulse {
    0%, 100% { opacity: .15; }
    50% { opacity: .4; }
}

/* ── Calendar step — less bottom space (no buttons) ── */
#lgrb-step-calendar {
    padding-bottom: 0;
}

/* ── Navigation row ── */
.lgrb-nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 12px;
}

/* ── Buttons (scoped under .lgrb-booking to beat generic button reset) ── */
.lgrb-booking .lgrb-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 16px !important;
    border: 1px solid #d8d8d8 !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #1a1a1a !important;
    font-family: inherit !important;
    font-size: .9rem !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    line-height: 1.2 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-decoration: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
}

.lgrb-booking .lgrb-btn:hover {
    background: #f5f5f5 !important;
}

.lgrb-booking .lgrb-btn-primary {
    background: #2c8c5a !important;
    color: #fff !important;
    border-color: #2c8c5a !important;
}

.lgrb-booking .lgrb-btn-primary:hover {
    background: #247a4d !important;
}

.lgrb-booking .lgrb-btn:disabled {
    opacity: .4;
    cursor: default;
    pointer-events: none;
}

.lgrb-booking .lgrb-btn-block {
    display: flex;
    width: 100%;
    margin-top: 10px;
}

.lgrb-booking .lgrb-btn-back {
    border-color: transparent !important;
    background: transparent !important;
    color: #666 !important;
    padding-left: 8px !important;
}

.lgrb-booking .lgrb-btn-back:hover {
    color: #1a1a1a !important;
    background: #eee !important;
}

.lgrb-btn-next,
.lgrb-btn-submit {
    margin-left: auto;
}

/* ── Summary ── */
.lgrb-summary {
    background: #f8faf8;
    border: 1px solid #e0e8e0;
    border-radius: 10px;
    padding: 14px 16px;
    margin: 16px 0 4px;
    font-size: .85rem;
    line-height: 1.6;
    color: #444;
}

.lgrb-summary strong {
    color: #1a1a1a;
}

/* ── Privacy / checkbox ── */
.lgrb-privacy {
    margin: 16px 0 0;
}

.lgrb-check-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: .82rem;
    line-height: 1.45;
    color: #555;
}

.lgrb-check-label a {
    color: #2c8c5a !important;
    text-decoration: underline !important;
    font-family: inherit !important;
    font-weight: inherit !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.lgrb-check {
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: #2c8c5a;
}

/* ── Messages ── */
#lgrb-message {
    padding: 16px 20px;
    margin: 0 24px 20px;
    border-radius: 10px;
    font-size: .9rem;
    line-height: 1.5;
}

#lgrb-message.success {
    border: 1px solid #a5d6a7;
    background: #e8f5e9;
    color: #1b5e20;
}

#lgrb-message.error {
    border: 1px solid #ef9a9a;
    background: #ffebee;
    color: #b71c1c;
}

/* ── Confirmation overlay (outside .lgrb-booking scope: needs its own reset) ── */
.lgrb-confirm-overlay,
.lgrb-confirm-overlay * {
    box-sizing: border-box;
}

.lgrb-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    color: #1a1a1a !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-align: center !important;
    text-shadow: none !important;
}

.lgrb-confirm-dialog {
    background: #fff !important;
    border: none !important;
    border-radius: 14px !important;
    padding: 32px 28px !important;
    margin: 0 !important;
    max-width: 340px;
    width: 90%;
    text-align: center !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .2);
    cursor: default;
    color: inherit !important;
    font-family: inherit !important;
}

.lgrb-confirm-icon {
    font-size: 40px !important;
    line-height: 1 !important;
    margin: 0 0 12px !important;
    padding: 0 !important;
}

.lgrb-confirm-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
    color: #1a1a1a !important;
}

.lgrb-confirm-text {
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.45 !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #555 !important;
}

/* ── Loading overlay ── */
.lgrb-loading {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, .75);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
    min-height: 80px;
}

.lgrb-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: #2c8c5a;
    border-radius: 50%;
    animation: lgrb-spin .7s linear infinite;
}

@keyframes lgrb-spin {
    to { transform: rotate(360deg); }
}

/* ── Mobile ── */
@media (max-width: 480px) {
    .lgrb-booking {
        border-radius: 12px;
        box-shadow: 0 1px 8px rgba(0,0,0,.08);
    }

    .lgrb-header {
        padding: 20px 20px 14px;
    }

    .lgrb-panel {
        padding: 14px 20px 8px;
    }

    .lgrb-stepper {
        padding: 10px 10px;
        gap: 2px;
    }

    .lgrb-step-indicator {
        padding: 5px 6px;
        font-size: .7rem;
    }

    .lgrb-locale-bar {
        padding: 10px 20px;
    }

    #lgrb-message {
        margin: 0 20px 16px;
    }
}
