/* Contenedor Principal (Por defecto flotante) */
.re-newsletter-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #e00712;
    color: #ffffff;
    box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.35);
    z-index: 2147483647 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    padding: 18px 50px 18px 25px;
    box-sizing: border-box;
    animation: reSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Modo Estático (Para integrarse limpiamente dentro de content.php) */
.re-newsletter-container.is-static {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 25px 0 !important;
    padding: 25px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    animation: none !important;
    z-index: 1 !important;
}

.re-newsletter-container.is-static .re-newsletter-close {
    display: none !important;
}

@keyframes reSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.re-newsletter-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.re-newsletter-text {
    flex: 1;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 0px;
}

.re-newsletter-text h3 {
    margin: 0 0 6px 0;
    font-size: 19px;
    color: #ffffff;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.3px;
}

.re-newsletter-text p {
    margin: 0;
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.35;
}

/* Icono del Correo - Dimensiones fijas para evitar deformación ovalada */
.re-newsletter-icon {
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    transition: background 0.3s ease, transform 0.3s ease;
    perspective: 400px;
    flex-shrink: 0;
}

.re-icon-mail {
    display: block;
    overflow: visible;
}

.re-icon-check {
    display: none;
}

/* Solapa superior abriéndose y carta saliendo */
#re-mail-top-flap {
    transform-origin: 12px 8px;
    transition: transform 0.5s ease;
    animation: reOpenFlapLoop 4s ease-in-out infinite;
}

#re-mail-letter {
    transform-origin: center bottom;
    transition: transform 0.5s ease;
    animation: reEmergeLetterLoop 4s ease-in-out infinite;
}

@keyframes reOpenFlapLoop {
    0%, 20% { transform: rotateX(0deg); }
    45%, 75% { transform: rotateX(180deg); }
    90%, 100% { transform: rotateX(0deg); }
}

@keyframes reEmergeLetterLoop {
    0%, 25% { transform: translateY(4px); opacity: 0; }
    50%, 70% { transform: translateY(-7px); opacity: 1; }
    88%, 100% { transform: translateY(4px); opacity: 0; }
}

/* Animación del Check */
.re-newsletter-icon.is-success {
    background: #ffffff;
    animation: rePopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.re-newsletter-icon.is-success .re-icon-mail {
    display: none;
}

.re-newsletter-icon.is-success .re-icon-check {
    display: block;
}

.re-check-path {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
}

.re-newsletter-icon.is-success .re-check-path {
    animation: reDrawCheckUp 0.5s cubic-bezier(0.65, 0, 0.45, 1) forwards 0.2s;
}

@keyframes rePopIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1.08); opacity: 1; }
}

@keyframes reDrawCheckUp {
    from { stroke-dashoffset: 50; }
    to { stroke-dashoffset: 0; }
}

#re-newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    max-width: 520px;
}

.re-newsletter-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

/* INPUT DE CORREO - Altura y tamaño forzados para evitar que se vea pequeño */
#re-subscriber-email {
    flex: 1;
    width: 100% !important;
    height: 48px !important;
    min-height: 48px !important;
    line-height: 48px !important;
    padding: 0 16px !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    background: #ffffff !important;
    color: #1a1a1a !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    outline: none !important;
    box-sizing: border-box !important;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.08) !important;
    transition: all 0.2s;
    margin: 0 !important;
    -webkit-appearance: none !important;
}

#re-subscriber-email::placeholder {
    color: #777777;
}

#re-subscriber-email:focus {
    border-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3) !important;
}

/* BOTONES */
#re-newsletter-submit, #re-newsletter-unsubscribe {
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 24px !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    letter-spacing: 0.3px !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    margin: 0 !important;
    vertical-align: middle !important;
}

#re-newsletter-submit {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    border: 1px solid #1a1a1a !important;
}

#re-newsletter-submit:hover {
    background-color: #000000 !important;
    border-color: #000000 !important;
    transform: translateY(-1px);
}

#re-newsletter-unsubscribe {
    background-color: #28a745 !important;
    color: #ffffff !important;
    border: 1px solid #28a745 !important;
}

#re-newsletter-unsubscribe:hover {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    transform: translateY(-1px);
}

.re-newsletter-policy {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
}

.re-newsletter-policy label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    margin: 0;
    font-weight: normal;
}

.re-newsletter-policy input[type="checkbox"] {
    accent-color: #1a1a1a;
    cursor: pointer;
    width: 14px;
    height: 14px;
    margin: 0;
}

.re-newsletter-policy a {
    color: #ffffff;
    text-decoration: underline;
    font-weight: 600;
}

.re-newsletter-policy a:hover {
    color: #f0f0f0;
}

.re-newsletter-close {
    position: absolute;
    top: 10px;
    right: 20px;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 2147483647 !important;
}

.re-newsletter-close:hover {
    background: rgba(255, 255, 255, 0.45);
    transform: scale(1.1);
}

/* Mensajes con Fade Out */
#re-newsletter-message {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    margin-top: 12px;
    width: 100%;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: opacity 0.5s ease;
    opacity: 1;
}

.re-msg-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #ffffff;
    color: #e00712;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

/* Modal de Políticas */
.re-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.re-modal-card {
    background: #ffffff;
    color: #1a1a1a;
    max-width: 500px;
    width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: reFadeIn 0.3s ease;
}

@keyframes reFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.re-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eeeeee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    flex-shrink: 0;
}

.re-modal-header h4 {
    margin: 0;
    font-size: 16px;
    color: #e00712;
    font-weight: 700;
}

.re-modal-close-btn {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #888888;
}

.re-modal-close-btn:hover {
    color: #000000;
}

.re-modal-body {
    padding: 20px;
    font-size: 13.5px;
    line-height: 1.6;
    color: #444444;
    overflow-y: auto;
    flex: 1;
}

.re-modal-body p {
    margin: 0 0 12px 0;
}

.re-modal-body p:last-child {
    margin-bottom: 0;
}

.re-modal-footer {
    padding: 12px 20px;
    background: #f8f9fa;
    border-top: 1px solid #eeeeee;
    text-align: right;
    flex-shrink: 0;
}

.re-modal-accept-btn {
    background: #e00712;
    color: #ffffff;
    border: none;
    padding: 8px 18px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
}

.re-modal-accept-btn:hover {
    background: #c0060f;
}

/* Reglas Responsivas para Pantallas Móviles */
@media(max-width: 768px) {
    .re-newsletter-container,
    .re-newsletter-container.is-static {
        padding: 20px 15px 15px 15px !important;
    }
    
    .re-newsletter-content {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px !important;
    }
    
    #re-newsletter-form {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .re-newsletter-input-group {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        gap: 10px !important;
    }
    
    #re-subscriber-email, 
    #re-newsletter-submit, 
    #re-newsletter-unsubscribe {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        height: 48px !important;
        min-height: 48px !important;
        font-size: 15px !important;
        margin: 0 !important;
    }
    
    .re-newsletter-close {
        top: 8px;
        right: 8px;
    }
}