/* Alpine Newsletter Styles */

/* ==========================================================================
   Base Styles (Shared between Popup & Static Section)
   ========================================================================== */

   .alpine-newsletter-wrapper {
    font-family: var(--alpine-font-main);
    position: relative;
    background-color: var(--alpine-light-grey); /* Subtle background */
    border-radius: 8px;
    padding: 30px 40px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden; /* Contain pseudo-elements if needed */
}

.alpine-newsletter-inner {
    display: flex;
    align-items: center;
    gap: 30px;
    position: relative;
    z-index: 1;
}

.alpine-newsletter-icon-area { /* Area for potential icon/graphic */
    flex: 0 0 80px; /* Adjust size as needed */
    text-align: center;
    /* Add styles for an icon (e.g., background-image or FontAwesome) */
    /* Example using FontAwesome */
    /* font-size: 50px; */
    /* color: var(--alpine-red); */
}

.alpine-newsletter-content {
    flex-grow: 1;
}

.alpine-newsletter-title {
    font-size: 28px; /* Adjusted size */
    font-weight: 700;
    color: var(--alpine-dark-text);
    margin: 0 0 5px 0;
    line-height: 1.2;
}

.alpine-newsletter-title span {
    display: block;
    font-size: 18px; /* Subtitle size */
    font-weight: 400;
    color: var(--alpine-text-secondary);
}

.alpine-newsletter-offer {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.alpine-newsletter-offer .percentage {
    font-size: 48px;
    font-weight: 700;
    color: var(--alpine-red);
    line-height: 1;
}

.alpine-newsletter-offer .text {
    font-size: 15px;
    color: var(--alpine-text-secondary);
    line-height: 1.5;
}

.alpine-newsletter-form form {
    position: relative;
    display: flex;
    gap: 10px;
    max-width: 450px;
}

.alpine-newsletter-form input[type="text"],
.alpine-newsletter-form input[type="email"] /* Add email type */
{ 
    flex-grow: 1;
    height: 44px;
    padding: 0 15px;
    border: 1px solid var(--alpine-border-color);
    border-radius: 22px; /* Rounded input */
    background-color: var(--alpine-light-bg);
    color: var(--alpine-text-main);
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.alpine-newsletter-form input[type="text"]:focus,
.alpine-newsletter-form input[type="email"]:focus
{
    border-color: var(--alpine-red);
    box-shadow: 0 0 0 2px rgba(255, 35, 44, 0.2);
    outline: none;
}

.alpine-newsletter-form input[type="submit"] {
    height: 44px;
    padding: 0 25px;
    border: none;
    border-radius: 22px;
    background-color: var(--alpine-red);
    color: var(--alpine-light-bg);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap; /* Prevent button text wrapping */
}

.alpine-newsletter-form input[type="submit"]:hover {
    background-color: #e01e26; /* Darker red on hover */
}

.alpine-newsletter-form .tooltip-error {
    position: absolute;
    bottom: 100%; /* Position above the form */
    left: 0;
    right: 0;
    margin-bottom: 5px;
    background-color: var(--alpine-red);
    color: var(--alpine-light-bg);
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 4px;
    text-align: center;
    display: none; /* Hidden by default */
    z-index: 2;
}

/* Thanks Message Styling */
.alpine-newsletter-thanks {
    display: none; /* Hidden by default */
    padding: 40px 20px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--alpine-dark-text);
}

.alpine-newsletter-thanks img {
    display: block;
    margin: 0 auto 15px auto;
    max-height: 50px;
}

/* Show thanks message and hide form when .thanks class is added */
.alpine-newsletter-wrapper.thanks .alpine-newsletter-form,
.alpine-newsletter-wrapper.thanks .alpine-newsletter-title,
.alpine-newsletter-wrapper.thanks .alpine-newsletter-offer,
.alpine-newsletter-wrapper.thanks .alpine-newsletter-icon-area,
.alpine-newsletter-wrapper.thanks .alpine-newsletter-content /* Hide original content */
{
    display: none;
}

.alpine-newsletter-wrapper.thanks .alpine-newsletter-thanks {
    display: block;
}

/* ==========================================================================
   Popup Specific Styles (#popup_2)
   ========================================================================== */

#popup_2 {
    position: fixed;
    top: 0;
    left: 0; /* Adjusted for LTR/RTL neutrality */
    width: 100%;
    height: 100%;
    z-index: 1001; /* High z-index */
    background: rgba(27, 27, 27, 0.6); /* Darker overlay */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0; /* Start hidden for transition */
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s linear;
}

#popup_2.active { /* Use an 'active' class to show popup */
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s linear;
}

#popup_2 .alpine-newsletter-wrapper { /* Use the base wrapper */
    width: 90%;
    max-width: 700px; /* Adjusted max-width */
    margin: auto;
    transform: scale(0.9); /* Start slightly smaller */
    transition: transform 0.3s ease;
    position: relative; /* For close button */
}

#popup_2.active .alpine-newsletter-wrapper {
    transform: scale(1);
}

