/* ==========================================================================
   Page Lindhaus nel Mondo — Mappa interattiva + form contatto
   ========================================================================== */

/* ---------- Design tokens (shared) ---------- */
:root {
    --lh-blue: #4992BB;
    --lh-blue-light: #DCEBF3;
    --lh-gray-bg: #EBEBEB;
    --lh-text: #565656;
    --lh-text-dark: #333;
    --lh-footer-gray: #777474;
    --lh-white: #fff;
    --lh-radius: 10px;
    --lh-container: 1140px;
    --lh-gap: 32px;
    --lh-section-spacing: 60px;
    --lh-font-heading: 'Inter', sans-serif;
    --lh-font-body: 'Inter', sans-serif;
    --lh-font-btn: 'Roboto', sans-serif;
    --lh-header-height: 80px;
}

/* ---------- Base ---------- */
.lh-lnm-page {
    color: var(--lh-text);
    font-family: var(--lh-font-body);
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    overflow-x: clip;
}

.lh-lnm-page *,
.lh-lnm-page *::before,
.lh-lnm-page *::after {
    box-sizing: border-box;
}

.lh-lnm-page img {
    max-width: 100%;
    height: auto;
    display: block;
}

.lh-container {
    max-width: var(--lh-container);
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- 1. Hero — White bg left, primary blue diagonal right ---------- */
.lh-lnm-hero {
    position: relative;
    background: var(--lh-white);
    min-height: 60vh;
    min-height: 60dvh;
    overflow: hidden;
}

/* Primary blue diagonal overlay on right side */
.lh-lnm-hero::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: var(--lh-blue);
    clip-path: polygon(55% 0, 100% 0, 100% 100%, 45% 100%);
    z-index: 1;
}

.lh-lnm-hero__inner {
    position: relative;
    z-index: 2;
    max-width: var(--lh-container);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    min-height: 60vh;
    min-height: 60dvh;
}

.lh-lnm-hero__text-col {
    max-width: 400px;
    padding: 60px 0;
}

.lh-lnm-hero__title {
    font-family: var(--lh-font-heading);
    font-size: 42px;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 16px;
    color: var(--lh-blue);
    text-transform: uppercase;
}

.lh-lnm-hero__text {
    font-size: 14px;
    line-height: 1.3;
    color: #000;
}

.lh-lnm-hero__text p:last-child {
    margin-bottom: 0;
}

/* ---------- 2. Breadcrumb ---------- */
.lh-lnm-breadcrumb {
    background: #ebebeb;
    padding: 60px 0;
    font-size: 13px;
    color: var(--lh-footer-gray);
}

.lh-lnm-breadcrumb__inner {
    max-width: var(--lh-container);
    margin: 0 auto;
    padding: 0 20px;
}

.lh-lnm-breadcrumb__inner p {
    margin: 0;
}

.lh-lnm-breadcrumb__inner span:last-child {
    color: var(--lh-text-dark);
}

.lh-lnm-breadcrumb a {
    color: var(--lh-blue);
    text-decoration: none;
}

.lh-lnm-breadcrumb a:hover {
    text-decoration: underline;
}

/* ---------- 3. Content (WP editor) ---------- */
.lh-lnm-content {
    background: var(--lh-white);
    padding: var(--lh-section-spacing) 0;
}

.lh-lnm-content__inner {
    max-width: var(--lh-container);
    margin: 0 auto;
    padding: 0 20px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--lh-text);
}

