/* ========= GLOBAL BACKGROUND ========= */
html, body {
    height: 100%;
}

/* ✅ Fix: prevent padding from increasing width (stops mobile "off-center" drift) */
*, *::before, *::after {
  box-sizing: border-box;
}

/* optional but recommended: kills any leftover tiny horizontal scroll */
html, body {
  overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    color: white;

    display: flex;
    flex-direction: column;

    /* remove background from body */
    background: none;
    position: relative;
}

/* FIX: Safari-safe fixed wood background */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url("../assets/bg.jpg");
    background-repeat: repeat;
    background-size: 300px;
    z-index: -1; /* stays behind all content */
    pointer-events: none;
}

/* Mobile Safari fix */
@media (max-width: 900px) {
    body {
        background-attachment: scroll;
    }
}

/* ========= CONTENT AREA ========= */
#contentWrapper {
    flex: 1;
    padding: 20px;
}

/* ========= TOP MENU BAR ========= */
#mainMenuBar {
    width: 100%;
    background-color: #5c0000;
    padding: 0;
    box-sizing: border-box;

    display: flex;
    align-items: center;
    position: relative;
    z-index: 10000;
}

#mainMenuContainer {
    flex: 1;
    display: flex;
    justify-content: center;
}

/* Desktop menu */
.mainMenu {
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mainMenu li a {
    display: inline-block;
    padding: 12px 20px;
    color: #f2e7d5;
    font-weight: bold;
    text-decoration: none;
}

.mainMenu li a.active {
    color: #fa8a2d;
}

.mainMenu li a:hover {
    color: #fa8a2d;
}

/* ========= BURGER BUTTON ========= */
#burgerBtn {
    display: none;
    font-size: 32px;
    padding: 12px 16px;
    cursor: pointer;
    margin-left: auto;
    z-index: 10001;
}

/* ========= MOBILE FULLSCREEN MENU ========= */
@media (max-width: 900px) {

    /* RESET desktop flex layout completely */
    #mainMenuContainer {
        flex: none !important;
        display: block !important;          /* FIXES left-offset bug */
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: flex-start !important;
    }

    /* Burger visible */
    #burgerBtn {
        display: block;
        color: #fa8a2d;
    }

    /* Fullscreen sliding menu background */
    #mainMenuContainer {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 100%;
        background-color: #5c0000;

        transform: translateX(100%);
        transition: transform 0.35s ease;

        padding-top: 80px;
    }

    /* When opened */
    #mainMenuContainer.open {
        transform: translateX(0);
    }

    .mainMenu {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        padding-left: 30px;
        gap: 22px;
        display: flex;
    }

    .mainMenu li a {
        font-size: 22px;
        padding: 8px 0;
    }
}


/* ========= LOGO BAR ========= */
#logoBar {
    display: flex;
    align-items: center;
    background-color: #5c0000;
    padding: 10px 20px;
}

#logoBar img {
    height: 60px;
    margin-right: 20px;
}

#logoTitleWrapper {
    display: flex;
    flex-direction: column;
}

#sectionTitle {
    font-size: 28px;
    font-weight: bold;
}

#sectionSubtitle {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 4px;
}

/* ========= FOOTER MENU ========= */
ul.footerMenu {
    list-style: none !important;
    margin: 0 0 15px 0;
    padding: 0;

    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;

    gap: 12px;
    font-weight: 300;
    font-size: 14px;
}

ul.footerMenu li {
    display: inline-block;
}

/* Pipe separator */
ul.footerMenu li:not(:last-child)::after {
    content: " |";
    margin-left: 8px;
    opacity: 0.8;
    color: #fff;
}

ul.footerMenu li a {
    color: white;
    text-decoration: none;
}

ul.footerMenu li a.active {
    color: #fa8a2d;
    font-weight: 400;
}

ul.footerMenu li a:hover {
    color: #fa8a2d;
    text-decoration: underline;
}

/* Footer menu mobile layout */
@media (max-width: 900px) {
    ul.footerMenu {
        flex-direction: column;
        gap: 5px;
    }

    ul.footerMenu li:not(:last-child)::after {
        content: "";
        margin: 0;
    }
}

/* ========= FOOTER ========= */
footer {
    background-color: #5c0000;
    padding: 20px 10px;
    margin-top: auto;
}

footer .legal {
    width: 100%;
    text-align: center;
    font-size: 12px;
    opacity: 0.8;
}

footer a {
    color: #ffffff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
    opacity: 0.9;
}

footer a:visited,
footer a:active {
    color: #ffffff;
}

/* ============================================================
   CONTENT LAYOUT IMPROVEMENTS (Desktop + Mobile)
   ============================================================ */

/* ------ GENERAL TEXT COLOR (bone color) ------ */
body {
    color: #f2e7d5 !important;
}

/* Apply same tone to headings */
h1, h2, h3, h4 {
    color: #f2e7d5;
}

/* ------ DESKTOP WRAPPER ------ */
#contentWrapper {
    width: 100%;
    max-width: 1100px;   /* Adjust as you like: 900–1200px */
    margin: 0 auto;      /* center horizontally */
    padding: 40px 30px;  /* vertical breathing room */
    box-sizing: border-box;
}

/* ------ TEXT BLOCKS ------ */
.cms-text {
    font-size: 17px;
    line-height: 1.6;
    margin-bottom: 24px;
    text-align: justify;
    color: #f2e7d5;
}

/* Heading spacing */
.cms-heading {
    margin: 40px 0 20px 0;
    text-align: left;
}

.cms-subheading {
    margin: 25px 0 15px 0;
    text-align: left;
}

