/* ==========================================================================
   Widget Newsletter — Layout
   ========================================================================== */

.nl-widget {
    position: relative;
    overflow: visible;
}

.nl-widget::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
}

.nl-widget--has-image .nl-widget__content {
    position: relative;
    z-index: 1;
}

/* Image décentrée (position contrôlée via Elementor) */
.nl-widget__image {
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 0;
    pointer-events: none;
    line-height: 0;
}

.nl-widget__image img {
    display: block;
    max-width: none;
    height: auto;
}

/* Titre */
.nl-widget__title {
    margin: 0 0 20px 0;
    font-family: 'Lato', sans-serif;
    font-weight: 800;
    line-height: 1.2;
    color: #1F2937;
}

.nl-highlight {
    color: #BE9E66;
}

/* ==========================================================================
   Formulaire — inline (prénom + email + bouton sur une row)
   ========================================================================== */

.nl-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.nl-form__field {
    flex: 1 1 200px;
}

body .nl-form__input {
    width: 100%;
    height: 45px;
    padding: 0 24px;
    border: 1px solid #999 !important;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    color: #333;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

body input[type=email]:not(.km-cart-cta__newsletter-input):not(.km-checkout-form__customer-card *):not(.km-checkout-auth__field *),
input[type=tel]:not(.km-cart-cta__newsletter-input):not(.km-checkout-form__customer-card *):not(.km-checkout-auth__field *),
input[type=text]:not(.km-cart-cta__newsletter-input):not(.km-checkout-form__customer-card *):not(.km-checkout-auth__field *) {
    border: 1px solid #c9c9c9 !important;
}

.nl-form__input:focus {
    border-color: #BE9E66;
}

.nl-form__btn {
    flex: 0 0 auto;
    height: 45px;
    padding: 0 36px;
    border: none;
    border-radius: 4px;
    background: linear-gradient(135deg, #d4b97c 0%, #BE9E66 40%, #a8874f 100%);
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.nl-form__btn:hover {
    opacity: 0.85;
}

.nl-form__btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.nl-form__legal {
    flex: 0 0 100%;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 4px;
    font-size: 12px;
    color: #888;
    line-height: 2;
}

.nl-form__legal input[type="checkbox"] {
    margin-top: 2px;
    accent-color: #BE9E66;
    flex-shrink: 0;
}

.nl-form__legal a {
    color: #BE9E66;
    text-decoration: underline;
}

.nl-form__legal a:hover {
    color: #a8874f;
}

/* ==========================================================================
   Messages succès / erreur (classes de newsletter-form.js)
   ========================================================================== */

.nl-form .km-newsletter-success {
    flex: 0 0 100%;
    padding: 12px 20px;
    border-radius: 8px;
    background: #f0f7ee;
    color: #3a7d23;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.nl-form .km-newsletter-error {
    flex: 0 0 100%;
    padding: 12px 20px;
    border-radius: 8px;
    background: #fdf0f0;
    color: #c0392b;
    font-size: 13px;
    margin-top: 4px;
}

/* Elementor : le widget container prend toute la hauteur */
.elementor-widget-km_newsletter,
.elementor-widget-km_newsletter .elementor-widget-container {
    height: 100%;
}

/* ==========================================================================
   Mode embedded — Newsletter intégrée dans un autre widget (sidebar)
   ========================================================================== */

.nl-widget--embedded {
    background-color: #F3F4F6;
    border-radius: 8px;
    position: relative;
    overflow: visible;
    padding: 24px 20px 20px;
}

.nl-widget--embedded.nl-widget--has-image {
    padding-top: 80px;
}

.nl-widget--embedded::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background-image: url('/wp-content/uploads/2026/03/background-image-newsletter.png');
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
}

.nl-widget--embedded>* {
    position: relative;
    z-index: 1;
}

.nl-widget--embedded .nl-widget__title {
    font-family: 'arca majora 3', 'Lato', sans-serif;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.35;
    margin: 0 0 16px;
}

.nl-widget--embedded .nl-form {
    gap: 10px;
}

.nl-widget--embedded .nl-form__input {
    height: 42px;
    font-size: 13px;
    padding: 0 16px;
}

.nl-widget--embedded .nl-form__btn {
    height: 42px;
    font-size: 13px;
    padding: 0 24px;
}

.nl-widget--embedded .nl-form__legal {
    font-size: 11px;
    line-height: 1.5;
}

/* ==========================================================================
   Mode compact — Pill sticky quand on scrolle au-delà du bloc complet
   ========================================================================== */

.nl-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 8px 20px;
    border-radius: 50px;
    background-color: #F3F4F6;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: visible;
}

.nl-compact[hidden] {
    display: none;
}

.nl-compact::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50px;
    background-image: url('/wp-content/uploads/2026/03/background-image-newsletter.png');
    background-size: cover;
    background-position: center;
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
}