.lh-lnm-content__inner h2,
.lh-lnm-content__inner h3,
.lh-lnm-content__inner h4 {
    font-family: var(--lh-font-heading);
    font-weight: 600;
    color: var(--lh-text-dark);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.lh-lnm-content__inner h2 {
    font-size: 28px;
}

.lh-lnm-content__inner h3 {
    font-size: 22px;
}

.lh-lnm-content__inner h4 {
    font-size: 18px;
}

.lh-lnm-content__inner p:first-child {
    margin-top: 0;
}

.lh-lnm-content__inner p:last-child {
    margin-bottom: 0;
}

.lh-lnm-content__inner a {
    color: var(--lh-blue);
    text-decoration: underline;
}

/* ---------- 4. Main: Map + Form stacked ---------- */
.lh-lnm-main {
    background: var(--lh-gray-bg);
    padding: 0 0 var(--lh-section-spacing);
}

.lh-lnm-main__inner {
    padding-top: 48px;
}

/* -- Map toggle buttons (positioned inside map wrapper) -- */
.lh-lnm-map-toggle {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 0;
}

.lh-lnm-map-toggle__btn {
    padding: 10px 32px;
    font-family: var(--lh-font-btn);
    font-size: 14px;
    font-weight: 500;
    border: 2px solid var(--lh-blue);
    background: rgba(255, 255, 255, 0.9);
    color: var(--lh-blue);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.lh-lnm-map-toggle__btn:first-child {
    border-radius: 20px 0 0 20px;
}

.lh-lnm-map-toggle__btn:last-child {
    border-radius: 0 20px 20px 0;
    border-left: none;
}

.lh-lnm-map-toggle__btn--active {
    background: var(--lh-blue);
    color: var(--lh-white);
}

.lh-lnm-map-toggle__btn:hover:not(.lh-lnm-map-toggle__btn--active) {
    background: var(--lh-blue-light);
}

/* -- Map section (full width) -- */
.lh-lnm-map-col {
    width: 100%;
}

.lh-lnm-map-wrapper {
    position: relative;
    background: var(--lh-blue-light);
    overflow: hidden;
    height: 80vh;
    height: 80dvh;
}

/* Map inner containers fill the wrapper height */
.lh-lnm-map__world,
.lh-lnm-map__usa {
    height: 80vh;
    height: 80dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 20px;
    /* top padding for toggle buttons */
}

/* When JS shows/hides via style.display, we need to re-apply flex */
.lh-lnm-map__usa[style*="display: none"] {
    display: none !important;
}

.lh-lnm-map-wrapper svg {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
}

/* -- Zoom controls -- */
.lh-lnm-zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lh-lnm-zoom-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--lh-blue);
    background: rgba(255, 255, 255, 0.92);
    color: var(--lh-blue);
    font-size: 22px;
    font-weight: 600;
    line-height: 1;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    user-select: none;
}

.lh-lnm-zoom-btn:hover {
    background: var(--lh-blue);
    color: var(--lh-white);
}

.lh-lnm-zoom-btn:active {
    transform: scale(0.92);
}

/* -- Form section (centered, narrower) -- */
.lh-lnm-form-col {
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}

/* -- SVG countries -- */
.lh-map-country {
    fill: #fff;
    stroke: var(--lh-blue-light);
    stroke-width: 0.5;
    cursor: default;
    transition: fill 0.2s;
}

.lh-map-country--active {
    fill: var(--lh-blue);
    cursor: pointer;
}

.lh-map-country--active:hover {
    fill: #3a7d9e;
}

.lh-map-country--selected {
    fill: #2c6d8a;
    stroke: var(--lh-blue-light);
    stroke-width: 1.5;
}

/* -- Tooltip -- */
.lh-lnm-tooltip {
    position: absolute;
    background: var(--lh-text-dark);
    color: var(--lh-white);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-family: var(--lh-font-body);
    pointer-events: none;
    z-index: 100;
    transform: translate(-50%, -100%);
    margin-top: -8px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s;
}

.lh-lnm-tooltip--visible {
    opacity: 1;
}

.lh-lnm-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--lh-text-dark);
}

/* ---------- Form styles (mirrored from diventa-distributore) ---------- */
.lh-dd-form__title {
    font-family: var(--lh-font-heading);
    font-size: 28px;
    font-weight: 600;
    color: var(--lh-text-dark);
    margin: 0 0 32px;
}

.lh-dd-form__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 24px;
}

.lh-dd-form__field--full {
    grid-column: 1 / -1;
}

/* Privato/Azienda (30%) + Nome azienda (70%) row */
.lh-dd-form__field--tipo {
    grid-column: 1 / 2;
}