/* ------ IMAGE BLOCKS ------ */
.cms-image-block {
    width: 100%;
    margin: 35px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cms-image-block img.cms-image {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

.cms-caption {
    font-size: 14px;
    opacity: 0.85;
    margin-top: 6px;
    text-align: center;
    color: #f2e7d5;
}

/* ============================================================
   MOBILE OPTIMIZATION
   ============================================================ */
@media (max-width: 900px) {

    #contentWrapper {
        padding: 16px;
        max-width: 100%;
    }

    .cms-text {
        font-size: 16px;
        margin-bottom: 20px;
        text-align: left; /* justification looks bad on very narrow screens */
    }

    .cms-image-block {
        margin: 25px 0;
    }

    .cms-image-block img.cms-image {
        width: 100%;
    }
}

/* ============================================================
   IMAGE LIGHTBOX OVERLAY
   ============================================================ */

#lightboxOverlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;

    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);

    display: flex;
    justify-content: center;
    align-items: center;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 99998;
}

#lightboxOverlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* Full image */
#lightboxImg {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 6px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.6);
    animation: lightboxFade 0.25s ease;
}

@keyframes lightboxFade {
    from { transform: scale(0.94); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* Close button */
#lightboxClose {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 40px;
    line-height: 40px;
    cursor: pointer;
    color: #fff;
    z-index: 99999;
    text-shadow: 0 0 10px black;
}

#lightboxClose:hover {
    opacity: 0.7;
}

/* ============================================================
   CMS PAGE LOADER OVERLAY
   ============================================================ */

.loaderContainer {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;

    background: rgba(0, 0, 0, 0.65);  /* transparent dark overlay */
    backdrop-filter: blur(3px);

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;

    z-index: 99990;
}

.loaderContainer.active {
    opacity: 1;
    pointer-events: auto;
}

/* Spinner */
.loaderContainer .spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255,255,255,0.3);
    border-top-color: #fa8a2d;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Content fade-in effect */
#contentWrapper {
    opacity: 0;
    transition: opacity 0.35s ease;
}

#contentWrapper.ready {
    opacity: 1;
}

/* ============================================================
   IMAGE GRID SYSTEM (optimized, final, no conflicts)
   ============================================================ */

/* Base grid */
.cms-image-grid {
    display: grid;
    gap: 18px;
    margin: 20px 0; /* reduced outer margins */
}

/* Grid column layouts */
.cms-image-grid.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.cms-image-grid.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Remove big gap between consecutive grids */
.cms-image-grid + .cms-image-grid {
    margin-top: 12px;
}

/* Grid items become perfect squares */
.cms-image-grid .cms-image-block {
    position: relative;
    margin: 0;
    padding: 0;
    width: 100%;
    padding-top: 100%;    /* square */
    border: 2px solid #f2e7d5;
    border-radius: 6px;
    overflow: hidden;
}

/* Cropped image in square */
.cms-image-grid .cms-image-block img.cms-image {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hide captions inside grids */
.cms-image-grid .cms-caption {
    display: none !important;
}

/* Mobile (grid-3 becomes 2-col) */
@media (max-width: 900px) {
    .cms-image-grid.grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================
   FULL-WIDTH IMAGE (non-grid)
   ============================================================ */

.cms-image-block:not(.in-grid) {
    width: 100%;
    margin: 28px 0;
    border: 2px solid #f2e7d5;
    border-radius: 6px;
    overflow: hidden;
}

.cms-image-block:not(.in-grid) img.cms-image {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* ============================================================
   LIGHTBOX FULL IMAGE (no outer border needed)
   ============================================================ */

#lightboxImg {
    border:none !important;
    border-radius:6px;
}

/* ============================================================
   MAP STYLING (matches photo borders)
   ============================================================ */

.cms-map {
    width: 100%;
    height: 350px;              /* adjust if needed */
    border: 2px solid #f2e7d5;  /* bone color border */
    border-radius: 6px;
    overflow: hidden;
    margin: 20px 0 35px 0;      /* consistent with images */
    display: block;
}

/* ============================================================
   CONTACT FORM STYLING
   ============================================================ */

.contact-form {
    max-width: 600px;
    margin: 20px auto 60px auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
    border: 2px solid #f2e7d5;
    border-radius: 6px;
    background: rgba(0,0,0,0.25);
    color: #f2e7d5;
    box-sizing: border-box;
}

.contact-form textarea {
    resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: #f2e7d5aa;
}

/* Send button styled like "Modifica sito" admin button */
.contact-submit-btn {
    padding: 12px 20px;
    background: #fa8a2d;
    color: #000;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    align-self: flex-start;
    transition: 0.2s ease;
}

.contact-submit-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Mobile */
@media (max-width: 900px) {
    .contact-form {
        width: 100%;
        padding: 0 10px;
    }
}

/* ===== Lightbox "text mode" for privacy ===== */

#lightboxOverlay.text-mode {
    align-items: flex-start;
    padding-top: 80px;
}

#lightboxOverlay.text-mode #lightboxImg,
#lightboxOverlay.text-mode .lb-nav-btn {
    display: none;
}

#lightboxOverlay.text-mode #lightboxCaption {
    position: relative;
    bottom: auto;
    background: rgba(0,0,0,0.85);
    border-radius: 8px;
    max-width: 900px;
    width: calc(100% - 40px);
    margin: 0 auto;
    padding: 20px 24px;
}

#lightboxOverlay.text-mode #lightboxCaption .cms-text {
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    text-align: left;
}