.popup_2-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background-color: rgba(0,0,0,0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    z-index: 3;
}

.popup_2-close:hover {
    background-color: rgba(0,0,0,0.2);
}

.popup_2-close i.icon-close::before, 
.popup_2-close i.icon-close::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 2px;
    background-color: var(--alpine-dark-text);
    top: 50%;
    left: 50%;
    margin-top: -1px;
    margin-left: -8px;
}

.popup_2-close i.icon-close::before {
    transform: rotate(45deg);
}

.popup_2-close i.icon-close::after {
    transform: rotate(-45deg);
}


/* ==========================================================================
   Static Section Specific Styles (.section--newsletter)
   ========================================================================== */

.section--newsletter {
    padding: 60px 0;
    background-color: #000000; /* Example: slightly different background for static */
    margin: 50px 0;
    position: relative;
    box-shadow: inset 0px -290px 200px -200px #434343;
    max-width: 1200px;
    margin: 50px auto;
    border-radius: 30px;
}

.section--newsletter .alpine-newsletter-wrapper {
    max-width: 940px; /* Retain original max-width for static section */
    margin: 0 auto;
    /* Static section specific overrides if needed */
}

/* Styles specifically for the newsletter form block within the .section--newsletter */
.section--newsletter .newsletterBlock-1 {
    position: relative;
    z-index: 2;
    padding-left: 400px; /* Initial padding for desktop layout with image */
    /* background-color: var(--alpine-dark-text); */ /* CHANGE: Set background to dark */
    padding: 20px; /* Add some padding */
    border-radius: 4px; /* Optional: add slight rounding */
    margin: auto;
}

/* Adjust text color within the block to be light */
.section--newsletter .newsletterBlock-1,
.section--newsletter .newsletterBlock-1 p,
.section--newsletter .newsletterBlock-1 h3,
.section--newsletter .newsletterBlock-1 label {
    color: var(--alpine-light-bg); /* Light text on dark background */
}

/* Input styling adjustments for dark background */
.section--newsletter .newsletterBlock-1 input[type="email"] {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--alpine-light-bg);
}
.section--newsletter .newsletterBlock-1 input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Button styling adjustments for dark background */
.section--newsletter .newsletterBlock-1 .alpine-button {
    background-color: var(--alpine-red);
    color: var(--alpine-light-bg);
    border: 1px solid var(--alpine-red);
}
.section--newsletter .newsletterBlock-1 .alpine-button:hover {
    background-color: transparent;
    color: var(--alpine-red);
}

/* Media query adjustments for the newsletter block */
@media (max-width: 991px) {
    .section--newsletter .newsletterBlock-1 {
        padding-left: 20px; /* Adjust padding */
    }
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 767px) {
    .alpine-newsletter-wrapper {
        padding: 20px;
    }

    .alpine-newsletter-inner {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .alpine-newsletter-icon-area {
        flex-basis: auto;
        margin-bottom: 10px;
    }

    .alpine-newsletter-title {
        font-size: 24px;
    }

    .alpine-newsletter-title span {
        font-size: 16px;
    }

    .alpine-newsletter-offer {
        flex-direction: column;
        gap: 5px;
        margin: 15px 0;
    }

    .alpine-newsletter-offer .percentage {
        font-size: 40px;
    }

    .alpine-newsletter-offer .text {
        font-size: 14px;
        text-align: center;
    }

    .alpine-newsletter-form form {
        flex-direction: column;
        max-width: 100%;
    }

    .alpine-newsletter-form input[type="submit"] {
        width: 100%; /* Full width button on mobile */
    }

    #popup_2 .alpine-newsletter-wrapper {
        width: 90%;
    }

    .section--newsletter {
        padding: 40px 0;
    }
}


/* ==========================================================================
   Cleanup: Remove potentially conflicting old styles (Visual only)
   ========================================================================== */

/* These selectors were used in the old CSS. 
   Keeping them here commented out for reference during cleanup.
   They should be removed from style.css */

/*
div#popup_2-inner,
div#popup_2-inner i.icon-close,
span.popup_2-title,
span.popup_2-title span,
div#popup_2-inner:before,
span.popup_2-content,
span.popup_2-content span:nth-child(2),
span.popup_2-content span:nth-child(1),
div#popup_2-inner:after,
#popup_2 form,
input#newsletter-input2,
input#newsleter-button2,
span.popup_2-title:after,
div#popup_2-inner i.icon-close:after,
div#popup_2-inner i.icon-close:before,
#popup_2 .newsletterBlock-1 .tooltip-error,
div#popup_2.thanks form,
div#popup_2.thanks .popup-thanks,
.newsletterBlock-1,
.popup-thanks,
.section--newsletter #popup_2-inner,
.section--newsletter #popup_2-inner:after,
.section--newsletter .newsletterBlock-1,
.section--newsletter .popup_2-title,
.section--newsletter form,
.section--newsletter.thanks form,
.section--newsletter.thanks .popup-thanks
*/ 