.lh-dd-form__field--azienda {
    grid-column: 2 / -1;
}

/* Indirizzo (50%) + Città (25%) + CAP (25%) row: 4-col subgrid */
.lh-dd-form__field--indirizzo {
    grid-column: 1 / -1;
}

/* Read-only inputs (e.g. Paese di riferimento set from map) */
.lh-dd-form__field input[readonly] {
    background: #f5f5f5;
    cursor: default;
}

/* Labels */
.lh-dd-form__field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--lh-text-dark);
    margin-bottom: 6px;
}

.lh-dd-form__field label .required {
    color: #c0392b;
}

/* Inputs */
.lh-dd-form__field input[type="text"],
.lh-dd-form__field input[type="email"],
.lh-dd-form__field input[type="tel"],
.lh-dd-form__field input[type="url"],
.lh-dd-form__field select,
.lh-dd-form__field textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: var(--lh-font-body);
    font-size: 15px;
    color: var(--lh-text-dark);
    background: var(--lh-white);
    transition: border-color 0.2s;
    outline: none;
}

.lh-dd-form__field input:focus,
.lh-dd-form__field select:focus,
.lh-dd-form__field textarea:focus {
    border-color: var(--lh-blue);
}

.lh-dd-form__field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23565656' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.lh-dd-form__field textarea {
    resize: vertical;
    min-height: 120px;
}

/* Checkbox */
.lh-dd-form__field--checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
    font-size: 14px;
    color: var(--lh-text);
    cursor: pointer;
}

.lh-dd-form__field--checkbox input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--lh-blue);
}

.lh-dd-form__field--checkbox a {
    color: var(--lh-blue);
    text-decoration: underline;
}

/* Error state */
.lh-dd-form__input--error {
    border-color: #c0392b !important;
    box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.15);
}

/* Submit button */
.lh-dd-form__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 40px;
    background: var(--lh-blue);
    color: var(--lh-white);
    border: none;
    border-radius: var(--lh-radius);
    font-family: var(--lh-font-btn);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    min-width: 200px;
    position: relative;
}

.lh-dd-form__submit:hover {
    background: #3a7d9e;
}

.lh-dd-form__submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.lh-dd-form__spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--lh-white);
    border-radius: 50%;
    animation: lh-dd-spin 0.6s linear infinite;
}

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

/* Feedback messages */
.lh-dd-form__feedback {
    margin-top: 20px;
    padding: 0;
    font-size: 15px;
    border-radius: 6px;
}

.lh-dd-form__feedback:empty {
    display: none;
}

.lh-dd-form__feedback--success {
    display: block;
    padding: 16px 20px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.lh-dd-form__feedback--error {
    display: block;
    padding: 16px 20px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Tablet large */
@media (max-width: 1100px) {
    .lh-lnm-hero::after {
        display: none;
    }

    .lh-lnm-hero {
        background: var(--lh-blue-light);
    }
}

/* Tablet */
@media (max-width: 768px) {
    .lh-lnm-hero {
        min-height: auto;
    }

    .lh-lnm-hero__inner {
        min-height: auto;
        padding: 40px 20px;
    }

    .lh-lnm-hero__title {
        font-size: 30px;
    }

    .lh-lnm-map-wrapper {
        height: 60vh;
        height: 60dvh;
    }

    .lh-lnm-map__world,
    .lh-lnm-map__usa {
        height: 60vh;
        height: 60dvh;
    }

    .lh-dd-form__grid {
        grid-template-columns: 1fr;
    }

    .lh-dd-form__field--tipo,
    .lh-dd-form__field--azienda,
    .lh-dd-form__field--indirizzo,
    .lh-dd-form__field--citta,
    .lh-dd-form__field--cap {
        grid-column: 1 / -1;
    }

    .lh-dd-form__title {
        font-size: 24px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .lh-lnm-hero__inner {
        padding: 20px;
    }

    .lh-lnm-hero__title {
        font-size: 26px;
    }

    .lh-dd-form__submit {
        width: 100%;
    }
}