.price-list-wrapper {
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.price-row {
  display:flex;
  justify-content:space-between;
  padding:14px 4px;
  border-bottom:1px solid #e5e7eb; /* same as CMS blocks */
  font-size:16px;
}

.price-title {
  text-align:left;
}

.price-value {
  text-align:right;
  font-weight:600;
}

/* ========= PUBLIC GALLERY (Square Cropped Grid) ========= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;        /* consistent grid spacing */
    margin-top: 24px;
}

/* Square tile wrapper */
.gallery-tile-public {
    position: relative;
    width: 100%;
    padding-top: 100%;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #f2e7d5;
    margin: 0;       /* ensure no extra spacing */
}

/* Cropped image filling the square */
.gallery-tile-public img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;   /* <-- Critical fix */
    display: block;
    border-radius: 6px;
    cursor: pointer;
}

/* Responsive behavior (matches CMS images) */
@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

@media (min-width: 901px) and (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* Admin grid variant just reuses similar style */
.gallery-grid-admin {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.gallery-tile {
    background: #f9fafb;
    border-radius: 8px;
    padding: 8px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

.gallery-tile-thumb {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
}

.gallery-tile-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-tile-thumb .drag-handle {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 11px;
    cursor: grab;
}

.gallery-tile.drag-over {
    outline: 2px dashed #2563eb;
}

.thumb-placeholder {
    width: 100%;
    padding-top: 75%;
    background: #e5e7eb;
}
  
@media (max-width: 900px) {
    .gallery-grid,
    .gallery-grid-admin {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 901px) and (max-width: 1200px) {
    .gallery-grid,
    .gallery-grid-admin {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Lightbox loading spinner */
#lightboxOverlay.loading::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 48px;
    height: 48px;
    margin: -24px 0 0 -24px;
    border: 4px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Fade-in */
#lightboxImg {
    opacity: 0;
    transition: opacity .25s ease;
}
#lightboxImg.visible {
    opacity: 1;
}

/* NAV BUTTONS */
.lb-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    font-size: 32px;
    padding: 10px 18px;
    cursor: pointer;
    border-radius: 6px;
    z-index: 50;
    opacity: 0.85;
}
#lightboxPrev { left: 20px; }
#lightboxNext { right: 20px; }

/* Caption text */
#lightboxCaption {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
    font-size: 15px;
    color: white;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}
/* ======================================
   LIGHTBOX FIXES + IMPROVEMENTS
====================================== */

#lightboxOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

#lightboxOverlay.open {
    opacity: 1;
    pointer-events: auto;
}

#lightboxOverlay.loading #lightboxImg {
    opacity: 0;
}

#lightboxImg {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    transition: opacity 0.25s;
    opacity: 1;
}

#lightboxCaption {
    position: absolute;
    bottom: 60px;
    color: white;
    font-size: 16px;
    text-align: center;
    padding: 6px 12px;
    background: rgba(0,0,0,0.5);
    border-radius: 6px;
    max-width: 80%;
}

/* Close button */
#lightboxClose {
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 38px;
    background: rgba(0,0,0,0.6);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: white;
    padding: 4px 12px;
    z-index: 100001;
}

/* Navigation arrows */
.lb-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    font-size: 40px;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    z-index: 100000;
}

#lightboxPrev { left: 30px; }
#lightboxNext { right: 30px; }

.lb-nav-btn:hover,
#lightboxClose:hover {
    background: rgba(255,255,255,0.25);
}

/* ======================================
   GALLERY SELECTOR (Styled like contact form)
====================================== */

.gallery-selector {
    max-width: 600px;
    margin: 20px auto 30px auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gallery-selector label {
    font-size: 16px;
    font-weight: bold;
    color: #f2e7d5;
}

.gallery-selector select {
    appearance: none;               /* remove ugly system styling */
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;

    border: 2px solid #f2e7d5;      /* SAME AS CONTACT FORM INPUT */
    border-radius: 6px;

    background: rgba(0,0,0,0.25);   /* SAME BACKGROUND TINT */
    color: #f2e7d5;

    cursor: pointer;
    box-sizing: border-box;

    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 20px;
}

/* Hover and focus (same as inputs) */
.gallery-selector select:hover {
    background-color: rgba(0,0,0,0.32);
}

.gallery-selector select:focus {
    outline: none;
    border-color: #fa8a2d;           /* orange highlight, optional */
    background-color: rgba(0,0,0,0.3);
}

/* Mobile */
@media (max-width: 900px) {
    .gallery-selector {
        width: 100%;
        padding: 0 10px;
    }
}

/* ===== Lightbox "text mode" for privacy ===== */

#lightboxOverlay.text-mode {
    align-items: flex-start;
    padding-top: 80px;
}

#lightboxOverlay.text-mode #lightboxImg,
#lightboxOverlay.text-mode .lb-nav-btn {
    display: none;
}

#lightboxOverlay.text-mode #lightboxCaption {
    position: relative;
    bottom: auto;
    background: rgba(0,0,0,0.85);
    border-radius: 8px;
    max-width: 900px;
    width: calc(100% - 40px);
    margin: 0 auto;
    padding: 20px 24px;
}

#lightboxOverlay.text-mode #lightboxCaption .cms-text {
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    text-align: left;
}

/* Contact-form-only loader (reuses same visuals but doesn't hide page) */
.form-loader {
    background: rgba(0,0,0,0.55); 
    backdrop-filter: blur(2px);
    pointer-events: none; /* Let user not click underlying UI */
}

.form-loader.active {
    pointer-events: all;
}

.grecaptcha-badge { visibility: hidden; }