.nl-compact>* {
    position: relative;
    z-index: 1;
}

.nl-compact__img {
    position: absolute;
    left: -50px;
    top: 70%;
    transform: translateY(-50%);
    width: 110px;
    height: auto;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
    z-index: 2;
    pointer-events: none;
}

.nl-compact__text {
    flex: 1;
    min-width: 0;
    font-family: 'Lato', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #262626;
    margin-top: 4px;
    white-space: nowrap;
    margin-left: 40px;
}

.nl-compact__text strong {
    font-family: 'arca majora 3', 'Lato', sans-serif;
    font-size: 18px;
    font-weight: 900;
    background: linear-gradient(135deg, #d4b97c 0%, #BE9E66 40%, #a8874f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nl-compact__btn {
    flex-shrink: 0;
    padding: 8px 18px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #d4b97c 0%, #BE9E66 40%, #a8874f 100%);
    font-size: 12px;
    font-weight: 700;
    font-family: 'Lato', sans-serif;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: nl-compact-pulse 2s ease-in-out infinite;
}

.nl-compact__btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 12px rgba(190, 158, 102, 0.4);
    animation: none;
}

@keyframes nl-compact-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(190, 158, 102, 0.4);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(190, 158, 102, 0);
    }
}

.nl-compact:not([hidden]) {
    animation: nl-compact-slideIn 0.35s ease-out;
}

@keyframes nl-compact-slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==========================================================================
   Mode sidebar — Layout vertical (mobile) forcé sur tous les écrans
   ========================================================================== */

.nl-widget--sidebar {
    overflow: visible !important;
}

.nl-widget--sidebar.nl-widget--has-image {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding-top: 80px !important;
    margin-top: 40px;
}

.nl-widget--sidebar .nl-widget__image {
    position: absolute !important;
    top: -50px !important;
    bottom: auto !important;
    right: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

.nl-widget--sidebar .nl-widget__image img {
    width: 200px !important;
    display: block !important;
}

.nl-widget--sidebar .nl-widget__content {
    width: 80% !important;
    max-width: 500px;
}

.nl-widget--sidebar .nl-widget__title {
    text-align: center !important;
}

.nl-widget--sidebar .nl-form {
    flex-direction: column !important;
    gap: 12px !important;
}

.nl-widget--sidebar .nl-form__field,
.nl-widget--sidebar .nl-form__btn {
    width: 100% !important;
}

.nl-widget--sidebar .nl-form__field {
    flex: 1 1 auto !important;
}

/* ==========================================================================
   Responsive — Tablette (768px – 1024px)
   Image en haut à droite, formulaire en colonne
   ========================================================================== */

@media (max-width: 1024px) and (min-width: 768px) {
    .nl-widget {
        overflow: visible !important;
    }

    .nl-widget__image {
        top: -100px !important;
        bottom: auto !important;
        right: 0px !important;
    }

    .nl-widget__image img {
        width: 300px !important;
    }

    .nl-form {
        flex-direction: column;
        gap: 12px;
    }

    .nl-form__field,
    .nl-form__btn {
        width: 100%;
    }

    .nl-form__field {
        flex: 1 1 auto !important;
    }
}

/* ==========================================================================
   Responsive — Mobile (< 768px)
   Image centrée en haut, formulaire en colonne
   ========================================================================== */

@media (max-width: 767px) {
    .nl-widget {
        overflow: visible !important;
    }

    .nl-widget--has-image {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-top: 80px;
    }

    .nl-widget__image {
        position: absolute !important;
        top: -100px !important;
        bottom: auto !important;
        right: auto !important;
        left: 50% !important;
        transform: translateX(-50%);
    }

    .nl-widget__image img {
        width: 250px !important;
        display: block;
    }

    .nl-widget__content {
        width: 100%;
    }

    .nl-form {
        flex-direction: column;
        gap: 12px;
    }

    .nl-form__field,
    .nl-form__btn {
        width: 100%;
    }

    .nl-form__field {
        flex: 1 1 10px;
    }
}