/* ==========================================================================
   Homepage Newsletter Section
   ========================================================================== */

.newsletter-section {
    padding: 80px 0;
    background: #ffffff;
    font-family: var(--alpine-font-main, 'Atlas AAA', sans-serif);
}

.newsletter-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 50px 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    border: 1px solid #e5e5e5;
}



.newsletter-text {
    flex: 1;
}

.newsletter-heading {
    font-size: 32px;
    font-weight: 900;
    color: #e0373e;
    margin: 0 0 7px 0;
    line-height: 1;
    text-align: right;
}

.newsletter-description {
    font-size: 16px;
    color: var(--alpine-text-secondary, #666);
    margin: 0;
    line-height: 1.5;
    text-align: right;
    text-wrap-style: balance;
}

.newsletter-form-container {
    flex: 0 0 400px;
}

.newsletter-form {
    margin: 0;
}

.footer-newsletter-section .form-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: none;
    transition: none;
    margin-bottom: 9px;
}

.newsletter-input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 12px 0;
    font-size: 16px;
    color: var(--alpine-dark-text, #333);
    outline: none;
    border-radius: 0;
    border-bottom: 1px solid #ddd;
    direction: rtl;
    text-align: center;
    transition: border-color 0.2s ease;
}

.newsletter-input:focus {
    border-bottom-color: var(--alpine-red, #e0192e);
}

.newsletter-input::placeholder {
    color: var(--alpine-text-secondary, #999);
    text-align: center;
}

.newsletter-button {
    gap: 10px;
    background: var(--alpine-red, #e0192e);
    color: white;
    border: none;
    padding: 0;
    border-radius: 10px;
    width: 100%;
    display: flex;
    height: 50px;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    aspect-ratio: 1/1;
}

.newsletter-button i {
    margin: 0;
}

.newsletter-button:hover {
    background: #c01729;
    transform: translateX(-2px);
}

.newsletter-privacy {
    font-size: 13px;
    color: var(--alpine-text-secondary, #888);
    margin: 0;
    text-align: center;
    direction: rtl;
}

.newsletter-privacy i {
    color: #28a745;
    margin-left: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .newsletter-section {
        padding: 60px 0;
    }
    
    .newsletter-card {
        flex-direction: column;
        padding: 40px 30px;
        gap: 30px;
        margin: 0 20px;
    }
    
    .newsletter-text {
        text-align: center;
    }
    
    .newsletter-heading {
        font-size: 28px;
        text-align: center;
    }
    
    .newsletter-description {
        text-align: center;
    }
    
    .newsletter-form-container {
        flex: none;
        width: 100%;
        max-width: 400px;
    }
    
    .form-row {
        flex-direction: column;
        padding: 8px;
        gap: 8px;
    }
    
    .newsletter-input {
        background: white;
        border: 1px solid #ddd;
        padding: 12px 16px;
        text-align: center;
    }
    
    .newsletter-button {
        padding: 12px 24px;
    }
}

@media (max-width: 480px) {
    .newsletter-section {
        padding: 50px 0;
    }
    
    .newsletter-card {
        margin: 0 15px;
        padding: 30px 20px;
    }
    
    .newsletter-heading {
        font-size: 24px;
    }
    
    .newsletter-description {
        font-size: 15px;
    }
}

/* Simple Loading States */
.newsletter-form.loading .newsletter-button {
    opacity: 0.7;
    pointer-events: none;
}

.newsletter-form.loading .newsletter-button::after {
    content: 'שולח...';
}

/* Success State */
.newsletter-form.success .newsletter-button {
    background: #28a745;
    pointer-events: none;
}

.newsletter-form.success .newsletter-button::after {
    content: 'נשלח בהצלחה!';
}

/* Error State */
.newsletter-form.error .form-row {
    border-color: #dc3545;
}

/* Newsletter Success Modal */
.newsletter-success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.newsletter-success-modal.active {
    display: flex;
    opacity: 1;
}

.newsletter-success-modal-content {
    background: white;
    padding: 50px 40px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.newsletter-success-modal.active .newsletter-success-modal-content {
    transform: scale(1);
}

.newsletter-success-modal-icon {
    width: 80px;
    height: 80px;
    background: #28a745;
    border-radius: 50%;
    margin: 0 auto 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
}

.newsletter-success-modal-title {
    font-size: 28px;
    font-weight: 900;
    color: var(--alpine-dark-text, #333);
    margin: 0 0 15px 0;
}

.newsletter-success-modal-text {
    font-size: 16px;
    color: var(--alpine-text-secondary, #666);
    margin: 0 0 30px 0;
    line-height: 1.6;
}

.newsletter-success-modal-close {
    background: var(--alpine-red, #e0192e);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.newsletter-success-modal-close:hover {
    background: #c01729;
}

/* Hide message elements in footer form */
.footer-newsletter-section .newsletter-success-message,
.footer-newsletter-section .newsletter-error-message {
    display: none !important;
} 