.contact-privacy-row {
    margin-top: 8px;
    margin-left: -4px;   /* ⬅️ EXACT ALIGNMENT with input fields */
}

.privacy-label {
    display: flex;
    align-items: center; 
    gap: 10px;
    cursor: pointer;
}

/* Checkbox styled like the inputs */
.privacy-label input[type="checkbox"] {
    appearance: none;
    width: 22px;                 /* slightly larger, matches input border thickness */
    height: 22px;
    border: 2px solid #f2e7d5;   /* same color as your fields */
    border-radius: 4px;
    background: rgba(0,0,0,0.25);
    cursor: pointer;
    position: relative;
}

/* Checked */
.privacy-label input[type="checkbox"]:checked {
    background-color: #fa8a2d;
    border-color: #fa8a2d;
}

.privacy-label input[type="checkbox"]:checked::after {
    content: "✓";
    color: black;
    font-size: 14px;
    font-weight: bold;
    position: absolute;
    top: 0px;
    left: 4px;
}

/* Privacy text */
.contact-privacy-link {
    text-decoration: underline;
    cursor: pointer;
    color: #f2e7d5;
}

/* ============================
   CALENDAR GRID FIX
============================ */

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

/* Day header */
.calendar-grid .dow {
    color: #f2e7d5;
    background: rgba(0,0,0,0.25);
    border: 2px solid #f2e7d5;
    border-radius: 6px;
    padding: 6px 4px;
    text-align:center;
    font-weight:bold;
}

/* Day cell (all uniform) */
.calendar-grid .day {
    height: 70px;
    background: rgba(0,0,0,0.25);
    border: 2px solid #f2e7d5;
    border-radius: 6px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    color:#f2e7d5;
    transition:0.15s ease;
}

.calendar-grid .day.available-day:hover {
    border-color:#fa8a2d;
    transform: translateY(-2px);
}

.calendar-grid .day.disabled {
    opacity:0.35;
}

/* Selected day */
.calendar-grid .day.selected {
    outline:2px solid #fa8a2d;
    outline-offset:2px;
}

/* Badge under day number */
.calendar-grid .badge {
    margin-top:4px;
    font-size:10px;
    padding:2px 6px;
    border-radius:999px;
    background:#16a34a;
    color:white;
}

/* GRID layout for hours */
.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

/* Each hour slot */
.slot {
    border: 2px solid #f2e7d5;
    background: rgba(0,0,0,0.35);
    padding: 12px 10px;
    border-radius: 8px;
    text-align: center;
    color: #f2e7d5;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.15s ease;
    display:flex;
    justify-content: center;
    align-items:center;
    gap:6px;
    min-height: 48px;
}

/* Hover effect */
.slot:hover:not(.disabled) {
    border-color: #fa8a2d;
    transform: translateY(-2px);
}

/* Disabled & booked states */
.slot.disabled {
    cursor: not-allowed;
    opacity: 0.40;
}

.slot.booked {
    border-color: #e53935;
    background: rgba(229,57,53,0.22);
}

/* Pointer when hovering available calendar days */
.calendar-grid .day.available-day {
    cursor: pointer !important;
}

/* Pointer for slots */
.slot:not(.disabled) {
    cursor: pointer !important;
}

/* ============================
   CALENDAR / SLOTS VIEWS SWAP
============================ */

#calendarContainer {
    position: relative;
}

#calendarContainer {
    display: flex;
    flex-direction: column;
}

/* Both views share same width, fade when toggled */
#calendarView,
#slotsView {
    width: 100%;
    transition: opacity 0.25s ease, max-height 0.25s ease;
    opacity: 1;
    max-height: 2000px; /* big enough to allow long slot lists */
    overflow: hidden;
}

/* Hidden view: fades out + collapses */
.hidden-view {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
}

/* ===== STRONG VIEW COLLAPSE FIX ===== */

#calendarView.hidden-view,
#slotsView.hidden-view {
    opacity: 0;
    max-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Remove inner content so auto-sized children don’t keep layout height */
#calendarView.hidden-view #calendarGrid,
#calendarView.hidden-view .calendar-header {
    display: none !important;
}

/* =======================================
   BEAUTIFUL CROSS-FADE ANIMATION
======================================= */

/* Base states for both views */
#calendarView,
#slotsView {
    opacity: 1;
    transition: opacity 0.35s ease;
}

/* Hidden: fade out */
#calendarView.hidden-view,
#slotsView.hidden-view {
    opacity: 0;
}

/* Collapse layout AFTER fade ends (instant) */
#calendarView.hidden-view {
    max-height: 0 !important;
}

#slotsView.hidden-view {
    max-height: 0 !important;
}

/* Delay layout collapse a bit so opacity can animate */
#calendarView.hidden-view,
#slotsView.hidden-view {
    transition:
        opacity 0.35s ease,
        max-height 0s ease 0.35s; /* collapse after fade */
}

/* ==============================
   CALENDAR MONTH FADE ANIMATION
============================== */

/* initial state (visible) */
.calendar-grid,
#monthLabel {
    opacity: 1;
    transition: opacity 0.25s ease;
}

/* fade out before updating month */
.calendar-grid.fading-out,
#monthLabel.fading-out {
    opacity: 0;
}

/* fade in after updating month */
.calendar-grid.fading-in,
#monthLabel.fading-in {
    opacity: 0;
}

/* ===== HOLIDAY / EXCEPTION VISUALS ===== */

/* Base holiday cell style */
.holiday-day {
    position: relative;
    background: rgba(200,0,0,0.12) !important;
    border-color: rgba(200,0,0,0.35) !important;
}

/* Hidden overlay */
.holiday-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    pointer-events: none;

    /* the red label */
    background: rgba(200,0,0,0.85);
    color: white;
    font-weight: 700;
    text-align: center;
    padding: 6px;
    border-radius: 6px;

    /* fade animation */
    transition: opacity 0.25s ease;
}

/* Desktop hover: show overlay */
.holiday-day:hover .holiday-overlay {
    opacity: 1;
}

.holiday-day .holiday-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 0, 0, 0.35);
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    text-transform: uppercase;
    padding: 2px;
    text-align: center;

    /* 👇 responsive text scaling */
    font-size: clamp(8px, 2vw, 12px);
    line-height: 1.05;
    overflow-wrap: break-word;
}

.exception-day {
  background: #fff7da !important;
  border-color: #f5d27a !important;
}

/* Elegant available-day style (old scheduler look) */
.available-day {
  background: rgba(255,255,255,0.05) !important; /* subtle tint, almost original */
  border: 2px solid #fa8a2d !important;          /* beautiful orange-gold border */
  box-shadow: 0 0 4px rgba(250,138,45,0.3);      /* gentle glow */
  cursor: pointer !important;
}

/* Hover effect */
.available-day:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 8px rgba(250,138,45,0.6);
}

/* My own booked slot (green) */
.slot.mine {
    border-color: #16a34a !important;
    background: rgba(22, 163, 74, 0.25) !important;
    opacity: 1 !important;       /* not faded like full slots */
    cursor: pointer !important;
}

.input-error {
    border-color: #e53935 !important;
    background: rgba(200,0,0,0.18) !important;
}

/* ONE clean autofill override */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0px 1000px rgba(0,0,0,0.25) inset !important;
    box-shadow: 0 0 0px 1000px rgba(0,0,0,0.25) inset !important;
    -webkit-text-fill-color: #f2e7d5 !important;
    caret-color: #f2e7d5 !important;
    border-radius: 6px !important;
}

/* ----------------------------------------------------------
   BOOKING WRAPPER (full width)
----------------------------------------------------------- */
#bookingWrapper {
    width: 100%;
    max-width: none !important;
    padding: 20px 0 40px;
}

/* ----------------------------------------------------------
   SERVICE GRID — 2 columns on desktop, 1 on mobile
----------------------------------------------------------- */
#bookingChoices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;                     /* nice tight spacing */
    padding: 0 20px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    justify-items: center;
    box-sizing: border-box;
}

/* ✅ Force 2 columns on small phones (iPhone SE / small Android) */
@media (max-width: 520px){
  #bookingChoices{
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* force 2 cols */
    gap: 14px;
    padding: 0 12px; /* slightly smaller side padding */
  }

  /* let the card fill the grid cell fully */
  .service-card{
    max-width: none;
  }

  /* optional: small typographic tweaks so it stays readable */
  .service-card-title{
    font-size: 16px;
    padding: 8px 0 12px;
  }

  .service-card-desc{
    font-size: 13px;
    padding: 10px;
  }
}

/* Extra tiny devices */
@media (max-width: 340px){
  #bookingChoices{
    gap: 12px;
    padding: 0 10px;
  }

  .service-card-desc{
    font-size: 12px;
  }
}

/* ----------------------------------------------------------
   SERVICE CARD — TRANSPARENT WITH BONE BORDER (SITE STYLE)
----------------------------------------------------------- */
.service-card {
    width: 100%;
    max-width: 240px;

    background: transparent;             /* <— Transparent */
    border-radius: 12px;

    /* Bone-colored border (same as gallery/tile/input) */
    border: 2px solid #f2e7d5;

    /* Soft shadow to lift from wood background */
    box-shadow: 0 3px 6px rgba(0,0,0,0.25);

    overflow: hidden;
    cursor: pointer;

    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.service-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.35);
}

/* Wrap image so we can position the overlay */
.service-card-media{
  position: relative;
  width: 100%;
}

/* Semi-transparent overlay with description */
.service-card-desc{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);   /* <-- 0.5 opacity */
  color: #f2e7d5;                /* bone color */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  padding: 14px;
  box-sizing: border-box;

  opacity: 0;                    /* hidden by default (desktop) */
  transition: opacity 0.18s ease;

  pointer-events: none;          /* card click still works */
}

/* Show overlay on hover/focus (desktop) */
.service-card:hover .service-card-desc,
.service-card:focus-within .service-card-desc{
  opacity: 1;
}

/* Mobile: show overlay always (no hover on touch) */
/*@media (max-width: 900px){
  .service-card-desc{
    opacity: 1;
  }
}*/

/* ----------------------------------------------------------
   IMAGE (unchanged)
----------------------------------------------------------- */
.service-card-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* ----------------------------------------------------------
   TEXT BELOW IMAGE — ORANGE & CENTERED
----------------------------------------------------------- */
.service-card-title {
    padding: 10px 0 14px;

    text-align: center;
    font-size: 18px;
    font-weight: 600;

    color: #f2e7d5;                  /* <— Orange button color */

    /* subtle lift, not too bright */
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

#profileWrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 10px 0 40px;
}

.profile-section {
    margin-bottom: 28px;
}

.profile-card {
    border: 2px solid #f2e7d5;
    border-radius: 10px;
    padding: 16px 18px;
    background: rgba(0,0,0,0.25);
    box-shadow: 0 3px 8px rgba(0,0,0,0.35);
}

.profile-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.profile-meta {
    margin-top: 10px;
    font-size: 14px;
    opacity: 0.9;
}

.profile-meta div {
    margin-bottom: 2px;
}

/* ===== PROFILE DISABLED INPUT STYLE ===== */
.contact-form input[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    background: rgba(255,255,255,0.08); /* subtle brighter tint */
}

.profile-card {
    padding: 20px 20px;
}

.profile-inner {
    padding: 0 6px; /* matches visual feel of your contact form */
}

.contact-form input,
.contact-form textarea {
    width: 100%;
}

.profile-card {
    padding: 24px;
}

/* Uniform internal padding for profile form */
.profile-card .profile-form {
    padding: 0 20px 20px 20px;   /* matches card padding minus top */
}

/* Ensures the two-name row matches full width with internal padding */
.profile-card .profile-form .row2 {
    display: flex;
    gap: 14px;
    width: 100%;
}

/* Disabled phone field style */
.profile-card input[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ================================
   PROFILE – Segmented control
   Option B style (dark, bone border,
   active orange tab)
================================ */

.pf-segments {
    margin: 30px auto 10px auto;
    max-width: 600px;
    display: flex;

    border-radius: 999px;
    overflow: hidden;

    border: 2px solid #f2e7d5;          /* bone border */
    background: rgba(0,0,0,0.55);       /* dark pill background */
}

.pf-seg-btn {
    flex: 1;
    border: none;
    border-radius: 0;

    background: transparent;
    color: #f2e7d5;
    font-weight: 600;
    font-size: 15px;
    padding: 10px 0;
    text-align: center;
    cursor: pointer;

    transition: background 0.15s ease, color 0.15s ease;
}

/* Hover only on inactive tab */
.pf-seg-btn:not(.pf-seg-btn-active):hover {
    background: rgba(255,255,255,0.06);
}

/* Active tab – orange pill like other CTAs */
.pf-seg-btn-active {
    background: #fa8a2d;
    color: #000;
}

@media (max-width: 600px) {
    .pf-segments {
        max-width: 100%;
    }
    .pf-seg-btn {
        font-size: 14px;
        padding: 9px 0;
    }
}

/* ================================
   PROFILE – Generic card container
   (bookings + jobs)
================================ */

.pf-card {
    background: rgba(0,0,0,0.25);       /* same as profile-card */
    border-radius: 10px;
    border: 2px solid #f2e7d5;          /* bone border */
    padding: 18px 18px;
    margin-top: 14px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.35);

    color: #f2e7d5;                     /* bone text inside */
}

/* ================================
   BOOKINGS LIST
================================ */

.pf-booking-card {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 12px;
}

.pf-booking-main {
    display: flex;
    gap: 12px;
    flex: 1;
}

.pf-booking-datebox {
    min-width: 72px;
    text-align: center;

    border-radius: 8px;
    border: 1px solid #f2e7d5;
    background: rgba(0,0,0,0.35);

    padding: 6px 4px;
    box-sizing: border-box;
}

.pf-booking-day {
    font-size: 18px;
    font-weight: 700;
}

.pf-booking-month {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #f2e7d5cc;
}

.pf-booking-time {
    font-size: 12px;
    margin-top: 4px;
    color: #f2e7d5cc;
}

.pf-booking-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}

.pf-booking-service {
    font-weight: 600;
    font-size: 16px;
}

.pf-booking-job {
    font-size: 13px;
    color: #f2e7d5cc;
}

.pf-booking-id {
    font-size: 12px;
    color: #f2e7d5aa;
}

.pf-booking-actions {
    display: flex;
    align-items: center;
}

/* Cancel button: same style, slightly more compact */
.pf-booking-cancel-btn {
    padding: 8px 18px;
    font-size: 14px;
}

/* Mobile layout: stack booking card vertically */
@media (max-width: 700px) {
    .pf-booking-card {
        flex-direction: column;
        align-items: stretch;
    }

    .pf-booking-main {
        align-items: center;
    }

    .pf-booking-actions {
        justify-content: flex-end;
    }
}

/* ================================
   JOBS LIST
================================ */

.pf-job-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pf-job-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.pf-job-title {
    font-weight: 600;
}

.pf-job-date {
    color: #f2e7d5aa;
}

.pf-job-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pf-job-maininfo {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pf-job-guitar {
    font-weight: 500;
    font-size: 15px;
}

.pf-job-status {
    font-size: 13px;
}

.pf-job-price {
    font-size: 13px;
    color: #f2e7d5;
}

/* Compact meta row inside job cards */
.pf-job-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #f2e7d5cc;
    margin-top: 2px;
}

.pf-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    letter-spacing: 0.02em;
}

/* Progress bar adapted to dark theme */
.pf-job-progress {
    margin-top: 6px;
}

.pf-progress-bar {
    position: relative;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    overflow: hidden;
}

.pf-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: #fa8a2d;
}

.pf-progress-label {
    margin-top: 4px;
    font-size: 12px;
    color: #f2e7d5cc;
}

.pf-progress-sub {
    margin-top: 2px;
    font-size: 12px;
    color: #f2e7d5aa;
}

.pf-progress-sub {
    margin-top: 2px;
    font-size: 12px;
    color: #f2e7d5aa;
}

.pf-job-actions {
    margin-top: 4px;
}

/* Slightly slimmer "Prenota data ritiro" button */
.pf-job-book-btn {
    padding: 8px 18px;
    font-size: 14px;
}

/* Mobile: give some breathing room */
@media (max-width: 700px) {
    .pf-job-card {
        padding-top: 10px;
        padding-bottom: 10px;
    }
}

/* === USER JOB OVERLAY === */

/* Prevent background scroll when overlay is open */
body.no-scroll {
  overflow: hidden !important;
}

.userjob-overlay-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100000; /* above the top menu */
  transition: opacity 0.25s ease;
}

.userjob-hidden {
  opacity: 0;
  pointer-events: none;
}

.userjob-open {
  opacity: 1;
}

.userjob-overlay-sheet {
  width: 100%;
  max-width: 650px;
  background: rgba(0,0,0,0.85);
  border: 2px solid #f2e7d5;
  border-radius: 14px;
  padding: 20px;
  color: #f2e7d5;
  box-shadow: 0 10px 28px rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
}

/* Mobile: turn it into a bottom sheet */
@media (max-width: 700px) {
  .userjob-overlay-backdrop {
    align-items: flex-end;
  }
  .userjob-overlay-sheet {
    border-radius: 14px 14px 0 0;
    max-height: 86vh;
  }
}

.userjob-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.userjob-close-btn {
  background: none;
  border: none;
  color: #f2e7d5;
  font-size: 20px;
  cursor: pointer;
}

.userjob-content {
  margin-top: 20px;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 8px;
}

.uj-section {
  margin-bottom: 20px;
}

.uj-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.uj-row.total {
  border-top: 2px solid #f2e7d5;
  margin-top: 6px;
  padding-top: 6px;
}

.uj-price {
  font-weight: 600;
}

.uj-status {
  padding: 2px 8px;
  background: #fa8a2d;
  color: #000;
  border-radius: 6px;
  font-weight: 600;
}

.uj-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.uj-note {
  line-height: 1.5;
}

.userjob-footer {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

@media (max-width: 700px) {
  .userjob-footer {
    justify-content: stretch;
  }
  .userjob-footer .contact-submit-btn {
    width: 100%;
    justify-content: center;
  }
}

.pf-job-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.pf-job-actions .contact-submit-btn + .contact-submit-btn {
    margin-left: 10px;
}

/* ===== LOGIN PHONE INPUT LAYOUT ===== */

.phone-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Style the country selector like other selects */
.phone-input-group .select-wrapper select {
    appearance: none;
    width: 80px;
    height: 48px;
    padding: 0 12px;
    font-size: 22px;
    text-align: center;

    border: 2px solid #f2e7d5;
    border-radius: 6px;
    background: rgba(0,0,0,0.25);
    color: #f2e7d5;
    cursor: pointer;

    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
}

/* Prefisso + telefono, same look as other inputs */
.phone-number-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    border: 2px solid #f2e7d5;
    border-radius: 6px;
    background: rgba(0,0,0,0.25);
    padding: 0 12px;
    height: 48px;
    box-sizing: border-box;
}

.phone-number-wrapper span {
    font-size: 16px;
    margin-right: 6px;
    white-space: nowrap;
}

.phone-number-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: #f2e7d5;
    font-size: 16px;
}

/* ===== Disabled primary buttons (reuse profile look) ===== */

.contact-submit-btn[disabled],
.contact-submit-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* =====================================
   FULLSCREEN BOOKING MODAL
===================================== */
.booking-modal {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;

    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);

    display: flex;
    justify-content: center;
    align-items: center;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;

    z-index: 999999; /* above everything */
}

.booking-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.booking-modal-inner {
    width: 90%;
    max-width: 420px;

    background: rgba(0,0,0,0.35);
    border: 2px solid #f2e7d5;
    border-radius: 10px;
    padding: 26px 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.45);
}

#userDataModalMessage.error {
    color: #ffb3b3;
}

#userDataModalMessage.success {
    color: #b9ffb9;
}

@media (max-width: 900px) {
    .mainMenu li {
        width: 100%;
    }

    .mainMenu li a {
        display: block;          /* ⬅️ KEY FIX */
        width: 100%;
        padding: 12px 0;         /* vertical hit area */
    }
}

/* Scheduler: service caption above calendar */
.service-caption{
  width: 100%;                 /* ✅ stops “narrow when text is short” */
  max-width: 900px;
  margin: 0 auto 18px auto;

  position: relative;          /* needed for ::before/::after layers */
  overflow: hidden;

  border: 2px solid #f2e7d5;
  border-radius: 10px;

  padding: 12px 16px;
  box-sizing: border-box;

  color: #f2e7d5;
  text-align: center;
  font-size: 16px;
  line-height: 1.45;

  /* remove this, because now we use real <br> */
  white-space: normal;
}

/* Background image layer */
.service-caption.has-bg::before{
  content:"";
  position: absolute;
  inset: 0;
  background-image: var(--svc-bg);
  background-size: cover;
  background-position: center;
  opacity: 0.55;
  transform: scale(1.06); /* avoids edges when cover crops */
}

/* Dark overlay layer */
.service-caption.has-bg::after{
  content:"";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.70);
}

/* Text sits above layers */
.service-caption-inner{
  position: relative;
  z-index: 1;
}

.service-card-desc-inner{
  width: 100%;
  line-height: 1.35;
}

/* ============================
   CALENDAR GRID – MOBILE OVERFLOW FIX
============================ */

/* allow the 7 columns to shrink properly */
.calendar-grid{
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

/* prevent border+padding from making cells wider than the grid track */
.calendar-grid .dow,
.calendar-grid .day{
  box-sizing: border-box;
  min-width: 0;
}

/* responsive sizing so it fits even on super narrow phones */
.calendar-grid{
  gap: clamp(3px, 1.2vw, 6px);
}

.calendar-grid .dow{
  padding: clamp(2px, 1vw, 6px) clamp(1px, 0.8vw, 4px);
  font-size: clamp(10px, 2.8vw, 14px);
}

.calendar-grid .day{
  height: clamp(46px, 14vw, 70px);
  font-size: clamp(12px, 3.3vw, 16px);
}


#calendarView{
  overflow-x: auto;
}

/* ===== Lightbox: testo (privacy) scrollabile ===== */
#lightboxOverlay.open{
  overflow-y: auto;              /* permette scroll sull’overlay */
}

#lightboxOverlay.text-mode{
  align-items: flex-start;       /* non più centrato verticalmente */
  padding: 60px 20px;            /* spazio sopra/sotto per respirare */
  box-sizing: border-box;
}

#lightboxOverlay.text-mode #lightboxCaption{
  max-height: calc(100vh - 120px); /* limite altezza “finestra” */
  overflow-y: auto;                 /* scroll dentro al testo */
  -webkit-overflow-scrolling: touch;
  padding-right: 12px;              /* evita che la scrollbar “copra” testo */
}

/* ============================================================
   HEADER / NAV — FIXED HEIGHT (no jumps)
   - Control sizes only via :root variables in index.html:
       --nav-h, --nav-x, --logo-h
   - Header height is always exactly --nav-h (desktop/mobile),
     independent of page length.
   ============================================================ */

html body #mainMenuBar{
  width: 100%;
  height: var(--nav-h, 120px);          /* ✅ fixed, never changes */
  background-color: #5c0000;

  padding: 0 var(--nav-x, 22px);        /* ✅ no vertical padding => no height drift */
  box-sizing: border-box;

  display: flex;
  align-items: center;
  justify-content: center;

  position: relative;
  z-index: 10000;
}

/* Hide burger on desktop */
html body #burgerBtn{
  display: none;
}

/* Brand (logo) */
html body #brand{
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  margin-right: 26px;                  /* space between logo and menu */
}

html body #brand img{
  height: var(--logo-h, 120px) !important;
  width: auto;
  display: block;
  margin: 0;
}

/* Keep these IDs for existing JS but hide visually */
html body #logoTitleWrapper{
  display: none;
}

/* Menu container */
html body #mainMenuContainer{
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

/* Desktop menu */
html body .mainMenu{
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;

  flex-wrap: nowrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

html body .mainMenu li a{
  height: 100%;
  display: flex;
  align-items: center;

  white-space: nowrap;                 /* prevents "Chi / sono" split */
  padding: 0 18px;

  color: white;
  font-weight: bold;
  text-decoration: none;
}

html body .mainMenu li a.active,
html body .mainMenu li a:hover{
  color: #fa8a2d;
}

/* Mid screens: keep ONE row, just tighten spacing (still same height) */
@media (max-width: 1250px) and (min-width: 901px){
  html body .mainMenu li a{
    padding: 0 12px;
    font-size: 14px;
  }
}

/* ========= MOBILE ========= */
@media (max-width: 900px){

  html body #mainMenuBar{
    justify-content: center;
  }

  html body #brand{
    margin-right: 0;
    flex: 1;
    justify-content: center;
  }

  /* Burger icon overlay top-right */
  html body #burgerBtn{
    display: block;
    position: absolute;
    right: var(--nav-x, 14px);
    top: 50%;
    transform: translateY(-50%);

    color: white;
    font-size: 32px;
    padding: 12px 16px;
    cursor: pointer;
    z-index: 10001;
  }

  /* Menu panel slides under the fixed header */
  html body #mainMenuContainer{
    position: fixed;
    top: var(--nav-h, 128px);
    left: 0;
    right: 0;

    height: calc(100vh - var(--nav-h, 128px));
    width: 100%;
    background-color: #5c0000;

    transform: translateX(100%);
    transition: transform 0.35s ease;

    padding-top: 26px;
    display: block;
  }

  html body #mainMenuContainer.open{
    transform: translateX(0);
  }

  html body .mainMenu{
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;

    width: 100%;
    padding-left: 30px;
    gap: 22px;
  }

  /* Full-width tappable rows */
  html body .mainMenu li{
    width: 100%;
  }

  html body .mainMenu li a{
    height: auto;
    display: block;
    width: 100%;
    padding: 8px 0;
    font-size: 22px;
    white-space: nowrap;
  }
}


/* ================================
   JOBS – "DA STIMARE" visuals
================================ */

.pf-job-badge{
  display:inline-block;
  margin-left:8px;
  padding:2px 8px;
  border-radius:999px;
  font-size:11px;
  font-weight:800;
  letter-spacing:0.04em;
  vertical-align:middle;
}

.pf-job-badge-estimate{
  background:#fa8a2d;
  color:#000;
}

.pf-job-estimate-banner{
  margin-top:8px;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(250,138,45,0.45);
  background: rgba(250,138,45,0.12);
  color:#f2e7d5;
  font-size:13px;
  line-height:1.35;
}

.uj-estimate-pill{
  display:inline-block;
  margin-bottom:10px;
  padding:4px 10px;
  border-radius:999px;
  background:#fa8a2d;
  color:#000;
  font-weight:800;
  letter-spacing:0.04em;
  font-size:12px;
}

.uj-estimate-banner{
  margin: 10px 0 10px 0;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(250,138,45,0.55);
  background: rgba(250,138,45,0.14);
  color: #f2e7d5;
}

.uj-estimate-sub{
  margin-top:6px;
  font-size:13px;
  color:#f2e7d5cc;
  line-height:1.35;
}

.uj-muted{
  font-size:13px;
  color:#f2e7d5aa;
  line-height:1.45;
}
